KTimeTracker
ktimetracker running on the N810 |
This page is for people who want to participate in the ktimetracker community. So, for (future) ktimetracker developers.
Architecture
ktimetracker is a standalone application. MainWindow displays a timetrackerwidget, that is a ktabwidget containing one or more taskviews. A taskview is associated with a timetrackerstorage object that holds a calendar with todos and events. A taskview is a QTreeWidget that holds tasks. A task has a summary (name), a priority and times: the time, total time, session time and total session time. Over the QTreeWidget, a task can have subtasks. The total time is defined as the task's and all its subtasks' times.
Roadmap to the classes
See http://api.kde.org/4.x-api/kdepim-apidocs/ktimetracker/html/
main -> mainwindow ------------------------ -> task \ / -> timetrackerwidget -(contains n>=0)-> taskview - / \ ktimetracker_plugin -> ktimetrackerpart --- -> timetrackerstorage KTimeTrackerSettings
ktimetracker's program main.cpp creates mainwindow, this creates a timetrackerpart this calls timetrackerwidget, this calls taskview, this contains a timetrackerstorage.
karmstorage stores and loads the events and tasks. taskview displays them. timetrackerwidget displays one or more taskviews in tabs, plus the searchWidget. timetrackerpart can be integrated into a mainwindow or a kontact plugin. mainwindow adds the menu.
MainWindow is the outermost layer and initializes the menus and actions, sets up the status bar, and handles many of the signal-to-slot connections. It holds a pointer to the timetrackerwidget and Preferences objects and implements the ktimetracker DBUS interface.
TaskView does most of the work in the application. This QListWidget subclass sets up the columns in the list, the idle detection timer, the auto save timer, and the desktop tracker. It starts and stops timers, handles importing and exporting and displays the edit task dialog in response to user action. TaskView holds a private pointer to Preferences and a timetrackerstorage object.
A Task is a QListViewItem subclass stores state such as the timer totals, if a timer is currently running for the task. It also defines the list view sort order and can return a pointer to a KCal::Todo object that holds the same information.
Preferences is a singleton that stores configuration options. It raises signals when options change (for example, the location where the ktimetracker data is stored) so the application can react and adjust.
timetrackerstorage is a singleton that creates an interface for storing ktimetracker data. Currently, it uses KDE Resource framework and stores data in the iCalendar format.
KTimeTrackerSettings stores ktimetracker's configuration, settings, preferences or however you call it. It is declared in the file ktimetracker.h.
how configuration is programmed
Configuration is also called preferences. The following files are involved:
- cfgbehavior.ui
- ui_cfgbehavior.h - automatically created from cfgbehavior.ui
- preferences.h - saves which tasks will be shown expanded and which ones collapsed
- preferences.cpp - saves which tasks will be shown expanded and which ones collapsed
- preferences.moc - automatically created from preferences.h
- ktimetrackerconfigdialog.cpp
- ktimetracker.kcfgc
- ktimetracker.kcfg
- ktimetracker.h - declaring the class KTimeTrackerSettings. This file is automatically generated from ktimetracker.kcfg.
- ktimetracker.cpp - implementing the class KTimeTrackerSettings. This file is automatically generated from ktimetracker.kcfg.
- ktimetrackerconfigdialog.cpp
- ktimetrackerconfigdialog.h
ktimetracker in the web
If you need to update screenshots you might have to do it on the following pages:
- http://userbase.kde.org/KTimeTracker
- https://community.kde.org/Ktimetracker
- http://kde.org/applications/utilities/ktimetracker/ - deleted as of 2019-05-26
bugs
- Find ktimetracker's open bugs (without NEEDINFO bugs) with this query
- find all ktimetracker's bugs with this query
coding style
It is more important that you contribute than that you contribute with the right coding style. That having said, I prefer if you use code that is consistent with QtCreator's defaults. Opening and closing brackets and parentheses should be on the same row or column.
development direction
There should not be any "New" and "Close". ktimetracker should contain exactly one taskview. See https://bugs.kde.org/show_bug.cgi?id=182317 and https://bugs.kde.org/show_bug.cgi?id=265085
The help menu is stupidly overloaded and I cannot do anything about it because it is somewhere hidden in the library code. Would love to simplify it. "Help" does not need subitems - you want help.
Polls
recent activity
- Ktimetracker history export and editing broken
- setting changes do not have immediate effect
- Store value in edit history dialog even if user does not change cell afterwards., fix, backport
- When saving to ical file, ktimetracker adds timezone info to DTSTART but not to DTEND, fix, backport
- when I start ktimetracker for the first time, a file dialog appears, fix, backport
- tray icons
Maintainer knowledge
If you want to hand over maintainership, here is some info:
- to be allowed to change ktimetracker options in bugzilla, like adding a new version to bugzilla:
- open a request under https://bugs.kde.org/enter_sysadmin_request.cgi and ask to be added to the editcomponents group
- change ktimetracker options (e.g. add a version) under https://bugs.kde.org/editproducts.cgi?action=edit&product=ktimetracker