Jump to content

KTimeTracker: Difference between revisions

From KDE Community Wiki
Line 69: Line 69:
= bugs =
= bugs =
* Find ktimetracker's open bugs with [https://bugs.kde.org/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&product=ktimetracker&long_desc_type=substring&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&keywords_type=allwords&keywords=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0= this bugzilla query]
* Find ktimetracker's open bugs with [https://bugs.kde.org/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&product=ktimetracker&long_desc_type=substring&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&keywords_type=allwords&keywords=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0= this bugzilla query]
* find all ktimetracker's bugs with [https://bugs.kde.org/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&product=ktimetracker&component=general&component=reporting&version=unspecified&version=1.0&version=3.0.3&version=3.2&version=Git+%28master%29&version=1.5&version=1.6&version=4.4.0&version=4.3.3&version=4.4.1&version=4.4.2&version=4.7.0&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&keywords_type=allwords&keywords=&bug_severity=critical&bug_severity=grave&bug_severity=major&bug_severity=crash&bug_severity=normal&bug_severity=minor&bug_severity=wishlist&priority=VHI&priority=HI&priority=NOR&priority=LO&priority=VLO&rep_platform=Unlisted+Binaries&rep_platform=Compiled+Sources&rep_platform=Caldera+RPMs&rep_platform=Chakra&rep_platform=Conectiva+RPMs&rep_platform=Debian+stable&rep_platform=Debian+testing&rep_platform=Debian+unstable&rep_platform=Exherbo+Packages&rep_platform=Gentoo+Packages&rep_platform=Mandrake+RPMs&rep_platform=Mandriva+RPMs&rep_platform=Slackware+Packages&rep_platform=openSUSE+RPMs&rep_platform=RedHat+RPMs&rep_platform=Fedora+RPMs&rep_platform=Ubuntu+Packages&rep_platform=Pardus+PiSi+Packages&rep_platform=Archlinux+Packages&rep_platform=FreeBSD+Ports&rep_platform=NetBSD+pkgsrc&rep_platform=OpenBSD+Packages&rep_platform=Fink+Packages&rep_platform=MacPorts+Packages&rep_platform=Mac+OS+X+Disk+Images&rep_platform=Solaris+Packages&rep_platform=Tru64+Unix+Packages&rep_platform=AIX+Packages&rep_platform=MS+Windows&rep_platform=Windows+CE&rep_platform=Maemo+5&rep_platform=Mageia+RPMs&rep_platform=unspecified&op_sys=Linux&op_sys=FreeBSD&op_sys=NetBSD&op_sys=OpenBSD&op_sys=AIX&op_sys=HP-UX&op_sys=IRIX&op_sys=Tru64&op_sys=Solaris&op_sys=Cygwin&op_sys=OS+X&op_sys=MS+Windows&op_sys=Windows+CE&op_sys=other&op_sys=All&op_sys=unspecified&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&known_name=allKTiMeTrackerBugs&query_based_on=allKTiMeTrackerBugs&columnlist=changeddate%2Cbug_severity%2Cpriority%2Cassigned_to%2Creporter%2Creporter_realname%2Cbug_status%2Cresolution%2Cproduct%2Ccomponent%2Cop_sys%2Cshort_desc&field0-0-0=noop&type0-0-0=noop&value0-0-0= this query]
* find all ktimetracker's bugs with [https://bugs.kde.org/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&product=ktimetracker&version=unspecified&version=1.0&version=3.0.3&version=3.2&version=Git+%28master%29&version=1.5&version=1.6&version=4.4.0&version=4.3.3&version=4.4.1&version=4.4.2&version=4.7.0&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&keywords_type=allwords&keywords=&bug_severity=critical&bug_severity=grave&bug_severity=major&bug_severity=crash&bug_severity=normal&bug_severity=minor&bug_severity=wishlist&priority=VHI&priority=HI&priority=NOR&priority=LO&priority=VLO&rep_platform=Unlisted+Binaries&rep_platform=Compiled+Sources&rep_platform=Caldera+RPMs&rep_platform=Chakra&rep_platform=Conectiva+RPMs&rep_platform=Debian+stable&rep_platform=Debian+testing&rep_platform=Debian+unstable&rep_platform=Exherbo+Packages&rep_platform=Gentoo+Packages&rep_platform=Mandrake+RPMs&rep_platform=Mandriva+RPMs&rep_platform=Slackware+Packages&rep_platform=openSUSE+RPMs&rep_platform=RedHat+RPMs&rep_platform=Fedora+RPMs&rep_platform=Ubuntu+Packages&rep_platform=Pardus+PiSi+Packages&rep_platform=Archlinux+Packages&rep_platform=FreeBSD+Ports&rep_platform=NetBSD+pkgsrc&rep_platform=OpenBSD+Packages&rep_platform=Fink+Packages&rep_platform=MacPorts+Packages&rep_platform=Mac+OS+X+Disk+Images&rep_platform=Solaris+Packages&rep_platform=Tru64+Unix+Packages&rep_platform=AIX+Packages&rep_platform=MS+Windows&rep_platform=Windows+CE&rep_platform=Maemo+5&rep_platform=Mageia+RPMs&rep_platform=unspecified&op_sys=Linux&op_sys=FreeBSD&op_sys=NetBSD&op_sys=OpenBSD&op_sys=AIX&op_sys=HP-UX&op_sys=IRIX&op_sys=Tru64&op_sys=Solaris&op_sys=Cygwin&op_sys=OS+X&op_sys=MS+Windows&op_sys=Windows+CE&op_sys=other&op_sys=All&op_sys=unspecified&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&known_name=allKTiMeTrackerBugs&query_based_on=allKTiMeTrackerBugs&columnlist=changeddate%2Cbug_severity%2Cpriority%2Cassigned_to%2Creporter%2Creporter_realname%2Cbug_status%2Cresolution%2Cproduct%2Ccomponent%2Cop_sys%2Cshort_desc&field0-0-0=noop&type0-0-0=noop&value0-0-0= this query]


= coding style =
= coding style =

Revision as of 12:23, 9 October 2011

Ktimetracker
ktimetracker running on the N810


This page is for people who want to participate in the ktimetracker community. So, for (future) ktimetracker developers.

IDE

Please use qtcreator. Why? Quite easy: The description how to set up kdevelop with KDE is over 200 lines long. For eclipse it is 97 and for QtCreator it is 13. So, 13 lines to read instead of 222.

Architecture

ktimetracker can be a kpart (class ktimetrackerpart) or a mainwindow (class mainwindow). The kpart can be used e.g. for a kontact plugin, the mainwindow as stand-alone application. Both classes display 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
  • ktimetracker_config_behavior.desktop
  • ktimetracker_config_display.desktop
  • ktimetracker_config_storage.desktop
  • 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:

bugs

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.

git art

git checkout KDE/4.7

then

git cherry-pick -x <commit>

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

ktimetracker benchmark

The help menu

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.

The KPart Mess

ktimetracker is an application displaying a kpart. On the one hand, this makes it easy to be integrated as kontact plugin. But on the other hand, I have the feeling, ktimetracker can no long be debugged so easily. Here are the reasons why dedicated applications are better:

Polls

recent activity

Maintainer knowledge

If you want to hand over maintainership, here is some info: