From: APTX Date: Fri, 6 Jan 2012 19:07:38 +0000 (+0100) Subject: Creator updates X-Git-Url: https://gitweb.tyo.aptx.org/?a=commitdiff_plain;h=54359333ac83c3a36016004faa9fe25a89a7b3ed;p=AniAdd.git Creator updates --- diff --git a/qmlapplicationviewer/qmlapplicationviewer.cpp b/qmlapplicationviewer/qmlapplicationviewer.cpp index f81fb4d..997bbfc 100644 --- a/qmlapplicationviewer/qmlapplicationviewer.cpp +++ b/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -1,4 +1,4 @@ -// checksum 0x5e4a version 0x5000d +// checksum 0xee24 version 0x70013 /* This file was generated by the Qt Quick Application wizard of Qt Creator. QmlApplicationViewer is a convenience class containing mobile device specific @@ -10,13 +10,19 @@ #include "qmlapplicationviewer.h" -#include #include #include +#include #include #include #include +#include // MEEGO_EDITION_HARMATTAN + +#ifdef HARMATTAN_BOOSTER +#include +#endif + #if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800 #include @@ -54,24 +60,21 @@ QString QmlApplicationViewerPrivate::adjustPath(const QString &path) #ifdef Q_OS_UNIX #ifdef Q_OS_MAC if (!QDir::isAbsolutePath(path)) - return QCoreApplication::applicationDirPath() - + QLatin1String("/../Resources/") + path; + return QString::fromLatin1("%1/../Resources/%2") + .arg(QCoreApplication::applicationDirPath(), path); #else - const QString pathInInstallDir = QCoreApplication::applicationDirPath() - + QLatin1String("/../") + path; - if (pathInInstallDir.contains(QLatin1String("opt")) - && pathInInstallDir.contains(QLatin1String("bin")) - && QFileInfo(pathInInstallDir).exists()) { + const QString pathInInstallDir = + QString::fromLatin1("%1/../%2").arg(QCoreApplication::applicationDirPath(), path); + if (QFileInfo(pathInInstallDir).exists()) return pathInInstallDir; - } #endif #endif return path; } -QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) : - QDeclarativeView(parent), - m_d(new QmlApplicationViewerPrivate) +QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) + : QDeclarativeView(parent) + , d(new QmlApplicationViewerPrivate()) { connect(engine(), SIGNAL(quit()), SLOT(close())); setResizeMode(QDeclarativeView::SizeRootObjectToView); @@ -88,13 +91,18 @@ QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) : QmlApplicationViewer::~QmlApplicationViewer() { - delete m_d; + delete d; +} + +QmlApplicationViewer *QmlApplicationViewer::create() +{ + return new QmlApplicationViewer(); } void QmlApplicationViewer::setMainQmlFile(const QString &file) { - m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file); - setSource(QUrl::fromLocalFile(m_d->mainQmlFile)); + d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file); + setSource(QUrl::fromLocalFile(d->mainQmlFile)); } void QmlApplicationViewer::addImportPath(const QString &path) @@ -147,7 +155,7 @@ void QmlApplicationViewer::setOrientation(ScreenOrientation orientation) void QmlApplicationViewer::showExpanded() { -#if defined(Q_OS_SYMBIAN) || defined(MEEGO_EDITION_HARMATTAN) +#if defined(Q_OS_SYMBIAN) || defined(MEEGO_EDITION_HARMATTAN) || defined(Q_WS_SIMULATOR) showFullScreen(); #elif defined(Q_WS_MAEMO_5) showMaximized(); @@ -155,3 +163,12 @@ void QmlApplicationViewer::showExpanded() show(); #endif } + +QApplication *createApplication(int &argc, char **argv) +{ +#ifdef HARMATTAN_BOOSTER + return MDeclarativeCache::qApplication(argc, argv); +#else + return new QApplication(argc, argv); +#endif +} diff --git a/qmlapplicationviewer/qmlapplicationviewer.h b/qmlapplicationviewer/qmlapplicationviewer.h index 3fe17ab..b01cc88 100644 --- a/qmlapplicationviewer/qmlapplicationviewer.h +++ b/qmlapplicationviewer/qmlapplicationviewer.h @@ -1,4 +1,4 @@ -// checksum 0x382f version 0x5000d +// checksum 0x898f version 0x70013 /* This file was generated by the Qt Quick Application wizard of Qt Creator. QmlApplicationViewer is a convenience class containing mobile device specific @@ -27,6 +27,8 @@ public: explicit QmlApplicationViewer(QWidget *parent = 0); virtual ~QmlApplicationViewer(); + static QmlApplicationViewer *create(); + void setMainQmlFile(const QString &file); void addImportPath(const QString &path); @@ -36,7 +38,9 @@ public: void showExpanded(); private: - class QmlApplicationViewerPrivate *m_d; + class QmlApplicationViewerPrivate *d; }; +QApplication *createApplication(int &argc, char **argv); + #endif // QMLAPPLICATIONVIEWER_H diff --git a/qmlapplicationviewer/qmlapplicationviewer.pri b/qmlapplicationviewer/qmlapplicationviewer.pri index 343adfe..b6931d0 100644 --- a/qmlapplicationviewer/qmlapplicationviewer.pri +++ b/qmlapplicationviewer/qmlapplicationviewer.pri @@ -1,4 +1,4 @@ -# checksum 0x83a9 version 0x5000d +# checksum 0x5b42 version 0x70013 # This file was generated by the Qt Quick Application wizard of Qt Creator. # The code below adds the QmlApplicationViewer to the project and handles the # activation of QML debugging. @@ -6,7 +6,6 @@ # may offer an updated version of it. QT += declarative -CONFIG(debug, debug|release):CONFIG += declarative_debug SOURCES += $$PWD/qmlapplicationviewer.cpp HEADERS += $$PWD/qmlapplicationviewer.h @@ -18,6 +17,10 @@ INCLUDEPATH += $$PWD } else { DEFINES -= QMLJSDEBUGGER } + +contains(CONFIG,qdeclarative-boostable):contains(MEEGO_EDITION,harmattan) { + DEFINES += HARMATTAN_BOOSTER +} # This file was generated by an application wizard of Qt Creator. # The code below handles deployment to Symbian and Maemo, aswell as copying # of the application data to shadow build directories on desktop. @@ -49,6 +52,7 @@ symbian { sourcePathSegments = $$split(source, \\) target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments) target = $$replace(target, /, \\) + target ~= s,\\\\\\.?\\\\,\\, !isEqual(source,$$target) { !isEmpty(copyCommand):copyCommand += && isEqual(QMAKE_DIR_SEP, \\) { @@ -75,11 +79,12 @@ symbian { desktopfile.path = /usr/share/applications/hildon icon.files = $${TARGET}64.png icon.path = /usr/share/icons/hicolor/64x64/apps - } else { + } else:!isEmpty(MEEGO_VERSION_MAJOR) { desktopfile.files = $${TARGET}_harmattan.desktop desktopfile.path = /usr/share/applications icon.files = $${TARGET}80.png icon.path = /usr/share/icons/hicolor/80x80/apps + } else { # Assumed to be a Desktop Unix copyCommand = for(deploymentfolder, DEPLOYMENTFOLDERS) { source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) @@ -92,6 +97,7 @@ symbian { target = $$replace(target, \\\\, /) sourcePathSegments = $$split(source, /) targetFullPath = $$target/$$last(sourcePathSegments) + targetFullPath ~= s,/\\.?/,/, !isEqual(source,$$targetFullPath) { !isEmpty(copyCommand):copyCommand += && copyCommand += $(MKDIR) \"$$target\" @@ -118,13 +124,18 @@ symbian { export($$itempath) INSTALLS += $$item } + + !isEmpty(desktopfile.path) { + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + INSTALLS += icon desktopfile + } + target.path = $${installPrefix}/bin - export(icon.files) - export(icon.path) - export(desktopfile.files) - export(desktopfile.path) export(target.path) - INSTALLS += desktopfile icon target + INSTALLS += target } export (ICON)