# # # patch "src/view/DatabaseWindow.cpp" # from [67a1901f933b8510844ca45b92c25955396f0091] # to [c176d576f38d08668e9f46f23963928547cf5642] # # patch "src/view/WorkspaceWindow.cpp" # from [aec9b6e8177d8931b6795c359bc4a4060fbce65f] # to [1e5be6c255d815256be609693b2e8434435bfdb9] # ============================================================ --- src/view/DatabaseWindow.cpp 67a1901f933b8510844ca45b92c25955396f0091 +++ src/view/DatabaseWindow.cpp c176d576f38d08668e9f46f23963928547cf5642 @@ -71,7 +71,15 @@ void DatabaseWindow::load(const QString void DatabaseWindow::load(const QString & path) { - APP->manager()->getThreadForDatabase(path); + try + { + APP->manager()->getThreadForDatabase(path); + } + catch (GuitoneException e) + { + Settings::removeItemFromList("RecentDatabaseList", path); + throw e; + } databaseFile = path; @@ -84,5 +92,7 @@ void DatabaseWindow::load(const QString setWindowTitle( tr("%1 - database mode - guitone").arg(fi.fileName()) ); + + Settings::addItemToList("RecentDatabaseList", path, 5); } ============================================================ --- src/view/WorkspaceWindow.cpp aec9b6e8177d8931b6795c359bc4a4060fbce65f +++ src/view/WorkspaceWindow.cpp 1e5be6c255d815256be609693b2e8434435bfdb9 @@ -195,8 +195,17 @@ void WorkspaceWindow::load(const QString void WorkspaceWindow::load(const QString & path) { - workspacePath = MonotoneManager::normalizeWorkspacePath(path); - APP->manager()->getThreadForWorkspace(workspacePath); + try + { + workspacePath = MonotoneManager::normalizeWorkspacePath(path); + APP->manager()->getThreadForWorkspace(workspacePath); + } + catch (GuitoneException e) + { + // remove the workspace if it was recorded as recent workspace + Settings::removeItemFromList("RecentWorkspaceList", workspacePath); + throw e; + } // read the inventory invModel->readInventory(); @@ -208,6 +217,8 @@ void WorkspaceWindow::load(const QString tr("%1 - workspace mode - guitone"). arg(MonotoneUtil::getBranchNameShort(workspacePath)) ); + + Settings::addItemToList("RecentWorkspaceList", workspacePath, 5); } void WorkspaceWindow::openFile(const QString & filePath)