summaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtbase-5.0.2/0002-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch
blob: 5bcc22e7023c17d6532bcdcd66389f1f7e9e8075 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From 41257668e0cb03056d79b2917d54a6e01bf2ed36 Mon Sep 17 00:00:00 2001
From: Holger Freyther <zecke@selfish.org>
Date: Wed, 26 Sep 2012 17:22:30 +0200
Subject: [PATCH 2/6] qlibraryinfo: allow to set qt.conf from the outside using
 the environment

Allow to set a qt.conf from the outside using the environment. This allows
to inject new prefixes and other paths into qmake. This is needed when using
the same qmake binary to build qt/x11 and qt/embedded

Upstream-Status: Pending

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 src/corelib/global/qlibraryinfo.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 5fb9640..acd11f5 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -138,7 +138,10 @@ QLibrarySettings::QLibrarySettings()
 
 QSettings *QLibraryInfoPrivate::findConfiguration()
 {
-    QString qtconfig = QStringLiteral(":/qt/etc/qt.conf");
+    QByteArray config = getenv("QT_CONF_PATH");
+    QString qtconfig = QFile::decodeName(config);
+    if(!QFile::exists(qtconfig))
+        qtconfig = QStringLiteral(":/qt/etc/qt.conf");
 #ifdef QT_BOOTSTRAPPED
     if(!QFile::exists(qtconfig))
         qtconfig = qt_libraryInfoFile();
@@ -165,7 +168,9 @@ QSettings *QLibraryInfoPrivate::findConfiguration()
     }
 #endif
     if (QFile::exists(qtconfig))
+        printf("Using qt.conf from: %s\n", qtconfig.toLatin1().data());
         return new QSettings(qtconfig, QSettings::IniFormat);
+    printf("qt.conf wasn't found!!\n");
     return 0;     //no luck
 }
 
-- 
1.8.2.1