diff --git a/manifest b/manifest index 3e1c660..75c018a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Renamed\sgetRepo\sto\sgetWorkspace -D 2015-04-30T11:04:43.529 +C Refactored\sWorkspace\scleanup +D 2015-04-30T11:10:27.176 F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35 F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b F debian/compat b6abd567fa79cbe0196d093a067271361dc6ca8b @@ -200,8 +200,8 @@ F src/FileTableView.cpp 5ddf8c391c9a3ac449ec61fb1db837b577afeec2 F src/FileTableView.h 03e56d87c2d46411b9762b87f4d301619aaf18df F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261 -F src/MainWindow.cpp 8b6494e94cf3c57fe2e4a9e0487813ad9a8f2f01 -F src/MainWindow.h fee72a22492e96e14913196a836c98c606a62904 +F src/MainWindow.cpp eef87990ce725c03e0f874548663864aae59d28d +F src/MainWindow.h fa49c7c005cf8b2be71d84302e41444d73a828da F src/SettingsDialog.cpp a46cff5e5dd425e3dbdd15632abfd5829f5562b4 F src/SettingsDialog.h 4e2790f581e991c744ae9f86580f1972b8c7ff43 F src/Utils.cpp f78728e0817b1db23007ba0d2c5c26980ee7ebca @@ -215,7 +215,7 @@ F ui/CommitDialog.ui 6200f6cabdcf40a20812e811be28e0793f82516f F ui/FileActionDialog.ui 89bb4dc2d0b8adcd41adcb11ec65f2028a09a12d F ui/MainWindow.ui 8677f5c8bca5bf7561d5f64bfdd0cef5157c6ac7 F ui/SettingsDialog.ui 2b7c2870e0054b0f4106f495d85d02c0b814df8b -P 2c664b7db2644e1434b5e2d9e83a103ca2093cb3 -R 2b9cf73416e24c6a53fa097140c7953a +P 654259ef3bb3e7e2cc43a85637a8320b501a6593 +R 877ff1e9d9c7da6aaf633c7829698f81 U kostas -Z 2c7925006fc58e53b77ddfe1866d7029 +Z 708ed1db241d1458ef9161843ffc20f5 diff --git a/manifest.uuid b/manifest.uuid index 0d2ab1e..243bb59 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -654259ef3bb3e7e2cc43a85637a8320b501a6593 \ No newline at end of file +3a653a3761f6f6e565762b8730bf5f7447ca2d2b \ No newline at end of file diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index e7946aa..5178433 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -209,12 +209,15 @@ MainWindow::~MainWindow() stopUI(); updateSettings(); - // Dispose RepoFiles - for(Workspace::filemap_t::iterator it = getWorkspace().getFiles().begin(); it!=getWorkspace().getFiles().end(); ++it) - delete *it; - delete ui; } + +//----------------------------------------------------------------------------- +Workspace::~Workspace() +{ + clearState(); +} + //----------------------------------------------------------------------------- const QString &MainWindow::getCurrentWorkspace() { @@ -583,6 +586,17 @@ bool MainWindow::refresh() return true; } +//------------------------------------------------------------------------------ +void Workspace::clearState() +{ + // Dispose RepoFiles + foreach(RepoFile *r, getFiles()) + delete r; + + getFiles().clear(); + getPaths().clear(); +} + //------------------------------------------------------------------------------ void Workspace::scanWorkspace(bool scanLocal, bool scanIgnored, bool scanModified, bool scanUnchanged, const QString &ignoreGlob, Bridge::UICallback &uiCallback, bool &operationAborted) { @@ -600,12 +614,7 @@ void Workspace::scanWorkspace(bool scanLocal, bool scanIgnored, bool scanModifie bool scan_files = scanLocal; - // Dispose RepoFiles - for(Workspace::filemap_t::iterator it = getFiles().begin(); it!=getFiles().end(); ++it) - delete *it; - - getFiles().clear(); - getPaths().clear(); + clearState(); operationAborted = false; diff --git a/src/MainWindow.h b/src/MainWindow.h index 1487f63..1975b20 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -108,9 +108,13 @@ typedef QSet stringset_t; class Workspace { public: + ~Workspace(); + typedef QList filelist_t; typedef QMap filemap_t; + void clearState(); + Bridge & fossil() { return bridge; } const Bridge & fossil() const { return bridge; }