File 0253-qmake_correct_path_separators.diff of Package libqt4

qt-bugs@ issue : none
Trolltech task ID : 214661
applied: no
author: Christian Ehrlicher <ch.ehrlicher@gmx.de>

When using qmake outside qt src tree, it sometimes generates wrong
paths (wrong path separator)


Index: qmake/property.cpp
===================================================================
--- qmake/property.cpp.orig
+++ qmake/property.cpp
@@ -81,29 +81,32 @@ QMakeProperty::keyBase(bool version) con
 QString
 QMakeProperty::value(QString v, bool just_check)
 {
+    QString ret;
     if(v == "QT_INSTALL_PREFIX")
-        return QLibraryInfo::location(QLibraryInfo::PrefixPath);
+        ret = QLibraryInfo::location(QLibraryInfo::PrefixPath);
     else if(v == "QT_INSTALL_DATA")
-        return QLibraryInfo::location(QLibraryInfo::DataPath);
+        ret = QLibraryInfo::location(QLibraryInfo::DataPath);
     else if(v == "QT_INSTALL_DOCS")
-        return QLibraryInfo::location(QLibraryInfo::DocumentationPath);
+        ret = QLibraryInfo::location(QLibraryInfo::DocumentationPath);
     else if(v == "QT_INSTALL_HEADERS")
-        return QLibraryInfo::location(QLibraryInfo::HeadersPath);
+        ret = QLibraryInfo::location(QLibraryInfo::HeadersPath);
     else if(v == "QT_INSTALL_LIBS")
-        return QLibraryInfo::location(QLibraryInfo::LibrariesPath);
+        ret = QLibraryInfo::location(QLibraryInfo::LibrariesPath);
     else if(v == "QT_INSTALL_BINS")
-        return QLibraryInfo::location(QLibraryInfo::BinariesPath);
+        ret = QLibraryInfo::location(QLibraryInfo::BinariesPath);
     else if(v == "QT_INSTALL_PLUGINS")
-        return QLibraryInfo::location(QLibraryInfo::PluginsPath);
+        ret = QLibraryInfo::location(QLibraryInfo::PluginsPath);
     else if(v == "QT_INSTALL_TRANSLATIONS")
-        return QLibraryInfo::location(QLibraryInfo::TranslationsPath);
+        ret = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
     else if(v == "QT_INSTALL_CONFIGURATION")
-        return QLibraryInfo::location(QLibraryInfo::SettingsPath);
+        ret = QLibraryInfo::location(QLibraryInfo::SettingsPath);
     else if(v == "QT_INSTALL_EXAMPLES")
-        return QLibraryInfo::location(QLibraryInfo::ExamplesPath);
+        ret = QLibraryInfo::location(QLibraryInfo::ExamplesPath);
     else if(v == "QT_INSTALL_DEMOS")
-        return QLibraryInfo::location(QLibraryInfo::DemosPath);
-    else if(v == "QMAKE_MKSPECS")
+        ret = QLibraryInfo::location(QLibraryInfo::DemosPath);
+    if(!ret.isEmpty())
+        return QDir::toNativeSeparators(ret);
+    if(v == "QMAKE_MKSPECS")
         return qmake_mkspec_paths().join(Option::target_mode == Option::TARG_WIN_MODE ? ";" : ":");
     else if(v == "QMAKE_VERSION")
         return qmake_version();
@@ -116,7 +119,7 @@ QMakeProperty::value(QString v, bool jus
     int slash = v.lastIndexOf('/');
     QVariant var = settings->value(keyBase(slash == -1) + v);
     bool ok = var.isValid();
-    QString ret = var.toString();
+    ret = var.toString();
     if(!ok) {
         QString version = qmake_version();
         if(slash != -1) {
openSUSE Build Service is sponsored by