cosmetics: remove redundant conditional, add a comment & reshuffle code
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>
Thu, 23 Feb 2012 18:01:26 +0000 (19:01 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 1 Mar 2012 22:12:13 +0000 (23:12 +0100)
Change-Id: I71c7e18db63f3581b8c818ad178aeb4f6ccf9446
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
qmake/project.cpp

index 545adce..6793ed3 100644 (file)
@@ -530,9 +530,10 @@ static void qmake_error_msg(const QString &msg)
 */
 QStringList qmake_feature_paths(QMakeProperty *prop=0)
 {
+    const QString mkspecs_concat = QLatin1String("/mkspecs");
+    const QString base_concat = QLatin1String("/features");
     QStringList concat;
     {
-        const QString base_concat = QLatin1String("/features");
         switch(Option::target_mode) {
         case Option::TARG_MACX_MODE:                     //also a unix
             concat << base_concat + QLatin1String("/mac");
@@ -549,7 +550,7 @@ QStringList qmake_feature_paths(QMakeProperty *prop=0)
         }
         concat << base_concat;
     }
-    const QString mkspecs_concat = QLatin1String("/mkspecs");
+
     QStringList feature_roots;
     QByteArray mkspec_path = qgetenv("QMAKEFEATURES");
     if(!mkspec_path.isNull())
@@ -574,9 +575,10 @@ QStringList qmake_feature_paths(QMakeProperty *prop=0)
                     feature_roots << ((*it) + mkspecs_concat + (*concat_it));
         }
     }
-    if(!Option::mkfile::qmakespec.isEmpty())
-        feature_roots << Option::mkfile::qmakespec + QLatin1String("/features");
     if(!Option::mkfile::qmakespec.isEmpty()) {
+        // The spec is already platform-dependent, so no subdirs here.
+        feature_roots << Option::mkfile::qmakespec + base_concat;
+
         QFileInfo specfi(Option::mkfile::qmakespec);
         if (!specfi.isRoot()) {
             QDir specdir(specfi.absolutePath());