From 3fbbc7d65372c4bda72bbb54c6d4356f34f8d494 Mon Sep 17 00:00:00 2001 From: Albert S Date: Sat, 10 Oct 2020 20:55:30 +0200 Subject: [PATCH] main: allow overriding config dir from commandline --- main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 62b728c..14fcf46 100644 --- a/main.cpp +++ b/main.cpp @@ -42,16 +42,17 @@ int main(int argc, char *argv[]) parser.addHelpOption(); parser.process(app.arguments()); configDirectoryPath = parser.value("config"); - if(!dir.exists(configDirectoryPath)) + if(!configDirectoryPath.isEmpty() && !dir.exists(configDirectoryPath)) { QMessageBox::warning(nullptr, "Directory not found", configDirectoryPath + " was not found"); return 1; } } - else + if(configDirectoryPath.isEmpty()) { configDirectoryPath = QDir::homePath() + "/.config/qsrun/"; } + qRegisterMetaType>("QVector"); if(!dir.exists(configDirectoryPath))