Bug 266920 - KTimeTRacker file created in standalone application shows all times as 00:00
Summary: KTimeTRacker file created in standalone application shows all times as 00:00
Status: RESOLVED UNMAINTAINED
Alias: None
Product: ktimetracker
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Arch Linux All
: NOR normal
Target Milestone: ---
Assignee: Zoltan Gyarmati
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-22 22:49 UTC by Ricardo Graça
Modified: 2019-06-17 03:52 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ricardo Graça 2011-02-22 22:49:22 UTC
Version:           4.4.10 (using KDE 4.6.0) 
OS:                Linux

After creating a file in the standalone KTimeTracker application and tracking a few tasks, I opened it in the KTimeTracker component of Kontact and all times were displayed as 00:00. Opening it back again in the standalone KTimeTracker showed the correct times.

Reproducible: Always

Steps to Reproduce:
1. Open the standalone KTimeTracker
2. Create a new file
3. Save the file and then add a task (in this order or else you'll end up with a 0 byte file and loose all data, that's another bug)
3. Track/edit the task so that is has more than 00:00
4. Close KTimeTracker
5. Open Kontact
6. Go to the KTimeTracker component and open the previously saved file


Actual Results:  
Behold all times reset back to 00:00

Expected Results:  
The actual times get displayed
Comment 1 Ricardo Graça 2011-02-22 22:53:52 UTC
The other way around gives the same result BTW.
Comment 2 Thorsten Staerk 2011-10-09 10:45:37 UTC
I think the reason for this is the X-KDE-ktimetracker-duration in timetrackerstorage.cpp.
Comment 3 Thorsten Staerk 2011-10-13 07:18:21 UTC
I think this patch should make the difference. ToDo: Test, explain here why and look for possible refinements:

diff --git a/ktimetracker/timetrackerstorage.cpp b/ktimetracker/timetrackerstorage.cpp
index 004d0af..cd82fae 100644
--- a/ktimetracker/timetrackerstorage.cpp
+++ b/ktimetracker/timetrackerstorage.cpp
@@ -974,7 +974,7 @@ void timetrackerstorage::changeTime(const Task* task, const long deltaSeconds)
     e->setDtEnd(KDateTime(end, KDateTime::Spec::LocalZone()));
 
     // Use a custom property to keep a record of negative durations
-    e->setCustomProperty( KGlobal::mainComponent().componentName().toUtf8(),
+    e->setCustomProperty( "ktimetracker",
         QByteArray("duration"),
         QString::number(deltaSeconds));
Comment 4 Andrew Crouthamel 2018-09-04 18:54:09 UTC
Hello! Sorry to be the bearer of bad news, but this project has been unmaintained for many years so I will be closing this bug.
Comment 5 Alexander Potashev 2019-06-17 03:52:16 UTC
KTimeTracker is now ported to Qt5/KF5, however the Kontact plugin is dropped since the KDE PIM team and I agreed that KTimeTracker is not very relevant to KDE PIM/Kontact.

Thus, this bug is still RESOLVED as UNMAINTAINED.