# # # delete "src/Tools.h" # # delete "src/view/XPM.cpp" # # delete "src/view/XPM.h" # # patch "guitone.pro" # from [34c066c0fa40573afab0aa3fb5bcacc2225371f2] # to [e5eefaadd581fc0101a36dbdb01f946f388e2fbf] # # patch "src/model/Monotone.cpp" # from [59f289d5a80977020021f0821192ac4210c33bab] # to [e0c6415cf076a4202bb07b1450ba8dc4c849f895] # # patch "src/model/Workspace.cpp" # from [5f18048e6aa58cd66a1e4d1328aa70223c89d706] # to [17a5f4235bf6830115010d2a06524f15db075b96] # # patch "src/view/WorkspaceView.h" # from [039d660586b39fd96dede83ee613122474264394] # to [61e409a912c1dfec4aaeea5d38e6c87ea203af5e] # ============================================================ --- guitone.pro 34c066c0fa40573afab0aa3fb5bcacc2225371f2 +++ guitone.pro e5eefaadd581fc0101a36dbdb01f946f388e2fbf @@ -1,13 +1,10 @@ -CONFIG += qt debug -HEADERS += src/Tools.h \ - src/view/XPM.h \ - src/view/Guitone.h \ +CONFIG += qt debug precompile_header +HEADERS += src/view/Guitone.h \ src/view/WorkspaceView.h \ src/model/Monotone.h \ src/model/Workspace.h \ src/model/WorkspaceItem.h -SOURCES += src/view/XPM.cpp \ - src/view/Guitone.cpp \ +SOURCES += src/view/Guitone.cpp \ src/view/WorkspaceView.cpp \ src/model/Monotone.cpp \ src/model/Workspace.cpp \ @@ -21,6 +18,7 @@ DESTDIR = bin QT += qt3support TRANSLATIONS = i18n/guitone_de.ts -RESOURCES = res/guitone.qrc +RESOURCES = res/guitone.qrc +RCC_DIR = tmp PRECOMPILED_HEADER = src/stable.h ============================================================ --- src/model/Monotone.cpp 59f289d5a80977020021f0821192ac4210c33bab +++ src/model/Monotone.cpp e0c6415cf076a4202bb07b1450ba8dc4c849f895 @@ -20,8 +20,6 @@ #include "Monotone.h" -#include "../Tools.h" - Monotone* Monotone::instance = 0; Monotone::Monotone(QDir *workingDirectory) : QProcess() ============================================================ --- src/model/Workspace.cpp 5f18048e6aa58cd66a1e4d1328aa70223c89d706 +++ src/model/Workspace.cpp 17a5f4235bf6830115010d2a06524f15db075b96 @@ -183,14 +183,14 @@ // this item is given a parent explicitely later on item = new WorkspaceItem(NULL, path, status, isDirectory); - //if (from_id > 0) - //{ - // renameMap[-from_id] = item; - //} - //if (to_id > 0) - //{ - // renameMap[to_id] = item; - //} + if (from_id > 0) + { + renameMap[-from_id] = item; + } + if (to_id > 0) + { + renameMap[to_id] = item; + } // Display the item properties qDebug("Item: Name %s, PATH %s, Status %s, IsDir %d", @@ -213,6 +213,12 @@ renameMap[id]->setRenamedFrom(renameMap[-id]); renameMap[-id]->setRenamedTo(renameMap[id]); } + + // clear the map to avoid memory leaks by having pointers to objects + // 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(); rootItem->setChildren(*(buildTreeRecursive(tempItems, NULL))); ============================================================ --- src/view/WorkspaceView.h 039d660586b39fd96dede83ee613122474264394 +++ src/view/WorkspaceView.h 61e409a912c1dfec4aaeea5d38e6c87ea203af5e @@ -21,7 +21,6 @@ #ifndef WORKSPACE_VIEW_H #define WORKSPACE_VIEW_H -#include "XPM.h" #include "../model/WorkspaceItem.h" #include