diff --git a/qtBuildSystem/Mu/mainwindow.cpp b/qtBuildSystem/Mu/mainwindow.cpp index b36f714..f52d6d0 100644 --- a/qtBuildSystem/Mu/mainwindow.cpp +++ b/qtBuildSystem/Mu/mainwindow.cpp @@ -53,22 +53,24 @@ MainWindow::MainWindow(QWidget* parent) : ui->ctrlBtn->setIcon(QIcon(":/buttons/images/play.png")); - //set resource directory if first launch - if(settings.value("resourceDirectory", "").toString() == ""){ - QString path; + QString resourceDirPath = settings.value("resourceDirectory", "").toString(); + //use default path if path not set + if(resourceDirPath == ""){ #if defined(Q_OS_ANDROID) - path = "/sdcard/Mu"; + resourceDirPath = "/sdcard/Mu"; #elif defined(Q_OS_IOS) - path = "/var/mobile/Media/Mu"; + resourceDirPath = "/var/mobile/Media/Mu"; #else - path = QDir::homePath() + "/Mu"; + resourceDirPath = QDir::homePath() + "/Mu"; #endif - - settings.setValue("resourceDirectory", path); - QDir(path).mkpath("."); + settings.setValue("resourceDirectory", resourceDirPath); } + //create path if it doesnt exist + if(!QDir(resourceDirPath).exists()) + QDir(resourceDirPath).mkpath("."); + #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) ui->debugger->hide();