From 2ecb11985e322c31496fdcc4540d500e406520a2 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 18 May 2022 10:27:27 +0200 Subject: [PATCH] App: simplify code in Application::getResourceDir() and Application::getHelpDir() --- src/App/Application.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 03db14e7bb..3468e20a87 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -1129,11 +1129,10 @@ std::string Application::getResourceDir() #ifdef RESOURCEDIR std::string path(RESOURCEDIR); path.append("/"); - QDir dir(QString::fromUtf8(RESOURCEDIR)); + QDir dir(QString::fromStdString(path)); if (dir.isAbsolute()) return path; - else - return mConfig["AppHomePath"] + path; + return mConfig["AppHomePath"] + path; #else return mConfig["AppHomePath"]; #endif @@ -1157,11 +1156,10 @@ std::string Application::getHelpDir() #ifdef DOCDIR std::string path(DOCDIR); path.append("/"); - QDir dir(QString::fromUtf8(DOCDIR)); + QDir dir(QString::fromStdString(path)); if (dir.isAbsolute()) return path; - else - return mConfig["AppHomePath"] + path; + return mConfig["AppHomePath"] + path; #else return mConfig["DocPath"]; #endif