Summary: | incomplete time reports totals | ||
---|---|---|---|
Product: | [Applications] ktimetracker | Reporter: | Ross Boylan <Ross.Boylan> |
Component: | general | Assignee: | Thorsten Staerk <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | This patch solves the problem. |
Description
Ross Boylan
2006-11-14 02:12:03 UTC
I can reproduce this. It seems to me that "Copy all Tasks" starts copying the tasks from the position of activeTask on. Created attachment 18559 [details]
This patch solves the problem.
SVN commit 604968 by tstaerk: Copy all tasks to clipboard. BUGS:137309 M +3 -3 taskview.cpp M +4 -1 timekard.cpp --- branches/KDE/3.5/kdepim/karm/taskview.cpp #604967:604968 @@ -797,13 +797,13 @@ i18n("Copy totals for just this task and its subtasks, or copy totals for all tasks?"), i18n("Copy Totals to Clipboard"), i18n("Copy This Task"), i18n("Copy All Tasks") ); - if (response == KMessageBox::Yes) // this task only + if (response == KMessageBox::Yes) // This task only { KApplication::clipboard()->setText(t.totalsAsText(this, true, TimeKard::TotalTime)); } - else // only task + else // All tasks { - KApplication::clipboard()->setText(t.totalsAsText(this, true, TimeKard::TotalTime)); + KApplication::clipboard()->setText(t.totalsAsText(this, false, TimeKard::TotalTime)); } } else --- branches/KDE/3.5/kdepim/karm/timekard.cpp #604967:604968 @@ -46,7 +46,9 @@ const QString cr = QString::fromLatin1("\n"); QString TimeKard::totalsAsText(TaskView* taskview, bool justThisTask, WhichTime which) +// Print the total Times as text. If justThisTask, use activeTask, else, all tasks { + kdDebug(5970) << "Entering TimeKard::totalsAsText" << endl; QString retval; QString line; QString buf; @@ -77,9 +79,10 @@ else { sum = 0; - for (Task* task= taskview->current_item(); task; + for (Task* task= taskview->item_at_index(0); task; task= task->nextSibling()) { + kdDebug(5970) << "Copying task " << task->name() << endl; int time = which == TotalTime ? task->totalTime() : task->totalSessionTime(); sum += time; if ( time || task->firstChild() ) Thank you! Ross On Tue, 2006-11-14 at 21:10 +0000, tstaerk wrote: [bugs.kde.org quoted mail] Did you mean for the debugging statement to be in the final version? + kdDebug(5970) << "Copying task " << task->name() << endl; The line + kdDebug(5970) << "Copying task " << task->name() << endl; indeed is to be in the final version. Who wants to develop the program, needs debugging output. Who does not want, compiles with --disable-debug. Thanks for the remark anyway. SVN commit 606176 by tstaerk: Copy all total times to clipboard, not only some. CCBUGS:137309 M +6 -2 timekard.cpp --- trunk/KDE/kdepim/karm/timekard.cpp #606175:606176 @@ -49,6 +49,7 @@ QString TimeKard::totalsAsText(TaskView* taskview, ReportCriteria rc) { + kDebug(5970) << "Entering TimeKard::totalsAsText" << endl; QString retval; QString line; QString buf; @@ -80,7 +81,7 @@ else // print all tasks { sum = 0; - for (Task* task= taskview->current_item(); task; + for (Task* task= taskview->item_at_index(0); task; task= task->nextSibling()) { if (!rc.sessionTimes) sum += task->totalTime(); @@ -106,6 +107,7 @@ // Print out "<indent for level> <task total> <task>", for task and subtasks. Used by totalsAsText. void TimeKard::printTask(Task *task, QString &s, int level, const ReportCriteria &rc) { + kDebug(5970) << "Entering TimeKard::printTask" << endl; QString buf; s += buf.fill(' ', level); @@ -147,6 +149,7 @@ const QDate& to, const int level, QString& s, bool totalsOnly) { + kDebug(5970) << "Entering TimeKard::printTaskHistory" << endl; long sectionsum = 0; for ( QDate day = from; day <= to; day = day.addDays(1) ) { @@ -202,7 +205,7 @@ const QString& name, bool justThisTask, bool totalsOnly) { - + kDebug(5970) << "Entering TimeKard::sectionHistoryAsText" << endl; const int sectionReportWidth = taskWidth + ( totalsOnly ? 0 : sectionFrom.daysTo(sectionTo) * timeWidth ) + totalTimeWidth; assert( sectionReportWidth > 0 ); QString line; @@ -324,6 +327,7 @@ QString TimeKard::historyAsText(TaskView* taskview, const QDate& from, const QDate& to, bool justThisTask, bool perWeek, bool totalsOnly) { + kDebug(5970) << "Entering TimeKard::historyAsText" << endl; // header QString retval; retval += totalsOnly ? i18n("Task Totals") : i18n("Task History"); |