forget keyfile path, fix #1151

This commit is contained in:
thez3ro
2017-11-16 16:04:30 +01:00
parent b0e6bcfaa0
commit cd1e0571a5
4 changed files with 19 additions and 5 deletions

View File

@@ -42,11 +42,11 @@ QString FileDialog::getOpenFileName(QWidget* parent, const QString& caption, QSt
if (parent) {
parent->activateWindow();
}
if (!result.isEmpty()) {
if (!result.isEmpty() && m_nextSaveLastDir) {
config()->set("LastDir", QFileInfo(result).absolutePath());
}
m_nextSaveLastDir = true;
return result;
}
}
@@ -73,10 +73,11 @@ QStringList FileDialog::getOpenFileNames(QWidget *parent, const QString &caption
parent->activateWindow();
}
if (!results.isEmpty()) {
if (!results.isEmpty() && m_nextSaveLastDir) {
config()->set("LastDir", QFileInfo(results[0]).absolutePath());
}
m_nextSaveLastDir = true;
return results;
}
}
@@ -125,10 +126,11 @@ QString FileDialog::getSaveFileName(QWidget* parent, const QString& caption, QSt
parent->activateWindow();
}
if (!result.isEmpty()) {
if (!result.isEmpty() && m_nextSaveLastDir) {
config()->set("LastDir", QFileInfo(result).absolutePath());
}
m_nextSaveLastDir = true;
return result;
}
}
@@ -153,10 +155,11 @@ QString FileDialog::getExistingDirectory(QWidget *parent, const QString &caption
parent->activateWindow();
}
if (!dir.isEmpty()) {
if (!dir.isEmpty() && m_nextSaveLastDir) {
config()->set("LastDir", QFileInfo(dir).absolutePath());
}
m_nextSaveLastDir = true;
return dir;
}
}
@@ -176,6 +179,11 @@ void FileDialog::setNextDirName(const QString &dirName)
m_nextDirName = dirName;
}
void FileDialog::setNextForgetDialog()
{
m_nextSaveLastDir = false;
}
FileDialog::FileDialog()
{
}