Commit 1fc6056f authored by Ulf Hermann's avatar Ulf Hermann
Browse files

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: default avatarOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Showing with 4 additions and 2 deletions
...@@ -162,7 +162,7 @@ QSettings *QLibraryInfoPrivate::findConfiguration() ...@@ -162,7 +162,7 @@ QSettings *QLibraryInfoPrivate::findConfiguration()
if(!QFile::exists(qtconfig)) if(!QFile::exists(qtconfig))
qtconfig = qmake_libraryInfoFile(); qtconfig = qmake_libraryInfoFile();
#else #else
if (!QFile::exists(qtconfig) && QCoreApplication::instance()) { if (!QFile::exists(qtconfig)) {
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
CFBundleRef bundleRef = CFBundleGetMainBundle(); CFBundleRef bundleRef = CFBundleGetMainBundle();
if (bundleRef) { if (bundleRef) {
...@@ -177,10 +177,12 @@ QSettings *QLibraryInfoPrivate::findConfiguration() ...@@ -177,10 +177,12 @@ QSettings *QLibraryInfoPrivate::findConfiguration()
} }
if (qtconfig.isEmpty()) if (qtconfig.isEmpty())
#endif #endif
{ {
if (QCoreApplication::instance()) {
QDir pwd(QCoreApplication::applicationDirPath()); QDir pwd(QCoreApplication::applicationDirPath());
qtconfig = pwd.filePath(QLatin1String("qt.conf")); qtconfig = pwd.filePath(QLatin1String("qt.conf"));
} }
}
} }
#endif #endif
if (QFile::exists(qtconfig)) if (QFile::exists(qtconfig))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment