From ed986f73d31a8e7a8e22e5834f883b559ceb268a Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Fri, 24 Apr 2015 16:02:30 +0200 Subject: [PATCH] Remove Qt Quick 1 Template Since this was the only template using the qt quick application viewer, remove all traces of that too. And this was also the only "upgradeable" template, so remove all traces of the upgrade code too. Change-Id: I68989dc5a87621593f3b5dd8c4979bb59f137200 Reviewed-by: Alessandro Portale --- .../templates/qtquick/qtquick_1_1/app.pro | 17 --- .../templates/qtquick/qtquick_1_1/main.cpp | 15 --- .../templates/qtquick/qtquick_1_1/main.qml | 18 --- .../templates/qtquick/qtquick_1_1/qml.qrc | 5 - .../qtquick/qtquick_1_1/template.xml | 10 -- .../qtquick/qtquick_2_1/template.xml | 3 +- .../qtquick/qtquick_2_2/template.xml | 3 +- .../qtquick/qtquick_2_3/template.xml | 3 +- .../qtquick/qtquick_2_4/template.xml | 3 +- .../qtquick/qtquickcontrols_1_0/template.xml | 3 +- .../qtquick/qtquickcontrols_1_1/template.xml | 3 +- .../qtquick/qtquickcontrols_1_2/template.xml | 3 +- .../qtquick/qtquickcontrols_1_3/template.xml | 3 +- share/qtcreator/templates/shared/app.desktop | 11 -- .../qtcreator/templates/shared/manifest.aegis | 69 ----------- .../qtquick1applicationviewer.cpp | 72 ------------ .../qtquick1applicationviewer.h | 40 ------- .../qtquick1applicationviewer.pri | 11 -- .../qmakeprojectmanager/qmakeproject.cpp | 41 +------ .../qmakeprojectmanager/qmakeproject.h | 1 - .../wizards/abstractmobileapp.cpp | 106 +---------------- .../wizards/abstractmobileapp.h | 18 +-- .../wizards/qtquickapp.cpp | 110 +----------------- .../qmakeprojectmanager/wizards/qtquickapp.h | 20 +--- 24 files changed, 15 insertions(+), 573 deletions(-) delete mode 100644 share/qtcreator/templates/qtquick/qtquick_1_1/app.pro delete mode 100644 share/qtcreator/templates/qtquick/qtquick_1_1/main.cpp delete mode 100644 share/qtcreator/templates/qtquick/qtquick_1_1/main.qml delete mode 100644 share/qtcreator/templates/qtquick/qtquick_1_1/qml.qrc delete mode 100644 share/qtcreator/templates/qtquick/qtquick_1_1/template.xml delete mode 100644 share/qtcreator/templates/shared/app.desktop delete mode 100644 share/qtcreator/templates/shared/manifest.aegis delete mode 100644 share/qtcreator/templates/shared/qtquickapplicationviewer/qtquick1applicationviewer/qtquick1applicationviewer.cpp delete mode 100644 share/qtcreator/templates/shared/qtquickapplicationviewer/qtquick1applicationviewer/qtquick1applicationviewer.h delete mode 100644 share/qtcreator/templates/shared/qtquickapplicationviewer/qtquick1applicationviewer/qtquick1applicationviewer.pri diff --git a/share/qtcreator/templates/qtquick/qtquick_1_1/app.pro b/share/qtcreator/templates/qtquick/qtquick_1_1/app.pro deleted file mode 100644 index 4c3dc5c8cbf..00000000000 --- a/share/qtcreator/templates/qtquick/qtquick_1_1/app.pro +++ /dev/null @@ -1,17 +0,0 @@ -# Additional import path used to resolve QML modules in Creator's code model -# QML_IMPORT_PATH # -QML_IMPORT_PATH = - -# The .cpp file which was generated for your project. Feel free to hack it. -SOURCES += main.cpp - -RESOURCES += qml.qrc - -# Installation path -# target.path = - -# Please do not modify the following two lines. Required for deployment. -include(../../shared/qtquickapplicationviewer/qtquick1applicationviewer/qtquick1applicationviewer.pri) - -# Default rules for deployment. -include(../../shared/qrcdeployment.pri) diff --git a/share/qtcreator/templates/qtquick/qtquick_1_1/main.cpp b/share/qtcreator/templates/qtquick/qtquick_1_1/main.cpp deleted file mode 100644 index c2cd41c7b67..00000000000 --- a/share/qtcreator/templates/qtquick/qtquick_1_1/main.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "qtquick1applicationviewer.h" -#include - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - QtQuick1ApplicationViewer viewer; - viewer.addImportPath(QLatin1String("modules")); // ADDIMPORTPATH - viewer.setOrientation(QtQuick1ApplicationViewer::ScreenOrientationAuto); // ORIENTATION - viewer.setMainQmlFile(QLatin1String("qrc:/main.qml")); // MAINQML - viewer.showExpanded(); - - return app.exec(); -} diff --git a/share/qtcreator/templates/qtquick/qtquick_1_1/main.qml b/share/qtcreator/templates/qtquick/qtquick_1_1/main.qml deleted file mode 100644 index 07c789d6d16..00000000000 --- a/share/qtcreator/templates/qtquick/qtquick_1_1/main.qml +++ /dev/null @@ -1,18 +0,0 @@ -import QtQuick 1.1 - -Rectangle { - width: 360 - height: 360 - - MouseArea { - anchors.fill: parent - onClicked: { - Qt.quit(); - } - } - - Text { - text: qsTr("Hello World") - anchors.centerIn: parent - } -} diff --git a/share/qtcreator/templates/qtquick/qtquick_1_1/qml.qrc b/share/qtcreator/templates/qtquick/qtquick_1_1/qml.qrc deleted file mode 100644 index 5f6483ac33f..00000000000 --- a/share/qtcreator/templates/qtquick/qtquick_1_1/qml.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - main.qml - - diff --git a/share/qtcreator/templates/qtquick/qtquick_1_1/template.xml b/share/qtcreator/templates/qtquick/qtquick_1_1/template.xml deleted file mode 100644 index 02c44b75519..00000000000 --- a/share/qtcreator/templates/qtquick/qtquick_1_1/template.xml +++ /dev/null @@ -1,10 +0,0 @@ - - diff --git a/share/qtcreator/templates/qtquick/qtquick_2_1/template.xml b/share/qtcreator/templates/qtquick/qtquick_2_1/template.xml index 648571a7021..831f3157a66 100644 --- a/share/qtcreator/templates/qtquick/qtquick_2_1/template.xml +++ b/share/qtcreator/templates/qtquick/qtquick_2_1/template.xml @@ -1,8 +1,7 @@ diff --git a/share/qtcreator/templates/qtquick/qtquick_2_2/template.xml b/share/qtcreator/templates/qtquick/qtquick_2_2/template.xml index 86431f727c5..98f7f7f7e29 100644 --- a/share/qtcreator/templates/qtquick/qtquick_2_2/template.xml +++ b/share/qtcreator/templates/qtquick/qtquick_2_2/template.xml @@ -1,8 +1,7 @@ diff --git a/share/qtcreator/templates/qtquick/qtquick_2_3/template.xml b/share/qtcreator/templates/qtquick/qtquick_2_3/template.xml index e788fe9a7d5..b74ec0d2bef 100644 --- a/share/qtcreator/templates/qtquick/qtquick_2_3/template.xml +++ b/share/qtcreator/templates/qtquick/qtquick_2_3/template.xml @@ -1,8 +1,7 @@ diff --git a/share/qtcreator/templates/qtquick/qtquick_2_4/template.xml b/share/qtcreator/templates/qtquick/qtquick_2_4/template.xml index 4e0f06de227..f8fed165a9a 100644 --- a/share/qtcreator/templates/qtquick/qtquick_2_4/template.xml +++ b/share/qtcreator/templates/qtquick/qtquick_2_4/template.xml @@ -1,8 +1,7 @@ diff --git a/share/qtcreator/templates/qtquick/qtquickcontrols_1_0/template.xml b/share/qtcreator/templates/qtquick/qtquickcontrols_1_0/template.xml index c2368c519b8..4a55e77a867 100644 --- a/share/qtcreator/templates/qtquick/qtquickcontrols_1_0/template.xml +++ b/share/qtcreator/templates/qtquick/qtquickcontrols_1_0/template.xml @@ -1,8 +1,7 @@ diff --git a/share/qtcreator/templates/qtquick/qtquickcontrols_1_1/template.xml b/share/qtcreator/templates/qtquick/qtquickcontrols_1_1/template.xml index d4930dd83bf..cf7b24110c4 100644 --- a/share/qtcreator/templates/qtquick/qtquickcontrols_1_1/template.xml +++ b/share/qtcreator/templates/qtquick/qtquickcontrols_1_1/template.xml @@ -1,8 +1,7 @@ diff --git a/share/qtcreator/templates/qtquick/qtquickcontrols_1_2/template.xml b/share/qtcreator/templates/qtquick/qtquickcontrols_1_2/template.xml index 66b44a4d437..4f7e618489e 100644 --- a/share/qtcreator/templates/qtquick/qtquickcontrols_1_2/template.xml +++ b/share/qtcreator/templates/qtquick/qtquickcontrols_1_2/template.xml @@ -1,8 +1,7 @@ diff --git a/share/qtcreator/templates/qtquick/qtquickcontrols_1_3/template.xml b/share/qtcreator/templates/qtquick/qtquickcontrols_1_3/template.xml index cb58b474551..1a4c7ff8a58 100644 --- a/share/qtcreator/templates/qtquick/qtquickcontrols_1_3/template.xml +++ b/share/qtcreator/templates/qtquick/qtquickcontrols_1_3/template.xml @@ -1,8 +1,7 @@ diff --git a/share/qtcreator/templates/shared/app.desktop b/share/qtcreator/templates/shared/app.desktop deleted file mode 100644 index 1bb7929aae4..00000000000 --- a/share/qtcreator/templates/shared/app.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -Terminal=false -Name=thisApp -Exec=/opt/thisApp/bin/thisApp -Icon=thisApp -X-Window-Icon= -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable diff --git a/share/qtcreator/templates/shared/manifest.aegis b/share/qtcreator/templates/shared/manifest.aegis deleted file mode 100644 index e7b9c80d9be..00000000000 --- a/share/qtcreator/templates/shared/manifest.aegis +++ /dev/null @@ -1,69 +0,0 @@ -AutoGenerateAegisFile - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/share/qtcreator/templates/shared/qtquickapplicationviewer/qtquick1applicationviewer/qtquick1applicationviewer.cpp b/share/qtcreator/templates/shared/qtquickapplicationviewer/qtquick1applicationviewer/qtquick1applicationviewer.cpp deleted file mode 100644 index 2ded81c79a9..00000000000 --- a/share/qtcreator/templates/shared/qtquickapplicationviewer/qtquick1applicationviewer/qtquick1applicationviewer.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* - This file was generated by the Qt Quick 1 Application wizard of Qt Creator. - QtQuick1ApplicationViewer is a convenience class containing mobile device - specific code such as screen orientation handling. Also QML paths are - handled here. - It is recommended not to modify this file, since newer versions of Qt Creator - may offer an updated version of it. -*/ - -#include "qtquick1applicationviewer.h" - -#include -#include -#include - - -QtQuick1ApplicationViewer::QtQuick1ApplicationViewer(QWidget *parent) - : QDeclarativeView(parent) -{ - connect(engine(), SIGNAL(quit()), SLOT(close())); - setResizeMode(QDeclarativeView::SizeRootObjectToView); -} - -QtQuick1ApplicationViewer::~QtQuick1ApplicationViewer() -{ -} - -QtQuick1ApplicationViewer *QtQuick1ApplicationViewer::create() -{ - return new QtQuick1ApplicationViewer(); -} - -void QtQuick1ApplicationViewer::setMainQmlFile(const QString &file) -{ - setSource(file); -} - -void QtQuick1ApplicationViewer::addImportPath(const QString &path) -{ - engine()->addImportPath(path); -} - -void QtQuick1ApplicationViewer::setOrientation(ScreenOrientation orientation) -{ -#if QT_VERSION < 0x050000 - Qt::WidgetAttribute attribute; - switch (orientation) { - case ScreenOrientationLockPortrait: - attribute = Qt::WA_LockPortraitOrientation; - break; - case ScreenOrientationLockLandscape: - attribute = Qt::WA_LockLandscapeOrientation; - break; - default: - case ScreenOrientationAuto: - attribute = Qt::WA_AutoOrientation; - break; - }; - setAttribute(attribute, true); -#else // QT_VERSION < 0x050000 - Q_UNUSED(orientation) -#endif // QT_VERSION < 0x050000 -} - -void QtQuick1ApplicationViewer::showExpanded() -{ -#if defined(Q_WS_SIMULATOR) || defined(Q_OS_QNX) - showFullScreen(); -#else - show(); -#endif -} diff --git a/share/qtcreator/templates/shared/qtquickapplicationviewer/qtquick1applicationviewer/qtquick1applicationviewer.h b/share/qtcreator/templates/shared/qtquickapplicationviewer/qtquick1applicationviewer/qtquick1applicationviewer.h deleted file mode 100644 index 8a9c4e5931d..00000000000 --- a/share/qtcreator/templates/shared/qtquickapplicationviewer/qtquick1applicationviewer/qtquick1applicationviewer.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - This file was generated by the Qt Quick 1 Application wizard of Qt Creator. - QtQuick1ApplicationViewer is a convenience class containing mobile device - specific code such as screen orientation handling. Also QML paths are - handled here. - It is recommended not to modify this file, since newer versions of Qt Creator - may offer an updated version of it. -*/ - -#ifndef QTQUICK1APPLICATIONVIEWER_H -#define QTQUICK1APPLICATIONVIEWER_H - -#include - -class QtQuick1ApplicationViewer : public QDeclarativeView -{ - Q_OBJECT - -public: - enum ScreenOrientation { - ScreenOrientationLockPortrait, - ScreenOrientationLockLandscape, - ScreenOrientationAuto - }; - - explicit QtQuick1ApplicationViewer(QWidget *parent = 0); - virtual ~QtQuick1ApplicationViewer(); - - static QtQuick1ApplicationViewer *create(); - - void setMainQmlFile(const QString &file); - void addImportPath(const QString &path); - - // Note that this will only have an effect on Fremantle. - void setOrientation(ScreenOrientation orientation); - - void showExpanded(); -}; - -#endif // QTQUICK1APPLICATIONVIEWER_H diff --git a/share/qtcreator/templates/shared/qtquickapplicationviewer/qtquick1applicationviewer/qtquick1applicationviewer.pri b/share/qtcreator/templates/shared/qtquickapplicationviewer/qtquick1applicationviewer/qtquick1applicationviewer.pri deleted file mode 100644 index 030edc1d018..00000000000 --- a/share/qtcreator/templates/shared/qtquickapplicationviewer/qtquick1applicationviewer/qtquick1applicationviewer.pri +++ /dev/null @@ -1,11 +0,0 @@ -# This file was generated by the Qt Quick 1 Application wizard of Qt Creator. -# The code below adds the QtQuick1ApplicationViewer to the project. -# -# It is recommended not to modify this file, since newer versions of Qt Creator -# may offer an updated version of it. - -QT += declarative - -SOURCES += $$PWD/qtquick1applicationviewer.cpp -HEADERS += $$PWD/qtquick1applicationviewer.h -INCLUDEPATH += $$PWD diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 8836b5333ca..005437266fb 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -90,28 +90,6 @@ QmakeBuildConfiguration *enableActiveQmakeBuildConfiguration(Target *t, bool ena return bc; } -void updateBoilerPlateCodeFiles(const AbstractMobileApp *app, const QString &proFile) -{ - const QList updates = app->fileUpdates(proFile); - const QString nativeProFile = QDir::toNativeSeparators(proFile); - if (!updates.empty()) { - const QString title = QmakeManager::tr("Update of Generated Files"); - QStringList fileNames; - foreach (const AbstractGeneratedFileInfo &info, updates) - fileNames.append(QDir::toNativeSeparators(info.fileInfo.fileName())); - const QString message = - QmakeManager::tr("In project

