qml: obey QT_NO_REGULAREXPRESSION define
authorPasi Petäjäjärvi <pasi.petajajarvi@digia.com>
Fri, 24 Oct 2014 08:44:30 +0000 (11:44 +0300)
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>
Tue, 11 Nov 2014 10:11:41 +0000 (11:11 +0100)
Not all platforms do have QRegularExpression as it is based on
pcre.

Change-Id: I3247f8b2213f78a6e537f6781d97b0c6382482ad
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
tools/qml/main.cpp

index 69ccd7a..e06f249 100644 (file)
@@ -494,6 +494,7 @@ int main(int argc, char *argv[])
 
     foreach (const QString &path, files) {
         //QUrl::fromUserInput doesn't treat no scheme as relative file paths
+#ifndef QT_NO_REGULAREXPRESSION
         QRegularExpression urlRe("[[:word:]]+://.*");
         if (urlRe.match(path).hasMatch()) { //Treat as a URL
             QUrl url = QUrl::fromUserInput(path);
@@ -503,7 +504,9 @@ int main(int argc, char *argv[])
                         ? QDir::toNativeSeparators(url.toLocalFile())
                         : url.toString()));
             e.load(url);
-        } else { //Local file path
+        } else
+#endif
+        { //Local file path
             if (verboseMode)
                 printf("qml: loading %s\n", qPrintable(QDir::toNativeSeparators(path)));