From c9d63fa454e6954a0ca1215b1e9b9441c2a01817 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Sun, 11 Jul 2010 16:20:19 +0300 Subject: [PATCH] GUI: Remember user-selected base path. Remember the base path user selects when opening files from loaded XML report. --- gui/resultstree.cpp | 16 ++++++++++++---- gui/resultsview.cpp | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index 5a230b5a8..bd24bb1cd 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -33,7 +33,6 @@ ResultsTree::ResultsTree(QWidget * parent) : QTreeView(parent), mContextItem(0), - mCheckPath(""), mVisibleErrors(false) { for (int i = 0; i < SHOW_NONE; i++) @@ -483,9 +482,17 @@ void ResultsTree::StartApplication(QStandardItem *target, int application) } else { - QString dir = AskFileDir(file); - dir += '/'; - file = dir + file; + QDir checkdir(mCheckPath); + if (checkdir.isAbsolute() && checkdir.exists()) + { + file = mCheckPath + "/" + file; + } + else + { + QString dir = AskFileDir(file); + dir += '/'; + file = dir + file; + } } } @@ -531,6 +538,7 @@ QString ResultsTree::AskFileDir(const QString &file) QString dir = QFileDialog::getExistingDirectory(this, tr("Select Directory"), "", QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + mCheckPath = dir; return dir; } diff --git a/gui/resultsview.cpp b/gui/resultsview.cpp index e6f7a7945..2e941979a 100644 --- a/gui/resultsview.cpp +++ b/gui/resultsview.cpp @@ -258,4 +258,5 @@ void ResultsView::ReadErrorsXml(const QString &filename) ErrorItem item(line); mUI.mTree->AddErrorItem(item); } + mUI.mTree->SetCheckDirectory(""); }