[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-bugs-dist
Subject: [Bug 80462] csv export of task containing slash works wrong
From: Mark Bucciarelli <mark () hubcapconsulting ! com>
Date: 2004-04-29 2:42:23
Message-ID: 20040429024223.941.qmail () ktown ! kde ! org
[Download RAW message or body]
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
http://bugs.kde.org/show_bug.cgi?id=80462
mark hubcapconsulting com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
------- Additional Comments From mark hubcapconsulting com 2004-04-29 04:42 -------
CVS commit by bucciare:
Use QListViewItem depth() method to figure out
how many comma's to prefix task info with in
CSV export.
CCMAIL: 80462-done bugs kde org
M +5 -29 karmstorage.cpp 1.21
--- kdepim/karm/karmstorage.cpp #1.20:1.21
@ -455,4 +455,5 @ QString KarmStorage::exportcsvFile(TaskV
QString err;
+ Task* task;
kdDebug(5970)
@ -468,38 +469,13 @ QString KarmStorage::exportcsvFile(TaskV
QTextStream stream(&f);
- // Determine depth of the tasks.
- // The depth is: how often can you say "the task is a subtask of".
- //
- // Example:
- // The task is a subtask of a subtask of a supertask=> depth is 2
- int depth = 0; // depth of deepest task
- int taskdeepn[taskview->count()]; // depth of each task
-
- Task* task;
for (int tasknr=0; tasknr<=taskview->count()-1; ++tasknr)
{
task = taskview->item_at_index(tasknr);
- taskdeepn[tasknr+1] = 0;
- for (uint i=0; i<=task->fullName().length()-1; ++i)
- {
- // Each '/' character indicates the next in depth
- if (task->fullName().latin1()[i] == '/')
- {
- taskdeepn[tasknr+1]++;
- }
- }
- if (taskdeepn[tasknr+1] > depth)
- {
- depth=taskdeepn[tasknr+1];
- }
- }
-
- for (int tasknr=0; tasknr<=taskview->count()-1; ++tasknr)
- {
- task = taskview->item_at_index(tasknr);
+ kdDebug(5970) << "KarmStorage::exportcsvFile: "
+ << task->name() << ": " << task->depth() << endl;
// indent the task in the csv-file:
- for (int i=0; i<taskdeepn[tasknr+1]; ++i)
+ for (int i=0; i < task->depth(); ++i)
{
stream << delim;
@ -508,5 +484,5 @ QString KarmStorage::exportcsvFile(TaskV
// maybe other tasks are more indented, so to align the columns:
- for (int i=0; i<depth-taskdeepn[tasknr+1]; ++i)
+ for (int i=0; i<task->depth(); ++i)
{
stream << delim;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic