diff options
author | Bea Lam <bea.lam@nokia.com> | 2009-10-05 05:55:16 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2009-10-05 05:55:16 (GMT) |
commit | 9c80d8284449e8cfc421aa047598020dc4c58772 (patch) | |
tree | 4a609d4f82bfbe033bd437384123f993fce7d8bf /demos/mediaplayer/main.cpp | |
parent | a3349d20dca10d32fc8ab95591108f1ec49dc034 (diff) | |
parent | ef9f35f4b3f29a0013f04d6245c7eefd92d5a560 (diff) | |
download | Qt-9c80d8284449e8cfc421aa047598020dc4c58772.zip Qt-9c80d8284449e8cfc421aa047598020dc4c58772.tar.gz Qt-9c80d8284449e8cfc421aa047598020dc4c58772.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'demos/mediaplayer/main.cpp')
-rw-r--r-- | demos/mediaplayer/main.cpp | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/demos/mediaplayer/main.cpp b/demos/mediaplayer/main.cpp index fd1431d..66aa445 100644 --- a/demos/mediaplayer/main.cpp +++ b/demos/mediaplayer/main.cpp @@ -50,9 +50,39 @@ int main (int argc, char *argv[]) app.setOrganizationName("Qt"); app.setQuitOnLastWindowClosed(true); - QString fileString = app.arguments().value(1); - MediaPlayer player(fileString); - player.show(); + bool hasSmallScreen = +#ifdef Q_OS_SYMBIAN + /* On Symbian, we always want fullscreen. One reason is that it's not + * possible to launch any demos from the fluidlauncher due to a + * limitation in the emulator. */ + true +#else + false +#endif + ; + + QString fileString; + const QStringList args(app.arguments()); + /* We have a minor problem here, we accept two arguments, both are + * optional: + * - A file name + * - the option "-small-screen", so let's try to cope with that. + */ + for (int i = 0; i < args.count(); ++i) { + const QString &at = args.at(i); + + if (at == QLatin1String("-small-screen")) + hasSmallScreen = true; + else if (i > 0) // We don't want the app name. + fileString = at; + } + + MediaPlayer player(fileString, hasSmallScreen); + + if (hasSmallScreen) + player.showMaximized(); + else + player.show(); return app.exec(); } |