# # # patch "src/model/IconProvider.cpp" # from [5ddb47c181717faa5abde519814eabc988c2509a] # to [c96947be26f0a3665a14b501416afbeaff7be2d4] # # patch "src/model/Workspace.cpp" # from [2da2321fcd0d8925d6a5438a86029e1411624c76] # to [fee14d2e1d369645126d2415bd20702fe0fd31fd] # # patch "src/model/Workspace.h" # from [1443da62cced3ce55c2baabe5aa7d9d3c15d36ad] # to [632684069f8acbaa38ae4581b7c3cb47cdf5486e] # ============================================================ --- src/model/IconProvider.cpp 5ddb47c181717faa5abde519814eabc988c2509a +++ src/model/IconProvider.cpp c96947be26f0a3665a14b501416afbeaff7be2d4 @@ -47,7 +47,7 @@ { return *iconDirUnchanged; } - else if(item->hasStatus(WorkspaceItem::Unchanged)) + else if(item->hasStatus(WorkspaceItem::Patched)) { return *iconDirChanged; } ============================================================ --- src/model/Workspace.cpp 2da2321fcd0d8925d6a5438a86029e1411624c76 +++ src/model/Workspace.cpp fee14d2e1d369645126d2415bd20702fe0fd31fd @@ -107,7 +107,7 @@ QMap::iterator renameIter; WorkspaceItem *item; - QList* tempItems = new QList(); + QList tempItems; for (QStringList::Iterator it = output->begin(); it != output->end(); ++it) { @@ -180,8 +180,7 @@ int to_id = list[5].toInt(); // remove trailing slash - QString path = list[6]; - path = path.trimmed(); + QString path = list[6].trimmed(); bool isDirectory = false; if (path.endsWith('/')) { @@ -208,7 +207,7 @@ // item->isDirectory() // ); - tempItems->push_back(item); + tempItems.push_back(item); } int id = 0; @@ -226,12 +225,10 @@ // in more than one container // TODO: we should still look out for some tool which allows us to // monitor the app during execution for possible memory leaks. - renameMap.clear(); + //renameMap.clear(); - rootItem->setChildren(*(buildTreeRecursive(tempItems, NULL))); + rootItem->setChildren(buildTreeRecursive(tempItems, NULL)); - delete tempItems; - // reset the model to repaint the view completly // (all QModelIndexes are discarded through that, e.g. selections!) this->reset(); @@ -242,9 +239,9 @@ return; } -QList* Workspace::buildTreeRecursive(QList* items, WorkspaceItem* parentItem) +QList Workspace::buildTreeRecursive(QList &items, WorkspaceItem* parentItem) { - QList* finalItems = new QList(); + QList finalItems; WorkspaceItem *currentItem; QString parentPath = ""; @@ -254,9 +251,9 @@ parentPath = parentItem->getPath(); } - while (items->size() > 0) + while (items.size() > 0) { - currentItem = items->front(); + currentItem = items.front(); // // if the item is not directly inside the current path stop immediately @@ -272,7 +269,7 @@ } // remove the item if we can append it now - items->pop_front(); + items.pop_front(); // // it seems to be a valid item @@ -281,11 +278,12 @@ // if the item is directory a directory, make sure we catch decendant items... recursion! if (currentItem->isDirectory()) { - currentItem->setChildren(*(buildTreeRecursive(items, currentItem))); + //currentItem->setChildren(*(buildTreeRecursive(items, currentItem))); + currentItem->setChildren(buildTreeRecursive(items, currentItem)); } // append item to final list - finalItems->push_back(currentItem); + finalItems.push_back(currentItem); } return finalItems; ============================================================ --- src/model/Workspace.h 1443da62cced3ce55c2baabe5aa7d9d3c15d36ad +++ src/model/Workspace.h 632684069f8acbaa38ae4581b7c3cb47cdf5486e @@ -47,7 +47,7 @@ int columnCount(const QModelIndex&) const; private: - QList* buildTreeRecursive(QList*, WorkspaceItem*); + QList buildTreeRecursive(QList &, WorkspaceItem*); QDir *workspaceDir; Monotone *monotone; WorkspaceItem *rootItem;