# # # patch "src/Guitone.cpp" # from [c1c3f924cbc03e7a09d33f48c1ed9c46a561d6a4] # to [f6b8d59f79236024482c49422ba3f04016c3644f] # # patch "src/monotone/MonotoneManager.cpp" # from [d0a027af9e6137b3be7483b63db71e94b0af8b0d] # to [cb2c38e6c54d4a1c7cdb5936ee6fd7b4d929e4d6] # # patch "src/view/DatabaseWindow.cpp" # from [5590fbf75ade2b0147874c56dcd054e92293094c] # to [301858460154bc94a7d4b433f40f2654716299bd] # # patch "src/view/WorkspaceWindow.cpp" # from [9c1463243070703596e252dabe849f8d116cc3d7] # to [4b3678bc9cb8d7d45dafea07d71e174aef4e0023] # ============================================================ --- src/Guitone.cpp c1c3f924cbc03e7a09d33f48c1ed9c46a561d6a4 +++ src/Guitone.cpp f6b8d59f79236024482c49422ba3f04016c3644f @@ -223,44 +223,48 @@ void Guitone::loadFromPath(const QString { QMutexLocker locker(&lock); - QFileInfo fileInfo(path); - if (!fileInfo.exists()) + try { - throw new GuitoneException(tr("Non-existant path '%1'")); - } + QFileInfo fileInfo(path); + if (!fileInfo.exists()) + throw GuitoneException(tr("Non-existant path '%1'").arg(path)); - MainWindow * wnd; - if (fileInfo.isDir()) - { - wnd = new WorkspaceWindow(); - } - else if (fileInfo.isFile()) - { - wnd = new DatabaseWindow(); - } - else - { - throw new GuitoneException(tr("Path is neither a file nor a directory")); - } + MainWindow * wnd; - wnd->init(); + if (fileInfo.isDir()) + wnd = new WorkspaceWindow(); + else if (fileInfo.isFile()) + wnd = new DatabaseWindow(); + else + throw GuitoneException(tr("Path is neither a file nor a directory")); - try - { - wnd->load(path); + wnd->init(); + + try + { + wnd->load(path); + } + catch (GuitoneException e) + { + delete wnd; + throw e; + } + + openWindows.append(wnd); + ensureCascadedWindowPlacement(wnd); + wnd->show(); + + triggerUpdateWindowList(); + emit updateRecentLists(); } + catch (GuitoneException e) { - delete wnd; + Settings::removeItemFromList("RecentWorkspaceList", path); + Settings::removeItemFromList("RecentDatabaseList", path); + emit updateRecentLists(); throw e; } - - openWindows.append(wnd); - ensureCascadedWindowPlacement(wnd); - wnd->show(); - - triggerUpdateWindowList(); - emit updateRecentLists(); } void Guitone::loadWorkspace(const QString & path) ============================================================ --- src/monotone/MonotoneManager.cpp d0a027af9e6137b3be7483b63db71e94b0af8b0d +++ src/monotone/MonotoneManager.cpp cb2c38e6c54d4a1c7cdb5936ee6fd7b4d929e4d6 @@ -148,7 +148,7 @@ WorkspacePath MonotoneManager::normalize QDir tempDir(workspace); if (!tempDir.exists()) { - throw GuitoneException(tr("workspace directory does not exist")); + throw GuitoneException(tr("Directory %1 does not exist").arg(workspace)); } bool found = false; ============================================================ --- src/view/DatabaseWindow.cpp 5590fbf75ade2b0147874c56dcd054e92293094c +++ src/view/DatabaseWindow.cpp 301858460154bc94a7d4b433f40f2654716299bd @@ -88,15 +88,7 @@ void DatabaseWindow::load(const QString void DatabaseWindow::load(const QString & path) { - try - { - APP->manager()->getThreadForDatabase(path); - } - catch (GuitoneException e) - { - Settings::removeItemFromList("RecentDatabaseList", path); - throw e; - } + APP->manager()->getThreadForDatabase(path); databaseFile = path; ============================================================ --- src/view/WorkspaceWindow.cpp 9c1463243070703596e252dabe849f8d116cc3d7 +++ src/view/WorkspaceWindow.cpp 4b3678bc9cb8d7d45dafea07d71e174aef4e0023 @@ -239,17 +239,8 @@ void WorkspaceWindow::load(const QString void WorkspaceWindow::load(const QString & path) { - 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; - } + workspacePath = MonotoneManager::normalizeWorkspacePath(path); + APP->manager()->getThreadForWorkspace(workspacePath); invModel->setWorkspacePath(workspacePath); attrModel->setWorkspacePath(workspacePath);