aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qml/main.cpp
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@kdab.com>2015-03-05 11:46:46 +0100
committerKevin Ottens <kevin.ottens@kdab.com>2015-03-16 18:22:39 +0000
commit4dc68ba888c7dbb7bd16455991f6d5814df13cba (patch)
tree3fcf7dd47b9e936361d35ad62c79f45fde3ae71b /tools/qml/main.cpp
parent74d33a3958678f55ed1615e7685b328d2ba17ae1 (diff)
Don't limit to files ending with .qml
Especially useful when the program is invoked indirectly by a shell running the QML file like an executable. Such script executable often don't have an extension to make their invocation look like that of binary executables. [ChangeLog][QtQml] Make it possible to make script without .qml suffix Change-Id: I5a569bdea185cfa60ce68afa27ae03278b1acdb8 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'tools/qml/main.cpp')
-rw-r--r--tools/qml/main.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index c899780bdd..02728dfb09 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -64,8 +64,8 @@
#include <cstdlib>
#define VERSION_MAJ 1
-#define VERSION_MIN 0
-#define VERSION_STR "1.0"
+#define VERSION_MIN 1
+#define VERSION_STR "1.1"
#define FILE_OPEN_EVENT_WAIT_TIME 3000 // ms
@@ -251,11 +251,10 @@ void printVersion()
void printUsage()
{
- printf("Usage: qml [options] [files]\n");
+ printf("Usage: qml [options] [files] [-- args]\n");
printf("\n");
- printf("Any argument ending in .qml will be treated as a QML file to be loaded.\n");
+ printf("Any unknown argument before '--' will be treated as a QML file to be loaded.\n");
printf("Any number of QML files can be loaded. They will share the same engine.\n");
- printf("Any argument which is not a recognized option and which does not end in .qml will be ignored.\n");
printf("'gui' application type is only available if the QtGui module is available.\n");
printf("'widget' application type is only available if the QtWidgets module is available.\n");
printf("\n");
@@ -440,9 +439,7 @@ int main(int argc, char *argv[])
dummyDir = argList[i+1];
i++;
} else {
- //If it ends in .qml, treat it as a file. Else ignore it
- if (arg.endsWith(".qml"))
- files << arg;
+ files << arg;
}
}