diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 4a774d9f92f..94f3e60deba 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -269,8 +269,6 @@ QVersionNumber QLibraryInfo::version() noexcept static QString prefixFromAppDirHelper() { - QString appDir; - if (QCoreApplication::instance()) { #ifdef Q_OS_DARWIN CFBundleRef bundleRef = CFBundleGetMainBundle(); @@ -289,12 +287,10 @@ static QString prefixFromAppDirHelper() } #endif // Q_OS_DARWIN // We make the prefix path absolute to the executable's directory. - appDir = QCoreApplication::applicationDirPath(); + return QCoreApplication::applicationDirPath(); } else { - appDir = QDir::currentPath(); + return QDir::currentPath(); } - - return appDir; } #if QT_CONFIG(relocatable)