Here are your classes:
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
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
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
Here is an example to give you an idea:
touch .kde/share/apps/kabc/lock/_home_tom_.kde_share_apps_karm_karm.ics.lock
cmake -DCMAKE_BUILD_TYPE=Release
http://websvn.kde.org/trunk/KDE/kdepim/doc/ktimetracker
http://userbase.kde.org/KTimeTracker
The following similar programs can give you inspiration how to move forward developing:
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.
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.
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
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
http://websvn.kde.org/trunk/playground/base/plasma/applets/timetracker/