KTimeTracker/Developing
Also available in:
English | Dansk | Deutsch | Français | Italiano | Norwegian | Русский | српски | Slovenščina | Suomi | 简体中文 | Galego | Eesti | Español | Esperanto | Svenska | 한국어 | Română | Brazilian Portuguese | Česky | عربي | فارسی | Polski | 日本語 | 正體中文 | Українська
[edit] Developing KTimeTracker
- look at our Bugzilla
- join our discussion on irc.kde.org, channel #kontact
- learn programming with KDE's Programming Tutorial
[edit] So you want to become a KTimeTracker developer
Here are your classes:
- mainwindow.*: Is the main window of the KDE application
- ktimetrackerpart.*: Is the KPart of KTimeTracker
- timetrackerwidget.*: Is a widget with no or several tabs that contain
- taskview.*: Is a treeListWidget that contains:
- task.*: A QObject and QTreeWidgetItem. A task can be constructed from a taskview and a todo. As soon as you instantiate a task, it becomes visible in your TreeWidget.
- timetrackerstorage.*: Is the storage backend that contains a:
- KCal::ResourceCalendar
- taskview.*: Is a treeListWidget that contains:
- timetrackerwidget.*: Is a widget with no or several tabs that contain
[edit] Nokia N810
I got a Nokia N810 from Nokia to allow me porting KTimeTracker to it. I appreciate this a lot and am now kompiling KTimeTracker for arm. The project is not ready, here is what I found out:
To kompile KTimeTracker for the Nokia N810
- add the maemo repository
- install openssh
[edit] dbus
dbus is clearly a developer topic. To test the dbus functionality of your KTimeTracker, have KTimeTracker running and proceed like in this example:
qdbus ... org.kde.KTimeTracker ... qdbus org.kde.KTimeTracker ... /KTimeTracker ... qdbus org.kde.KTimeTracker /KTimeTracker ... method void org.kde.KTimeTracker.KTimeTracker.quit() ... qdbus org.kde.KTimeTracker /KTimeTracker org.kde.KTimeTracker.KTimeTracker.quit
[edit] Internationalization
You want to test the translation of KTimeTracker. For this, you want to call KTimeTracker in, say, german. For this, you need to know how you at all can call a KDE 4 program in another language than english. Here is as an example how I call akregator in german:
wget http://websvn.kde.org/*checkout*/trunk/l10n-kde4/de/messages/kdepim/ktimetracker.po msgfmt -o ktimetracker.mo ktimetracker.po cp ktimetracker.mo .kde4/share/locale/de/LC_MESSAGES/ KDE4_LANG=de ktimetracker
[edit] How to reproduce a stale lock
Here is an example to give you an idea:
touch .kde/share/apps/kabc/lock/_home_tom_.kde_share_apps_karm_karm.ics.lock
[edit] How to get rid of debugging output
cmake -DCMAKE_BUILD_TYPE=Release
[edit] Goals
- Unicode - I found out it is already capable of UTF-8.
[edit] Where is what ?
- The latest development sourcecode is available via web at http://websvn.kde.org/trunk/KDE/kdepim/ktimetracker
- You can subscribe to watch code changes at
- You can get informed on irc about code changes at freenode, channel #kde-commits
- You can discuss about KDE pim development on freenode, channel #kontact
- The api documentation is available at http://api.kde.org/4.x-api/kdepim-apidocs/ktimetracker/html/index.html
- The user documentation is generated from
http://websvn.kde.org/trunk/KDE/kdepim/doc/ktimetracker
- KTimeTracker all-you-need in the internet:
http://userbase.kde.org/KTimeTracker
[edit] Development Direction
The following similar programs can give you inspiration how to move forward developing:
- hourglass
- gnotime
- titrax
- taskCoach
- Hamster
[edit] Kontact plugin vs. Standalone
The Kontact plugin is realized via a KPart. The elegant solution would be to have one KPart that can be integrated into Kontact and one shell that just displays the KPart. This is not so far now. At the moment, ktimetrackerpart.cpp implements the KTimeTracker part and mainwindow.cpp implements the standalone application.
[edit] IdleTimeDetector
The idletimedetector is in the equally-named .cpp and .h file. It starts a qtimer and at every timeout, checks, if the X extension delivers for the last user interaction a timepoint that is further away than the maxIdleTime.
[edit] About storage
The storage of your KTimeTracker data takes place in an iCal file. That format needs a bit of explanation. A simple one looks like the following:
BEGIN:VCALENDAR PRODID:-//K Desktop Environment//NONSGML libkcal 3.5//EN VERSION:2.0 BEGIN:VTODO DTSTAMP:20060915T181010Z ORGANIZER;CN=root:MAILTO: X-KDE-karm-totalSessionTime:0 X-KDE-karm-totalTaskTime:19 CREATED:20060609T230212Z UID:libkcal-652058592.803 SEQUENCE:0 LAST-MODIFIED:20060915T181010Z SUMMARY:fg CLASS:PUBLIC PRIORITY:5 PERCENT-COMPLETE:0 END:VTODO BEGIN:VEVENT DTSTAMP:20060915T181010Z ORGANIZER:MAILTO: X-KDE-karm-duration:300 CREATED:20060915T174305Z UID:libkcal-6397995.845 SEQUENCE:0 LAST-MODIFIED:20060910T174305Z SUMMARY:fg CLASS:PUBLIC PRIORITY:5 CATEGORIES:KArm RELATED-TO:libkcal-652058592.803 DTSTART:20060910T172346Z DTEND:20060910T174305Z TRANSP:OPAQUE END:VEVENT END:VCALENDAR
[edit] A test case for kcal
CMakeLists.txt
PROJECT( kde4start )
FIND_PACKAGE(KDE4 REQUIRED)
INCLUDE_DIRECTORIES( ${KDE4_INCLUDES} . )
SET(kde4startSources main.cpp )
KDE4_ADD_EXECUTABLE(kde4start ${kde4startSources} )
TARGET_LINK_LIBRARIES(kde4start ${KDE4_KDEUI_LIBS} ${KDE4_KCAL_LIBS} ${KDE4_KPARTS_LIBS} kdepim kcal_resourceremote )
main.cpp
#include <QString>
#include <kapplication.h>
#include <kaboutdata.h>
#include <kmessagebox.h>
#include <kcmdlineargs.h>
#include <KMainWindow>
#include <kcal/resourcecalendar.h>
#include <kcal/resourcecached.h>
#include <kcal/resourcelocal.h>
int main (int argc, char *argv[])
{
const QByteArray& ba=QByteArray("test");
const KLocalizedString name=ki18n("myName");
KAboutData aboutData( ba, ba, name, ba, name);
KCmdLineArgs::init( argc, argv, &aboutData );
KApplication khello;
KCal::ResourceCalendar* cal;
KCal::ResourceCached* resource;
resource=new KCal::ResourceLocal("/tmp/KTimeTrackerkonsole.ics");
cal=resource;
}
Compile, link and run
cmake . && make && ./kde4start
[edit] Related Projects
http://websvn.kde.org/trunk/playground/base/plasma/applets/timetracker/
