From 1fc6056ff5526e61419262931de79137bf7c1b4d Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 9 Mar 2015 17:42:19 +0100 Subject: Detect qt.conf in bundle on OSX without QCoreApplication On OSX we don't need the applicationDirPath to find a qt.conf located in the application bundle. Let's take advantage of this and allow findConfiguration to use it. Task-number: QTBUG-24541 Change-Id: I38c349a3bcd140fcf91352c88c24ca662e6e6f2e Reviewed-by: Oswald Buddenhagen --- src/corelib/global/qlibraryinfo.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 24afe719c1..484c7869a6 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -162,7 +162,7 @@ QSettings *QLibraryInfoPrivate::findConfiguration() if(!QFile::exists(qtconfig)) qtconfig = qmake_libraryInfoFile(); #else - if (!QFile::exists(qtconfig) && QCoreApplication::instance()) { + if (!QFile::exists(qtconfig)) { #ifdef Q_OS_MAC CFBundleRef bundleRef = CFBundleGetMainBundle(); if (bundleRef) { @@ -177,10 +177,12 @@ QSettings *QLibraryInfoPrivate::findConfiguration() } if (qtconfig.isEmpty()) #endif - { + { + if (QCoreApplication::instance()) { QDir pwd(QCoreApplication::applicationDirPath()); qtconfig = pwd.filePath(QLatin1String("qt.conf")); } + } } #endif if (QFile::exists(qtconfig)) -- cgit v1.2.3