Remove Q_WS_*, symbian and maemo code in QtDeclarative
[profile/ivi/qtdeclarative.git] / tools / qmlviewer / main.cpp
index 24a4940..91362bb 100644 (file)
@@ -7,29 +7,29 @@
 ** This file is part of the tools applications of the Qt Toolkit.
 **
 ** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
 ** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 **
 ** In addition, as a special exception, Nokia gives you certain additional
-** rights.  These rights are described in the Nokia Qt LGPL Exception
+** rights. These rights are described in the Nokia Qt LGPL Exception
 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
 **
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
 **
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
 **
 **
 **
@@ -52,7 +52,6 @@
 #include <QAtomicInt>
 #include <QLibraryInfo>
 #include "qdeclarativetester.h"
-#include <private/qdeclarativedebughelper_p.h>
 
 QT_USE_NAMESPACE
 
@@ -77,13 +76,6 @@ void exitApp(int i)
 QWeakPointer<LoggerWidget> logger;
 static QAtomicInt recursiveLock(0);
 
-#if defined (Q_OS_SYMBIAN)
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#endif
-
 void myMessageOutput(QtMsgType type, const char *msg)
 {
     QString strMsg = QString::fromLatin1(msg);
@@ -99,19 +91,6 @@ void myMessageOutput(QtMsgType type, const char *msg)
             warnings += QLatin1Char('\n');
         }
     }
-#if defined (Q_OS_SYMBIAN)
-    static int fd = -1;
-    if (fd == -1)
-        fd = ::open("E:\\qml.log", O_WRONLY | O_CREAT);
-
-    ::write(fd, msg, strlen(msg));
-    ::write(fd, "\n", 1);
-    ::fsync(fd);
-    switch (type) {
-    case QtFatalMsg:
-        abort();
-    }
-#endif
 
     if (systemMsgOutput) {
         systemMsgOutput(type, msg);
@@ -155,7 +134,7 @@ void usage()
     qWarning("  -I <directory> ........................... prepend to the module import search path,");
     qWarning("                                             display path if <directory> is empty");
     qWarning("  -P <directory> ........................... prepend to the plugin search path");
-#if defined(Q_WS_MAC)
+#if defined(Q_OS_MAC)
     qWarning("  -no-opengl ............................... don't use a QGLWidget for the viewport");
     qWarning("  -opengl .................................. use a QGLWidget for the viewport (default)");
 #else
@@ -213,12 +192,8 @@ struct ViewerOptions
           warningsConfig(DefaultWarnings),
           sizeToView(true)
     {
-#if defined(Q_OS_SYMBIAN)
-        maximized = true;
-        useNativeFileBrowser = false;
-#endif
 
-#if defined(Q_WS_MAC)
+#if defined(Q_OS_MAC)
         useGL = true;
 #endif
     }
@@ -523,24 +498,6 @@ QDeclarativeViewer *openFile(const QString &fileName)
 int main(int argc, char ** argv)
 {
     systemMsgOutput = qInstallMsgHandler(myMessageOutput);
-
-#if defined (Q_WS_X11) || defined (Q_WS_MAC)
-    //### default to using raster graphics backend for now
-    bool gsSpecified = false;
-    for (int i = 0; i < argc; ++i) {
-        QString arg = QString::fromAscii(argv[i]);
-        if (arg == QLatin1String("-graphicssystem")) {
-            gsSpecified = true;
-            break;
-        }
-    }
-
-    if (!gsSpecified)
-        QApplication::setGraphicsSystem(QLatin1String("raster"));
-#endif
-
-    QDeclarativeDebugHelper::enableDebugging();
-
     Application app(argc, argv);
     app.setApplicationName(QLatin1String("QtQmlViewer"));
     app.setOrganizationName(QLatin1String("Nokia"));