diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
commit | 67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch) | |
tree | 5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /karm/karmstorage.cpp | |
parent | 2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff) | |
download | tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip |
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4,
however Qt3 builds are OK. Any alterations this commit makes to kdepim
behaviour under Qt3 are unintentional and should be fixed.
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'karm/karmstorage.cpp')
-rw-r--r-- | karm/karmstorage.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/karm/karmstorage.cpp b/karm/karmstorage.cpp index 7a6bfcb9b..4a7dabc2a 100644 --- a/karm/karmstorage.cpp +++ b/karm/karmstorage.cpp @@ -156,7 +156,7 @@ TQString KarmStorage::load (TaskView* view, const Preferences* preferences, TQSt TQDict< Task > map; // Build dictionary to look up Task object from Todo uid. Each task is a - // TQListViewItem, and is initially added with the view as the parent. + // TQListViewItem, and is initially added with the view as the tqparent. todoList = _calendar->rawTodos(); kdDebug(5970) << "KarmStorage::load " << "rawTodo count (includes completed todos) =" @@ -186,19 +186,19 @@ TQString KarmStorage::load (TaskView* view, const Preferences* preferences, TQSt task->setPixmapProgress(); } - // Load each task under it's parent task. + // Load each task under it's tqparent task. for( todo = todoList.begin(); todo != todoList.end(); ++todo ) { - Task* task = map.find( (*todo)->uid() ); + Task* task = map.tqfind( (*todo)->uid() ); // No relatedTo incident just means this is a top-level task. if ( (*todo)->relatedTo() ) { - Task* newParent = map.find( (*todo)->relatedToUid() ); + Task* newParent = map.tqfind( (*todo)->relatedToUid() ); // Complete the loading but return a message if ( !newParent ) - err = i18n("Error loading \"%1\": could not find parent (uid=%2)") + err = i18n("Error loading \"%1\": could not find tqparent (uid=%2)") .arg(task->name()) .arg((*todo)->relatedToUid()); @@ -245,7 +245,7 @@ TQString KarmStorage::buildTaskView(KCal::ResourceCalendar *rc, TaskView *view) // 1. insert tasks form rc into taskview // 1.1. Build dictionary to look up Task object from Todo uid. Each task is a - // TQListViewItem, and is initially added with the view as the parent. + // TQListViewItem, and is initially added with the view as the tqparent. todoList = rc->rawTodos(); for( todo = todoList.begin(); todo != todoList.end(); ++todo ) { @@ -255,19 +255,19 @@ TQString KarmStorage::buildTaskView(KCal::ResourceCalendar *rc, TaskView *view) task->setPixmapProgress(); } - // 1.1. Load each task under it's parent task. + // 1.1. Load each task under it's tqparent task. for( todo = todoList.begin(); todo != todoList.end(); ++todo ) { - Task* task = map.find( (*todo)->uid() ); + Task* task = map.tqfind( (*todo)->uid() ); // No relatedTo incident just means this is a top-level task. if ( (*todo)->relatedTo() ) { - Task* newParent = map.find( (*todo)->relatedToUid() ); + Task* newParent = map.tqfind( (*todo)->relatedToUid() ); // Complete the loading but return a message if ( !newParent ) - err = i18n("Error loading \"%1\": could not find parent (uid=%2)") + err = i18n("Error loading \"%1\": could not find tqparent (uid=%2)") .arg(task->name()) .arg((*todo)->relatedToUid()); @@ -310,11 +310,11 @@ TQString KarmStorage::save(TaskView* taskview) kdDebug(5970) << "entering KarmStorage::save" << endl; TQString err=TQString(); - TQPtrStack< KCal::Todo > parents; + TQPtrStack< KCal::Todo > tqparents; for (Task* task=taskview->first_child(); task; task = task->nextSibling()) { - err=writeTaskAsTodo(task, 1, parents ); + err=writeTaskAsTodo(task, 1, tqparents ); } if ( !saveCalendar() ) @@ -337,7 +337,7 @@ TQString KarmStorage::save(TaskView* taskview) } TQString KarmStorage::writeTaskAsTodo(Task* task, const int level, - TQPtrStack< KCal::Todo >& parents ) + TQPtrStack< KCal::Todo >& tqparents ) { TQString err; KCal::Todo* todo; @@ -349,16 +349,16 @@ TQString KarmStorage::writeTaskAsTodo(Task* task, const int level, return "Could not get todo from calendar"; } task->asTodo(todo); - if ( !parents.isEmpty() ) todo->setRelatedTo( parents.top() ); - parents.push( todo ); + if ( !tqparents.isEmpty() ) todo->setRelatedTo( tqparents.top() ); + tqparents.push( todo ); for ( Task* nextTask = task->firstChild(); nextTask; nextTask = nextTask->nextSibling() ) { - err = writeTaskAsTodo(nextTask, level+1, parents ); + err = writeTaskAsTodo(nextTask, level+1, tqparents ); } - parents.pop(); + tqparents.pop(); return err; } @@ -439,17 +439,17 @@ TQString KarmStorage::loadFromFlatFile(TaskView* taskview, task->setUid(addTask(task, 0)); } else { - Task *parent = stack.top(); + Task *tqparent = stack.top(); kdDebug(5970) << "KarmStorage::loadFromFlatFile - task: " << name - << " min: " << minutes << " parent" << parent->name() << "\n"; - task = new Task(name, minutes, 0, desktopList, parent); + << " min: " << minutes << " tqparent" << tqparent->name() << "\n"; + task = new Task(name, minutes, 0, desktopList, tqparent); - task->setUid(addTask(task, parent)); + task->setUid(addTask(task, tqparent)); // Legacy File Format (!): - parent->changeTimes(0, -minutes); + tqparent->changeTimes(0, -minutes); taskview->setRootIsDecorated(true); - parent->setOpen(true); + tqparent->setOpen(true); } if (!task->uid().isNull()) stack.push(task); @@ -482,12 +482,12 @@ TQString KarmStorage::loadFromFlatFileCumulative(TaskView* taskview, bool KarmStorage::parseLine(TQString line, long *time, TQString *name, int *level, DesktopList* desktopList) { - if (line.find('#') == 0) { + if (line.tqfind('#') == 0) { // A comment line return false; } - int index = line.find('\t'); + int index = line.tqfind('\t'); if (index == -1) { // This doesn't seem like a valid record return false; @@ -496,7 +496,7 @@ bool KarmStorage::parseLine(TQString line, long *time, TQString *name, TQString levelStr = line.left(index); TQString rest = line.remove(0,index+1); - index = rest.find('\t'); + index = rest.tqfind('\t'); if (index == -1) { // This doesn't seem like a valid record return false; @@ -507,7 +507,7 @@ bool KarmStorage::parseLine(TQString line, long *time, TQString *name, bool ok; - index = rest.find('\t'); // check for optional desktops string + index = rest.tqfind('\t'); // check for optional desktops string if (index >= 0) { *name = rest.left(index); TQString deskLine = rest.remove(0,index+1); @@ -516,7 +516,7 @@ bool KarmStorage::parseLine(TQString line, long *time, TQString *name, // an DesktopList TQString ds; int d; - int commaIdx = deskLine.find(','); + int commaIdx = deskLine.tqfind(','); while (commaIdx >= 0) { ds = deskLine.left(commaIdx); d = ds.toInt(&ok); @@ -525,7 +525,7 @@ bool KarmStorage::parseLine(TQString line, long *time, TQString *name, desktopList->push_back(d); deskLine.remove(0,commaIdx+1); - commaIdx = deskLine.find(','); + commaIdx = deskLine.tqfind(','); } d = deskLine.toInt(&ok); @@ -556,12 +556,12 @@ bool KarmStorage::parseLine(TQString line, long *time, TQString *name, void KarmStorage::adjustFromLegacyFileFormat(Task* task) { - // unless the parent is the listView - if ( task->parent() ) - task->parent()->changeTimes(-task->sessionTime(), -task->time()); + // unless the tqparent is the listView + if ( task->tqparent() ) + task->tqparent()->changeTimes(-task->sessionTime(), -task->time()); // traverse depth first - - // as soon as we're in a leaf, we'll substract it's time from the parent + // as soon as we're in a leaf, we'll substract it's time from the tqparent // then, while descending back we'll do the same for each node untill // we reach the root for ( Task* subtask = task->firstChild(); subtask; @@ -639,7 +639,7 @@ TQString KarmStorage::exportcsvFile( TaskView *taskview, if (to_quote) retval += dquote; - // Double quotes tqreplaced by a pair of consecutive double quotes + // Double quotes replaced by a pair of consecutive double quotes retval += task->name().tqreplace( dquote, double_dquote ); if (to_quote) @@ -701,7 +701,7 @@ TQString KarmStorage::exportcsvFile( TaskView *taskview, // public routines: // -TQString KarmStorage::addTask(const Task* task, const Task* parent) +TQString KarmStorage::addTask(const Task* task, const Task* tqparent) { KCal::Todo* todo; TQString uid; @@ -710,8 +710,8 @@ TQString KarmStorage::addTask(const Task* task, const Task* parent) if ( _calendar->addTodo( todo ) ) { task->asTodo( todo ); - if (parent) - todo->setRelatedTo(_calendar->todo(parent->uid())); + if (tqparent) + todo->setRelatedTo(_calendar->todo(tqparent->uid())); uid = todo->uid(); } else @@ -850,7 +850,7 @@ long KarmStorage::printTaskHistory ( if ( to_quote) cell.push_back(dquote); - // Double quotes tqreplaced by a pair of consecutive double quotes + // Double quotes replaced by a pair of consecutive double quotes cell.push_back(task->name().tqreplace( dquote, double_dquote )); if ( to_quote) cell.push_back(dquote); |