summaryrefslogtreecommitdiffstats
path: root/tools/qmlviewer/main.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-12-07 04:17:03 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-12-07 04:17:03 (GMT)
commit914c20ca52924685f731eaa1310c86555406b6f2 (patch)
tree2fe383d52a0538eede851d43ddb0b13a6d0a0093 /tools/qmlviewer/main.cpp
parentb703a04d272615bdd7f2dcc695421ca2140dc00b (diff)
downloadQt-914c20ca52924685f731eaa1310c86555406b6f2.zip
Qt-914c20ca52924685f731eaa1310c86555406b6f2.tar.gz
Qt-914c20ca52924685f731eaa1310c86555406b6f2.tar.bz2
Move loader functionality into qmlviewer.
Diffstat (limited to 'tools/qmlviewer/main.cpp')
-rw-r--r--tools/qmlviewer/main.cpp30
1 files changed, 14 insertions, 16 deletions
diff --git a/tools/qmlviewer/main.cpp b/tools/qmlviewer/main.cpp
index 34e5060..412d3ef 100644
--- a/tools/qmlviewer/main.cpp
+++ b/tools/qmlviewer/main.cpp
@@ -48,19 +48,11 @@
#include <QDebug>
#if defined (Q_OS_SYMBIAN)
-#define SYMBIAN_NETWORK_INIT
+#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <unistd.h>
-#endif
-#if defined (SYMBIAN_NETWORK_INIT)
-#include <QTextCodec>
-#include "sym_iap_util.h"
-#endif
-
-#if defined (Q_OS_SYMBIAN)
void myMessageOutput(QtMsgType type, const char *msg)
{
static int fd = -1;
@@ -149,7 +141,6 @@ int main(int argc, char ** argv)
QApplication::setGraphicsSystem("raster");
#endif
-
QApplication app(argc, argv);
app.setApplicationName("viewer");
app.setOrganizationName("Nokia");
@@ -176,6 +167,12 @@ int main(int argc, char ** argv)
bool fullScreen = false;
bool stayOnTop = false;
bool maximized = false;
+ bool useNativeFileBrowser = true;
+
+#if defined(Q_OS_SYMBIAN)
+ maximized = true;
+ useNativeFileBrowser = false;
+#endif
for (int i = 1; i < argc; ++i) {
bool lastArg = (i == argc - 1);
@@ -258,7 +255,7 @@ int main(int argc, char ** argv)
Qt::WFlags wflags = (frameless ? Qt::FramelessWindowHint : Qt::Widget);
if (stayOnTop)
wflags |= Qt::WindowStaysOnTopHint;
-
+
QmlViewer viewer(0, wflags);
if (!scriptopts.isEmpty()) {
QStringList options =
@@ -299,10 +296,6 @@ int main(int argc, char ** argv)
usage();
}
-#if defined(SYMBIAN_NETWORK_INIT)
- qt_SetDefaultIap();
-#endif
-
viewer.setUseGL(useGL);
foreach (QString lib, libraries)
viewer.addLibraryPath(lib);
@@ -328,14 +321,19 @@ int main(int argc, char ** argv)
viewer.setRecordDither(dither);
if (recordargs.count())
viewer.setRecordArgs(recordargs);
+
+ viewer.setUseNativeFileBrowser(useNativeFileBrowser);
if (fullScreen && maximized)
qWarning() << "Both -fullscreen and -maximized specified. Using -fullscreen.";
if (!fileName.isEmpty()) {
viewer.openQml(fileName);
fullScreen ? viewer.showFullScreen() : maximized ? viewer.showMaximized() : viewer.show();
} else {
+ if (!useNativeFileBrowser)
+ viewer.open();
fullScreen ? viewer.showFullScreen() : maximized ? viewer.showMaximized() : viewer.show();
- viewer.open();
+ if (useNativeFileBrowser)
+ viewer.open();
}
viewer.raise();