logic: enviroment variable handling

* expanding env vars for existsens check
* expand source paths in filemanager
This commit is contained in:
Andreas Stallinger
2016-04-14 13:39:48 +02:00
parent 9534ccb454
commit a2cba0b94f
9 changed files with 78 additions and 19 deletions
-1
View File
@@ -98,7 +98,6 @@ void QtStartScreen::updateButtons()
button->setProjectPath(recentProjects[i]);
button->setFixedWidth(button->fontMetrics().width(button->text()) + 45);
connect(button, SIGNAL(clicked()), button, SLOT(handleButtonClick()));
//button->setGeometry(292, button->pos().y(), button->fontMetrics().width(button->text()) + 45, 40);
if (button->projectExists())
{
button->setObjectName("recentButton");
@@ -6,6 +6,7 @@
#include "qt/element/QtDirectoryListBox.h"
#include "settings/ApplicationSettings.h"
#include "utility/file/FileManager.h"
#include "utility/file/FileSystem.h"
#include "utility/headerSearch/StandardHeaderDetection.h"
#include "utility/utility.h"
@@ -207,6 +208,25 @@ bool QtProjectWizzardContentPathsSource::check()
msgBox.exec();
return false;
}
QString missingPaths;
for(FilePath f : m_list->getList())
{
if(!f.exists())
{
if(!missingPaths.isEmpty())
{
missingPaths.append("\n");
}
missingPaths.append(f.expandEnvironmentVariables().str().c_str());
}
if(!missingPaths.isEmpty())
{
QMessageBox msgBox;
msgBox.setText("The following paths do not exist:\n" + missingPaths );
msgBox.exec();
return false;
}
}
return true;
}