Skip to content

Commit

Permalink
fixed path bug.. when search for user specified methods folder
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenemel committed Feb 28, 2019
1 parent 51328ff commit 1afa505
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/maven/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ MainWindow::MainWindow(QWidget *parent): QMainWindow(parent) {
<< QApplication::applicationDirPath() + "/../Resources/methods";

QString defaultModelFile = settings->value("clsfModelFilename").value<QString>();
defaultModelFile.replace(QRegExp(".*/"),""); //clear pathtname..
qDebug() << "Searching for method folder:";
foreach (QString d, dirs) {
qDebug() << "Checking dir: " + d;
qDebug() << " Checking dir: " + d;
QFile test(d+ "/" + defaultModelFile);
if (test.exists()) { methodsFolder=d; settings->setValue("methodsFolder", methodsFolder); break;}
}
Expand Down
7 changes: 5 additions & 2 deletions src/maven/settingsform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,11 @@ void SettingsForm::getFormValues() {
}

void SettingsForm::selectFolder(QString key) {
QString oFolder = ".";
if(settings->contains(key)) oFolder = settings->value(key).toString();
QString oFolder = QApplication::applicationDirPath() + "../";
if(settings->contains(key)) {
oFolder = settings->value(key).toString();
}

QString newFolder = QFileDialog::getExistingDirectory(this,oFolder);
if (! newFolder.isEmpty()) {
settings->setValue(key,newFolder);
Expand Down
2 changes: 1 addition & 1 deletion src/maven_core
Submodule maven_core updated 1 files
+4 −2 libmaven/Scan.cpp

0 comments on commit 1afa505

Please sign in to comment.