LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File qtrc-path.diff of Package qt3 (Project openSUSE:Factory)

--- src/tools/qsettings.cpp
+++ src/tools/qsettings.cpp
@@ -36,6 +36,7 @@
 **********************************************************************/
 
 #include "qplatformdefs.h"
+#include <stdlib.h>
 
 // POSIX Large File Support redefines open -> open64
 static inline int qt_open( const char *pathname, int flags, mode_t mode )
@@ -465,8 +466,18 @@
     Q_UNUSED( format );
 #endif
 
-    QString appSettings(QDir::homeDirPath() + "/.qt/");
-    QString defPath;
+    QString home;
+    home = getenv("QT_HOME_DIR");
+    if ( !home.isEmpty() ){
+       home += "/";
+       QFileInfo i( home + "qtrc" );
+       if ( !i.isReadable() )
+         home = QDir::homeDirPath() + "/.qt/";
+    }else
+       home = QDir::homeDirPath() + "/.qt/";
+    QString appSettings(home);
+
+    QString defPath("/etc/X11/");
 #ifdef Q_WS_WIN
 #ifdef Q_OS_TEMP
 	TCHAR path[MAX_PATH];
@@ -514,6 +525,15 @@
 
     if ( !!defPath )
 	searchPaths.append(defPath);
+
+    QString system;
+    system = getenv("QT_SYSTEM_DIR");
+    if ( !system.isEmpty() && system[0] == '/') {
+       QFileInfo i( system + "/qtrc" );
+       if ( i.isReadable() )
+           searchPaths.append(system);
+    }
+
     searchPaths.append(dir.path());
 }