%1

The following files are either " - "outdated or have been modified:

%2

Do you want " - "Qt Creator to update the files? Any changes will be lost.") - .arg(nativeProFile, fileNames.join(QLatin1String(", "))); - if (QMessageBox::question(Core::ICore::dialogParent(), title, message, QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { - QString error; - if (!app->updateFiles(updates, error)) - QMessageBox::critical(0, title, error); - } - } -} - } // namespace namespace QmakeProjectManager { @@ -346,8 +324,7 @@ QmakeProject::QmakeProject(QmakeManager *manager, const QString &fileName) : m_asyncUpdateState(Base), m_cancelEvaluate(false), m_centralizedFolderWatcher(0), - m_activeTarget(0), - m_checkForTemplateUpdate(true) + m_activeTarget(0) { setId(Constants::QMAKEPROJECT_ID); setProjectContext(Core::Context(QmakeProjectManager::Constants::PROJECT_ID)); @@ -809,22 +786,6 @@ void QmakeProject::decrementPendingEvaluateFutures() if (debug) qDebug()<<" Setting state to Base"; } - - if (m_checkForTemplateUpdate) { - // Update boiler plate code for subprojects. - QtQuickApp qtQuickApp; - - foreach (QmakeProFileNode *node, applicationProFiles(QmakeProject::ExactAndCumulativeParse)) { - const QString path = node->path().toString(); - - foreach (TemplateInfo info, QtQuickApp::templateInfos()) { - qtQuickApp.setTemplateInfo(info); - updateBoilerPlateCodeFiles(&qtQuickApp, path); - } - } - m_checkForTemplateUpdate = false; - } - } } diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.h b/src/plugins/qmakeprojectmanager/qmakeproject.h index d9fca176ea9..ccedabd2425 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.h +++ b/src/plugins/qmakeprojectmanager/qmakeproject.h @@ -214,7 +214,6 @@ private: Internal::CentralizedFolderWatcher *m_centralizedFolderWatcher; ProjectExplorer::Target *m_activeTarget; - bool m_checkForTemplateUpdate; // initialized to true, set to false after first parse friend class Internal::QmakeProjectFile; friend class Internal::QmakeProjectConfigWidget; diff --git a/src/plugins/qmakeprojectmanager/wizards/abstractmobileapp.cpp b/src/plugins/qmakeprojectmanager/wizards/abstractmobileapp.cpp index 6f60e01a293..503dddff7d2 100644 --- a/src/plugins/qmakeprojectmanager/wizards/abstractmobileapp.cpp +++ b/src/plugins/qmakeprojectmanager/wizards/abstractmobileapp.cpp @@ -54,9 +54,6 @@ AbstractGeneratedFileInfo::AbstractGeneratedFileInfo() const QString AbstractMobileApp::CFileComment(QLatin1String("//")); const QString AbstractMobileApp::ProFileComment(QLatin1Char('#')); -const QString AbstractMobileApp::FileChecksum(QLatin1String("checksum")); -const QString AbstractMobileApp::FileStubVersion(QLatin1String("version")); -const int AbstractMobileApp::StubVersion = 9; AbstractMobileApp::AbstractMobileApp() : QObject() @@ -83,7 +80,6 @@ void AbstractMobileApp::setProjectPath(const QString &path) QString AbstractMobileApp::path(int fileType) const { const QString originsRootApp = originsRoot(); - const QString originsRootShared = templatesRoot() + QLatin1String("shared/"); const QString mainCppFileName = QLatin1String("main.cpp"); switch (fileType) { case MainCpp: return outputPathBase() + mainCppFileName; @@ -91,7 +87,6 @@ QString AbstractMobileApp::path(int fileType) const case AppPro: return outputPathBase() + m_projectName + QLatin1String(".pro"); case AppProOrigin: return originsRootApp + QLatin1String("app.pro"); case AppProPath: return outputPathBase(); - case DesktopOrigin: return originsRootShared + QLatin1String("app.desktop"); default: return pathExtended(fileType); } return QString(); @@ -106,15 +101,6 @@ bool AbstractMobileApp::readTemplate(int fileType, QByteArray *data, QString *er return true; } -QByteArray AbstractMobileApp::generateDesktopFile(QString *errorMessage, int fileType) const -{ - Q_UNUSED(fileType) - QByteArray desktopFileContent; - if (!readTemplate(DesktopOrigin, &desktopFileContent, errorMessage)) - return QByteArray(); - return desktopFileContent.replace("thisApp", projectName().toUtf8()); -} - QByteArray AbstractMobileApp::generateMainCpp(QString *errorMessage) const { QByteArray mainCppInput; @@ -158,29 +144,7 @@ QByteArray AbstractMobileApp::generateProFile(QString *errorMessage) const bool commentOutNextLine = false; QString line; while (!(line = in.readLine()).isNull()) { - if (line.contains(QLatin1String("# DEPLOYMENTFOLDERS"))) { - // Eat lines - QString nextLine; - while (!(nextLine = in.readLine()).isNull() - && !nextLine.contains(QLatin1String("# DEPLOYMENTFOLDERS_END"))) - { } - if (nextLine.isNull()) - continue; - - int foldersCount = 0; - QStringList folders; - foreach (const DeploymentFolder &folder, deploymentFolders()) { - foldersCount++; - const QString folderName = - QString::fromLatin1("folder_%1").arg(foldersCount, 2, 10, QLatin1Char('0')); - out << folderName << ".source = " << folder.first << endl; - if (!folder.second.isEmpty()) - out << folderName << ".target = " << folder.second << endl; - folders.append(folderName); - } - if (foldersCount > 0) - out << "DEPLOYMENTFOLDERS = " << folders.join(QLatin1Char(' ')) << endl; - } else if (line.contains(QLatin1String("# REMOVE_NEXT_LINE"))) { + if (line.contains(QLatin1String("# REMOVE_NEXT_LINE"))) { in.readLine(); // eats the following line } else { handleCurrentProFileTemplateLine(line, in, out, commentOutNextLine); @@ -209,49 +173,6 @@ QByteArray AbstractMobileApp::generateProFile(QString *errorMessage) const return proFileContent; } -QList AbstractMobileApp::fileUpdates(const QString &mainProFile) const -{ - QList result; - foreach (const AbstractGeneratedFileInfo &file, updateableFiles(mainProFile)) { - AbstractGeneratedFileInfo newFile = file; - QFile readFile(newFile.fileInfo.absoluteFilePath()); - if (!readFile.open(QIODevice::ReadOnly)) - continue; - const QString firstLine = QString::fromUtf8(readFile.readLine()); - const QStringList elements = firstLine.split(QLatin1Char(' ')); - if (elements.count() != 5 || elements.at(1) != FileChecksum - || elements.at(3) != FileStubVersion) - continue; - const QString versionString = elements.at(4); - newFile.version = versionString.startsWith(QLatin1String("0x")) - ? versionString.toInt(0, 16) : 0; - newFile.statedChecksum = elements.at(2).toUShort(0, 16); - QByteArray data = readFile.readAll(); - data.replace('\x0D', ""); - data.replace('\x0A', ""); - newFile.dataChecksum = qChecksum(data.constData(), data.length()); - if (newFile.dataChecksum != newFile.statedChecksum - || newFile.version < newFile.currentVersion) - result.append(newFile); - } - return result; -} - - -bool AbstractMobileApp::updateFiles(const QList &list, QString &error) const -{ - error.clear(); - foreach (const AbstractGeneratedFileInfo &info, list) { - const QByteArray data = generateFile(info.fileType, &error); - if (!error.isEmpty()) - return false; - Utils::FileSaver saver(QDir::cleanPath(info.fileInfo.absoluteFilePath())); - saver.write(data); - if (!saver.finalize(&error)) - return false; - } - return true; -} #ifndef CREATORLESSTEST // The definition of QtQuickApp::templatesRoot() for @@ -300,7 +221,6 @@ QByteArray AbstractMobileApp::generateFile(int fileType, { QByteArray data; QString comment = CFileComment; - bool versionAndChecksum = false; switch (fileType) { case AbstractGeneratedFileInfo::MainCppFile: data = generateMainCpp(errorMessage); @@ -310,29 +230,9 @@ QByteArray AbstractMobileApp::generateFile(int fileType, comment = ProFileComment; break; default: - data = generateFileExtended(fileType, &versionAndChecksum, - &comment, errorMessage); + data = generateFileExtended(fileType, errorMessage); } - if (!versionAndChecksum) - return data; - QByteArray versioned = data; - versioned.replace('\x0D', ""); - versioned.replace('\x0A', ""); - const QLatin1String hexPrefix("0x"); - const quint16 checkSum = qChecksum(versioned.constData(), versioned.length()); - const QString checkSumString = hexPrefix + QString::number(checkSum, 16); - const QString versionString - = hexPrefix + QString::number(makeStubVersion(stubVersionMinor()), 16); - const QChar sep = QLatin1Char(' '); - const QString versionLine = - comment + sep + FileChecksum + sep + checkSumString - + sep + FileStubVersion + sep + versionString + QLatin1Char('\x0A'); - return versionLine.toLatin1() + data; -} - -int AbstractMobileApp::makeStubVersion(int minor) -{ - return StubVersion << 16 | minor; + return data; } QString AbstractMobileApp::outputPathBase() const diff --git a/src/plugins/qmakeprojectmanager/wizards/abstractmobileapp.h b/src/plugins/qmakeprojectmanager/wizards/abstractmobileapp.h index ce961201b7b..45e761e3bc7 100644 --- a/src/plugins/qmakeprojectmanager/wizards/abstractmobileapp.h +++ b/src/plugins/qmakeprojectmanager/wizards/abstractmobileapp.h @@ -85,7 +85,6 @@ public: AppPro, AppProOrigin, AppProPath, - DesktopOrigin, ExtendedFile }; @@ -103,10 +102,6 @@ public: bool generateFiles(QString *errorMessage) const; #endif // CREATORLESSTEST - static int makeStubVersion(int minor); - QList fileUpdates(const QString &mainProFile) const; - bool updateFiles(const QList &list, QString &error) const; - protected: AbstractMobileApp(); virtual QByteArray generateProFile(QString *errorMessage) const; @@ -126,33 +121,22 @@ protected: static const QString CFileComment; static const QString ProFileComment; - static const QString FileChecksum; - static const QString FileStubVersion; - static const int StubVersion; QString m_error; private: - QByteArray generateDesktopFile(QString *errorMessage, int fileType) const; QByteArray generateMainCpp(QString *errorMessage) const; - virtual QByteArray generateFileExtended(int fileType, - bool *versionAndCheckSum, QString *comment, QString *errorMessage) const = 0; + virtual QByteArray generateFileExtended(int fileType, QString *errorMessage) const = 0; virtual QString pathExtended(int fileType) const = 0; virtual QString originsRoot() const = 0; - virtual QString mainWindowClassName() const = 0; - virtual int stubVersionMinor() const = 0; virtual bool adaptCurrentMainCppTemplateLine(QString &line) const = 0; virtual void handleCurrentProFileTemplateLine(const QString &line, QTextStream &proFileTemplate, QTextStream &proFile, bool &commentOutNextLine) const = 0; - virtual QList updateableFiles(const QString &mainProFile) const = 0; - virtual QList deploymentFolders() const = 0; QString m_projectName; QFileInfo m_projectPath; - QString m_pngIcon64; - QString m_pngIcon80; }; } // namespace QmakeProjectManager diff --git a/src/plugins/qmakeprojectmanager/wizards/qtquickapp.cpp b/src/plugins/qmakeprojectmanager/wizards/qtquickapp.cpp index fa0c3226668..83f32dd7368 100644 --- a/src/plugins/qmakeprojectmanager/wizards/qtquickapp.cpp +++ b/src/plugins/qmakeprojectmanager/wizards/qtquickapp.cpp @@ -52,11 +52,6 @@ static QString sharedDirectory() return Core::ICore::resourcePath() + QLatin1String("/templates/shared/"); } -static QString qtQuickApplicationViewerDirectory() -{ - return sharedDirectory() + QLatin1String("qtquickapplicationviewer/"); -} - static QString templateRootDirectory() { return Core::ICore::resourcePath() + QLatin1String("/templates/qtquick/"); @@ -118,10 +113,7 @@ static bool parseTemplateXml(QXmlStreamReader &reader, TemplateInfo *info) static const QLatin1String attribute_featuresRequired("featuresRequired"); static const QLatin1String attribute_openEditor("openeditor"); static const QLatin1String attribute_priority("priority"); - static const QLatin1String attribute_viewerdir("viewerdir"); - static const QLatin1String attribute_viewerclassname("viewerclassname"); static const QLatin1String attribute_qrcdeployment("qrcdeployment"); - static const QLatin1String attribute_stubversionminor("stubversionminor"); static const QLatin1String attribute_requiredPlugins("requiredPlugins"); while (!reader.atEnd() && !reader.hasError()) { @@ -137,18 +129,9 @@ static bool parseTemplateXml(QXmlStreamReader &reader, TemplateInfo *info) if (reader.attributes().hasAttribute(attribute_featuresRequired)) info->featuresRequired = reader.attributes().value(attribute_featuresRequired).toString(); - if (reader.attributes().hasAttribute(attribute_viewerdir)) - info->viewerDir = reader.attributes().value(attribute_viewerdir).toString(); - - if (reader.attributes().hasAttribute(attribute_viewerclassname)) - info->viewerClassName = reader.attributes().value(attribute_viewerclassname).toString(); - if (reader.attributes().hasAttribute(attribute_qrcdeployment)) info->qrcDeployment = reader.attributes().value(attribute_qrcdeployment).toString(); - if (reader.attributes().hasAttribute(attribute_stubversionminor)) - info->stubVersionMinor = reader.attributes().value(attribute_stubversionminor).toString().toInt(); - // This attribute is currently used in enterprise addons to filter out templates when the enterprise // addon is not installed. This applies to the Boot To Qt addon for example. if (reader.attributes().hasAttribute(attribute_requiredPlugins)) @@ -234,8 +217,6 @@ void QtQuickApp::setTemplateInfo(const TemplateInfo &templateInfo) QString QtQuickApp::pathExtended(int fileType) const { - const QString appViewerTargetSubDir = appViewerOriginSubDir(); - const QString mainQmlFile = QLatin1String("main.qml"); const QString mainQrcFile = QLatin1String("qml.qrc"); @@ -250,12 +231,6 @@ QString QtQuickApp::pathExtended(int fileType) const case MainQrcOrigin: return originsRoot() + mainQrcFile; case QrcDeployment: return pathBase + qrcDeploymentFile; case QrcDeploymentOrigin: return sharedDirectory() + qrcDeployment(); - case AppViewerPri: return pathBase + appViewerTargetSubDir + fileName(AppViewerPri); - case AppViewerPriOrigin: return qtQuickApplicationViewerDirectory() + appViewerOriginSubDir() + fileName(AppViewerPri); - case AppViewerCpp: return pathBase + appViewerTargetSubDir + fileName(AppViewerCpp); - case AppViewerCppOrigin: return qtQuickApplicationViewerDirectory() + appViewerOriginSubDir() + fileName(AppViewerCpp); - case AppViewerH: return pathBase + appViewerTargetSubDir + fileName(AppViewerH); - case AppViewerHOrigin: return qtQuickApplicationViewerDirectory() + appViewerOriginSubDir() + fileName(AppViewerH); default: qFatal("QtQuickApp::pathExtended() needs more work"); } return QString(); @@ -266,11 +241,6 @@ QString QtQuickApp::originsRoot() const return m_templateInfo.templatePath + QLatin1Char('/'); } -QString QtQuickApp::mainWindowClassName() const -{ - return m_templateInfo.viewerClassName; -} - bool QtQuickApp::adaptCurrentMainCppTemplateLine(QString &line) const { Q_UNUSED(line) @@ -328,11 +298,6 @@ Core::GeneratedFiles QtQuickApp::generateFiles(QString *errorMessage) const if (!qrcDeployment().isEmpty()) { files.append(file(generateFile(QtQuickAppGeneratedFileInfo::QrcDeploymentFile, errorMessage), path(QrcDeployment))); } - if (!appViewerBaseName().isEmpty()) { - files.append(file(generateFile(QtQuickAppGeneratedFileInfo::AppViewerPriFile, errorMessage), path(AppViewerPri))); - files.append(file(generateFile(QtQuickAppGeneratedFileInfo::AppViewerCppFile, errorMessage), path(AppViewerCpp))); - files.append(file(generateFile(QtQuickAppGeneratedFileInfo::AppViewerHFile, errorMessage), path(AppViewerH))); - } return files; } @@ -343,41 +308,19 @@ bool QtQuickApp::useExistingMainQml() const return !m_mainQmlFile.filePath().isEmpty(); } -QString QtQuickApp::appViewerBaseName() const -{ - return m_templateInfo.viewerDir; -} - QString QtQuickApp::qrcDeployment() const { return m_templateInfo.qrcDeployment; } -QString QtQuickApp::fileName(QtQuickApp::ExtendedFileType type) const -{ - switch (type) { - case AppViewerPri: return appViewerBaseName() + QLatin1String(".pri"); - case AppViewerH: return appViewerBaseName() + QLatin1String(".h"); - case AppViewerCpp: return appViewerBaseName() + QLatin1String(".cpp"); - default: return QString(); - } -} - -QString QtQuickApp::appViewerOriginSubDir() const -{ - return appViewerBaseName() + QLatin1Char('/'); -} - QByteArray QtQuickApp::generateProFile(QString *errorMessage) const { QByteArray proFileContent = AbstractMobileApp::generateProFile(errorMessage); - proFileContent.replace("../../shared/qtquickapplicationviewer/", ""); proFileContent.replace("../../shared/qrc", ""); // fix a path to qrcdeployment.pri return proFileContent; } -QByteArray QtQuickApp::generateFileExtended(int fileType, - bool *versionAndCheckSum, QString *comment, QString *errorMessage) const +QByteArray QtQuickApp::generateFileExtended(int fileType, QString *errorMessage) const { QByteArray data; switch (fileType) { @@ -390,62 +333,11 @@ QByteArray QtQuickApp::generateFileExtended(int fileType, case QtQuickAppGeneratedFileInfo::QrcDeploymentFile: data = readBlob(path(QrcDeploymentOrigin), errorMessage); break; - case QtQuickAppGeneratedFileInfo::AppViewerPriFile: - data = readBlob(path(AppViewerPriOrigin), errorMessage); - *comment = ProFileComment; - *versionAndCheckSum = true; - break; - case QtQuickAppGeneratedFileInfo::AppViewerCppFile: - data = readBlob(path(AppViewerCppOrigin), errorMessage); - *versionAndCheckSum = true; - break; - case QtQuickAppGeneratedFileInfo::AppViewerHFile: default: - data = readBlob(path(AppViewerHOrigin), errorMessage); - *versionAndCheckSum = true; break; } return data; } -int QtQuickApp::stubVersionMinor() const -{ - return m_templateInfo.stubVersionMinor; -} - -QList QtQuickApp::updateableFiles(const QString &mainProFile) const -{ - QList result; - static const struct { - int fileType; - QString fileName; - } files[] = { - {QtQuickAppGeneratedFileInfo::AppViewerPriFile, fileName(AppViewerPri)}, - {QtQuickAppGeneratedFileInfo::AppViewerHFile, fileName(AppViewerH)}, - {QtQuickAppGeneratedFileInfo::AppViewerCppFile, fileName(AppViewerCpp)} - }; - const QFileInfo mainProFileInfo(mainProFile); - const int size = sizeof(files) / sizeof(files[0]); - for (int i = 0; i < size; ++i) { - const QString fileName = mainProFileInfo.dir().absolutePath() - + QLatin1Char('/') + appViewerOriginSubDir() + files[i].fileName; - if (!QFile::exists(fileName)) - continue; - QtQuickAppGeneratedFileInfo file; - file.fileType = files[i].fileType; - file.fileInfo = QFileInfo(fileName); - file.currentVersion = AbstractMobileApp::makeStubVersion(stubVersionMinor()); - result.append(file); - } - if (result.count() != size) - result.clear(); // All files must be found. No wrong/partial updates, please. - return result; -} - -QList QtQuickApp::deploymentFolders() const -{ - return QList(); -} - } // namespace Internal } // namespace QmakeProjectManager diff --git a/src/plugins/qmakeprojectmanager/wizards/qtquickapp.h b/src/plugins/qmakeprojectmanager/wizards/qtquickapp.h index 512c5bbe589..0c9f3ba6131 100644 --- a/src/plugins/qmakeprojectmanager/wizards/qtquickapp.h +++ b/src/plugins/qmakeprojectmanager/wizards/qtquickapp.h @@ -55,7 +55,6 @@ struct QtQuickAppGeneratedFileInfo : public AbstractGeneratedFileInfo class TemplateInfo { public: - TemplateInfo() : stubVersionMinor(9) {} QString templateName; QString templatePath; QString displayName; @@ -63,11 +62,8 @@ public: QString openFile; QString featuresRequired; QString priority; - QString viewerClassName; - QString viewerDir; QString qrcDeployment; QStringList requiredPlugins; - int stubVersionMinor; }; class QtQuickApp : public AbstractMobileApp @@ -78,12 +74,6 @@ public: MainQmlOrigin, MainQrc, MainQrcOrigin, - AppViewerPri, - AppViewerPriOrigin, - AppViewerCpp, - AppViewerCppOrigin, - AppViewerH, - AppViewerHOrigin, QrcDeployment, QrcDeploymentOrigin }; @@ -106,24 +96,16 @@ public: protected: virtual QByteArray generateProFile(QString *errorMessage) const; - QString appViewerBaseName() const; QString qrcDeployment() const; - QString fileName(ExtendedFileType type) const; - QString appViewerOriginSubDir() const; private: - virtual QByteArray generateFileExtended(int fileType, - bool *versionAndCheckSum, QString *comment, QString *errorMessage) const; + virtual QByteArray generateFileExtended(int fileType, QString *errorMessage) const; virtual QString pathExtended(int fileType) const; virtual QString originsRoot() const; - virtual QString mainWindowClassName() const; - virtual int stubVersionMinor() const; virtual bool adaptCurrentMainCppTemplateLine(QString &line) const; virtual void handleCurrentProFileTemplateLine(const QString &line, QTextStream &proFileTemplate, QTextStream &proFile, bool &commentOutNextLine) const; - QList updateableFiles(const QString &mainProFile) const; - QList deploymentFolders() const; QFileInfo m_mainQmlFile; TemplateInfo m_templateInfo;