GUI: Remember user-selected base path.
Remember the base path user selects when opening files from loaded XML report.
This commit is contained in:
parent
b8793b1529
commit
c9d63fa454
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -258,4 +258,5 @@ void ResultsView::ReadErrorsXml(const QString &filename)
|
|||
ErrorItem item(line);
|
||||
mUI.mTree->AddErrorItem(item);
|
||||
}
|
||||
mUI.mTree->SetCheckDirectory("");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue