@@ -28,6 +28,7 @@
29#include <paths.h>
29#include <paths.h>
30#include "../MouseTouchAdaptor.h"
30#include "../MouseTouchAdaptor.h"
31+#include "../ApplicationArguments.h"
31#include "../CachingNetworkManagerFactory.h"
32#include "../CachingNetworkManagerFactory.h"
33int main(int argc, const char *argv[])
34int main(int argc, const char *argv[])
@@ -42,7 +43,11 @@ int main(int argc, const char *argv[])
42 "Allow the mouse to provide touch input");
43 "Allow the mouse to provide touch input");
43 parser.addOption(mousetouchOption);
44 parser.addOption(mousetouchOption);
46+ QCommandLineOption windowGeometryOption(QStringList() << "windowgeometry",
47+ "Specify the window geometry as [<width>x<height>]", "windowgeometry", "1");
48+ parser.addOption(windowGeometryOption);
45− // FIXME Remove once we drop the need of the hint
50+ // FIXME Remove once we drop the need of the hint
46 QCommandLineOption desktopFileHintOption("desktop_file_hint",
51 QCommandLineOption desktopFileHintOption("desktop_file_hint",
47 "The desktop_file_hint option for QtMir", "hint_file");
52 "The desktop_file_hint option for QtMir", "hint_file");
48 parser.addOption(desktopFileHintOption);
53 parser.addOption(desktopFileHintOption);
@@ -52,6 +57,14 @@ int main(int argc, const char *argv[])
52 parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
57 parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
53 parser.process(*application);
58 parser.process(*application);
60+ ApplicationArguments qmlArgs;
61+ if (parser.isSet(windowGeometryOption) &&
62+ parser.value(windowGeometryOption).split('x').size() == 2)
64+ QStringList geom = parser.value(windowGeometryOption).split('x');
65+ qmlArgs.setSize(geom.at(0).toInt(), geom.at(1).toInt());
55 if (getenv("QT_LOAD_TESTABILITY")) {
68 if (getenv("QT_LOAD_TESTABILITY")) {
56 QLibrary testLib(QLatin1String("qttestability"));
69 QLibrary testLib(QLatin1String("qttestability"));
57 if (testLib.load()) {
70 if (testLib.load()) {
@@ -72,6 +85,7 @@ int main(int argc, const char *argv[])
72 QQuickView* view = new QQuickView();
85 QQuickView* view = new QQuickView();
73 view->setResizeMode(QQuickView::SizeRootObjectToView);
86 view->setResizeMode(QQuickView::SizeRootObjectToView);
74 view->setTitle("Unity Dash");
87 view->setTitle("Unity Dash");
88+ view->rootContext()->setContextProperty("applicationArguments", &qmlArgs);
76 // You will need this if you want to interact with touch-only components using a mouse
90 // You will need this if you want to interact with touch-only components using a mouse
77 // Needed only when manually testing on a desktop.
91 // Needed only when manually testing on a desktop.