From 1e379cf086d741124a35178f1c3beeede99132b6 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Wed, 13 Dec 2023 13:38:34 +0100 Subject: [PATCH] Fix: set directory of application for directory of the ini-file. --- commandline_parser.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/commandline_parser.cpp b/commandline_parser.cpp index e60f71f..7fbeae8 100644 --- a/commandline_parser.cpp +++ b/commandline_parser.cpp @@ -87,7 +87,7 @@ void CommandLineParser::configure() { m_repositoryUrlOption.setDefaultValue("https://git.mimbach49.de/GerhardHoffmann"); m_parser.addOption(m_repositoryUrlOption); - m_iniFileDirectoryOption.setDefaultValue("."); + m_iniFileDirectoryOption.setDefaultValue(QCoreApplication::applicationDirPath()); m_parser.addOption(m_iniFileDirectoryOption); m_iniFileNameOption.setDefaultValue("ATBUpdateTool.ini"); @@ -117,10 +117,10 @@ void CommandLineParser::configure() { m_extendedVersionOption.setDefaultValue("false"); m_parser.addOption(m_extendedVersionOption); - m_yoctoVersionOption .setDefaultValue("false"); + m_yoctoVersionOption.setDefaultValue("false"); m_parser.addOption(m_yoctoVersionOption); - m_yoctoInstallStatusOption .setDefaultValue("false"); + m_yoctoInstallStatusOption.setDefaultValue("false"); m_parser.addOption(m_yoctoInstallStatusOption); } @@ -128,7 +128,6 @@ void CommandLineParser::readSettings() { QString const iniFileDir = m_parser.value(m_iniFileDirectoryOption); QString const iniFileName = m_parser.value(m_iniFileNameOption); m_iniFileName = QDir::cleanPath(iniFileDir + QDir::separator() + iniFileName); - if (!m_iniFileName.isEmpty()) { if (QFile(m_iniFileName).exists()) { QSettings settings(m_iniFileName, QSettings::IniFormat);