show error message if passed directories don't exist, don't create it
This commit is contained in:
parent
028b4299f7
commit
7ac429b9e2
7
main.cpp
7
main.cpp
@ -30,9 +30,15 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
QString configDirectoryPath;
|
QString configDirectoryPath;
|
||||||
|
QDir dir;
|
||||||
if(argc >= 2)
|
if(argc >= 2)
|
||||||
{
|
{
|
||||||
configDirectoryPath = QCoreApplication::arguments().at(1);
|
configDirectoryPath = QCoreApplication::arguments().at(1);
|
||||||
|
if(!dir.exists(configDirectoryPath))
|
||||||
|
{
|
||||||
|
QMessageBox::warning(nullptr, "Directory not found", configDirectoryPath + " was not found");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -41,7 +47,6 @@ int main(int argc, char *argv[])
|
|||||||
qRegisterMetaType<QVector<QString> >("QVector<QString>");
|
qRegisterMetaType<QVector<QString> >("QVector<QString>");
|
||||||
|
|
||||||
|
|
||||||
QDir dir;
|
|
||||||
if(!dir.exists(configDirectoryPath))
|
if(!dir.exists(configDirectoryPath))
|
||||||
{
|
{
|
||||||
if(!dir.mkdir(configDirectoryPath))
|
if(!dir.mkdir(configDirectoryPath))
|
||||||
|
Loading…
Reference in New Issue
Block a user