main: allow overriding config dir from commandline
This commit is contained in:
parent
241bec54ad
commit
8eb52fbfb3
5
main.cpp
5
main.cpp
@ -41,16 +41,17 @@ int main(int argc, char *argv[])
|
|||||||
parser.addHelpOption();
|
parser.addHelpOption();
|
||||||
parser.process(app.arguments());
|
parser.process(app.arguments());
|
||||||
configDirectoryPath = parser.value("config");
|
configDirectoryPath = parser.value("config");
|
||||||
if(!dir.exists(configDirectoryPath))
|
if(!configDirectoryPath.isEmpty() && !dir.exists(configDirectoryPath))
|
||||||
{
|
{
|
||||||
QMessageBox::warning(nullptr, "Directory not found", configDirectoryPath + " was not found");
|
QMessageBox::warning(nullptr, "Directory not found", configDirectoryPath + " was not found");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
if(configDirectoryPath.isEmpty())
|
||||||
{
|
{
|
||||||
configDirectoryPath = QDir::homePath() + "/.config/qsrun/";
|
configDirectoryPath = QDir::homePath() + "/.config/qsrun/";
|
||||||
}
|
}
|
||||||
|
|
||||||
qRegisterMetaType<QVector<QString>>("QVector<QString>");
|
qRegisterMetaType<QVector<QString>>("QVector<QString>");
|
||||||
|
|
||||||
if(!dir.exists(configDirectoryPath))
|
if(!dir.exists(configDirectoryPath))
|
||||||
|
Loading…
Reference in New Issue
Block a user