Commit f8dea43e authored by jkobus's avatar jkobus Committed by Jarek Kobus

Cleanup unused stuff (mobile library page, mobile app)

Change-Id: Ia20f0902a407c2d9d47c998b847e082466c6f496
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 0e2ed3f2
......@@ -21,9 +21,6 @@ HEADERS += \
profilehoverhandler.h \
wizards/qtprojectparameters.h \
wizards/guiappwizard.h \
wizards/mobileapp.h \
wizards/mobilelibrarywizardoptionpage.h \
wizards/mobilelibraryparameters.h \
wizards/consoleappwizard.h \
wizards/consoleappwizarddialog.h \
wizards/libraryparameters.h \
......@@ -79,9 +76,6 @@ SOURCES += \
profilehoverhandler.cpp \
wizards/qtprojectparameters.cpp \
wizards/guiappwizard.cpp \
wizards/mobileapp.cpp \
wizards/mobilelibrarywizardoptionpage.cpp \
wizards/mobilelibraryparameters.cpp \
wizards/consoleappwizard.cpp \
wizards/consoleappwizarddialog.cpp \
wizards/libraryparameters.cpp \
......@@ -125,7 +119,6 @@ FORMS += makestep.ui \
librarydetailswidget.ui \
wizards/testwizardpage.ui \
wizards/html5appwizardsourcespage.ui \
wizards/mobilelibrarywizardoptionpage.ui \
wizards/qtquickcomponentsetoptionspage.ui
RESOURCES += qmakeprojectmanager.qrc \
......
......@@ -103,9 +103,6 @@ QtcPlugin {
"libraryparameters.cpp", "libraryparameters.h",
"librarywizard.cpp", "librarywizard.h",
"librarywizarddialog.cpp", "librarywizarddialog.h",
"mobileapp.cpp", "mobileapp.h",
"mobilelibraryparameters.cpp", "mobilelibraryparameters.h",
"mobilelibrarywizardoptionpage.cpp", "mobilelibrarywizardoptionpage.h", "mobilelibrarywizardoptionpage.ui",
"modulespage.cpp", "modulespage.h",
"qtprojectparameters.cpp", "qtprojectparameters.h",
"qtquickapp.cpp", "qtquickapp.h",
......
......@@ -29,7 +29,6 @@
#include "librarywizard.h"
#include "librarywizarddialog.h"
#include "mobilelibraryparameters.h"
#include <cpptools/abstracteditorsupport.h>
#include <projectexplorer/projectexplorerconstants.h>
......@@ -71,6 +70,14 @@ QWizard *LibraryWizard::createWizardDialog(QWidget *parent, const Core::WizardDi
return dialog;
}
static void writeLinuxProFile(QTextStream &str)
{
str << "\n"
"unix {\n"
" target.path = /usr/lib\n"
" INSTALLS += target\n"
"}\n";
}
Core::GeneratedFiles LibraryWizard::generateFiles(const QWizard *w,
QString *errorMessage) const
......@@ -80,7 +87,6 @@ Core::GeneratedFiles LibraryWizard::generateFiles(const QWizard *w,
const QtProjectParameters projectParams = dialog->parameters();
const QString projectPath = projectParams.projectPath();
const LibraryParameters params = dialog->libraryParameters();
const MobileLibraryParameters mobileParams = dialog->mobileLibraryParameters();
const QString sharedLibExportMacro = QtProjectParameters::exportMacro(projectParams.fileName);
......@@ -139,8 +145,7 @@ Core::GeneratedFiles LibraryWizard::generateFiles(const QWizard *w,
proStr << "\\\n " << globalHeaderFileName << '\n';
if (!pluginJsonFileName.isEmpty())
proStr << "\nOTHER_FILES += " << pluginJsonFileName << '\n';
if (mobileParams.type)
mobileParams.writeProFile(proStr);
writeLinuxProFile(proStr);
}
profile.setContents(profileContents);
rc.push_back(profile);
......
......@@ -31,8 +31,6 @@
#include "filespage.h"
#include "libraryparameters.h"
#include "modulespage.h"
#include "mobilelibrarywizardoptionpage.h"
#include "mobilelibraryparameters.h"
#include <utils/projectintropage.h>
#include <projectexplorer/projectexplorerconstants.h>
......@@ -137,10 +135,8 @@ LibraryWizardDialog::LibraryWizardDialog(const QString &templateName,
const Core::WizardDialogParameters &parameters) :
BaseQmakeProjectWizardDialog(showModulesPage, new LibraryIntroPage, -1, parent, parameters),
m_filesPage(new FilesPage),
m_mobilePage(new MobileLibraryWizardOptionPage),
m_pluginBaseClassesInitialized(false),
m_filesPageId(-1), m_modulesPageId(-1), m_targetPageId(-1),
m_mobilePageId(-1)
m_filesPageId(-1), m_modulesPageId(-1), m_targetPageId(-1)
{
setWindowIcon(icon);
setWindowTitle(templateName);
......@@ -152,7 +148,6 @@ LibraryWizardDialog::LibraryWizardDialog(const QString &templateName,
if (!parameters.extraValues().contains(QLatin1String(ProjectExplorer::Constants::PROJECT_KIT_IDS))) {
m_targetPageId = addTargetSetupPage();
m_mobilePageId = addPage(m_mobilePage);
}
m_modulesPageId = addModulesPage();
......@@ -165,28 +160,16 @@ LibraryWizardDialog::LibraryWizardDialog(const QString &templateName,
Utils::WizardProgressItem *introItem = wizardProgress()->item(startId());
Utils::WizardProgressItem *targetItem = 0;
Utils::WizardProgressItem *mobileItem = 0;
if (m_targetPageId != -1)
targetItem = wizardProgress()->item(m_targetPageId);
if (m_mobilePageId != -1)
mobileItem = wizardProgress()->item(m_mobilePageId);
Utils::WizardProgressItem *modulesItem = wizardProgress()->item(m_modulesPageId);
Utils::WizardProgressItem *filesItem = wizardProgress()->item(m_filesPageId);
filesItem->setTitle(tr("Details"));
if (m_targetPageId != -1) {
targetItem->setNextItems(QList<Utils::WizardProgressItem *>()
<< mobileItem << modulesItem << filesItem);
targetItem->setNextShownItem(0);
mobileItem->setNextItems(QList<Utils::WizardProgressItem *>()
<< modulesItem << filesItem);
mobileItem->setNextShownItem(0);
} else if (m_mobilePageId != -1) {
introItem->setNextItems(QList<Utils::WizardProgressItem *>()
<< mobileItem);
mobileItem->setNextItems(QList<Utils::WizardProgressItem *>()
<< modulesItem << filesItem);
mobileItem->setNextShownItem(0);
targetItem->setNextShownItem(0);
} else {
introItem->setNextItems(QList<Utils::WizardProgressItem *>()
<< modulesItem << filesItem);
......@@ -230,21 +213,10 @@ int LibraryWizardDialog::skipModulesPageIfNeeded() const
int LibraryWizardDialog::nextId() const
{
if (m_targetPageId != -1) {
if (currentId() == m_targetPageId) {
int next = m_modulesPageId;
if (next == m_modulesPageId)
return skipModulesPageIfNeeded();
return next;
} else if (currentId() == m_mobilePageId) {
if (currentId() == m_targetPageId)
return skipModulesPageIfNeeded();
}
} else if (currentId() == startId()) {
return skipModulesPageIfNeeded();
} else if (currentId() == m_mobilePageId) {
return skipModulesPageIfNeeded();
}
return BaseQmakeProjectWizardDialog::nextId();
......@@ -252,14 +224,14 @@ int LibraryWizardDialog::nextId() const
void LibraryWizardDialog::initializePage(int id)
{
if (m_targetPageId != -1 && (id == m_targetPageId || id == m_mobilePageId)) {
Utils::WizardProgressItem *mobileItem = wizardProgress()->item(m_mobilePageId);
if (m_targetPageId != -1 && id == m_targetPageId) {
Utils::WizardProgressItem *targetsItem = wizardProgress()->item(m_targetPageId);
Utils::WizardProgressItem *modulesItem = wizardProgress()->item(m_modulesPageId);
Utils::WizardProgressItem *filesItem = wizardProgress()->item(m_filesPageId);
if (isModulesPageSkipped())
mobileItem->setNextShownItem(filesItem);
targetsItem->setNextShownItem(filesItem);
else
mobileItem->setNextShownItem(modulesItem);
targetsItem->setNextShownItem(modulesItem);
}
BaseQmakeProjectWizardDialog::initializePage(id);
......@@ -267,9 +239,9 @@ void LibraryWizardDialog::initializePage(int id)
void LibraryWizardDialog::cleanupPage(int id)
{
if (m_targetPageId != -1 && (id == m_targetPageId || id == m_mobilePageId)) {
Utils::WizardProgressItem *mobileItem = wizardProgress()->item(m_mobilePageId);
mobileItem->setNextShownItem(0);
if (m_targetPageId != -1 && id == m_targetPageId) {
Utils::WizardProgressItem *targetsItem = wizardProgress()->item(m_targetPageId);
targetsItem->setNextShownItem(0);
}
BaseQmakeProjectWizardDialog::cleanupPage(id);
}
......@@ -303,9 +275,6 @@ void LibraryWizardDialog::slotCurrentIdChanged(int id)
qDebug() << Q_FUNC_INFO << id;
if (id == m_filesPageId)
setupFilesPage();// Switching to files page: Set up base class accordingly (plugin)
else if (id == m_mobilePageId
|| (currentPage() && currentPage()->isFinalPage()))
setupMobilePage();
}
void LibraryWizardDialog::setupFilesPage()
......@@ -338,13 +307,6 @@ void LibraryWizardDialog::setupFilesPage()
}
}
void LibraryWizardDialog::setupMobilePage()
{
if (type() == QtProjectParameters::Qt4Plugin)
m_mobilePage->setQtPluginDirectory(projectName());
m_mobilePage->setLibraryType(type());
}
LibraryParameters LibraryWizardDialog::libraryParameters() const
{
LibraryParameters rc;
......@@ -364,17 +326,6 @@ QString LibraryWizardDialog::pluginInterface(const QString &baseClass)
return QString();
}
MobileLibraryParameters LibraryWizardDialog::mobileLibraryParameters() const
{
MobileLibraryParameters mlp;
mlp.libraryType = type();
mlp.fileName = projectName();
// Maemo stuff should always be added to pro file. Even if no mobile target is specified
mlp.type |= MobileLibraryParameters::Linux;
return mlp;
}
} // namespace Internal
} // namespace QmakeProjectManager
......@@ -37,9 +37,7 @@ namespace Internal {
struct QtProjectParameters;
class FilesPage;
class MobileLibraryWizardOptionPage;
struct LibraryParameters;
struct MobileLibraryParameters;
// Library wizard dialog.
class LibraryWizardDialog : public BaseQmakeProjectWizardDialog
......@@ -58,7 +56,6 @@ public:
QtProjectParameters parameters() const;
LibraryParameters libraryParameters() const;
MobileLibraryParameters mobileLibraryParameters() const;
static QString pluginInterface(const QString &baseClass);
......@@ -74,17 +71,14 @@ private slots:
private:
QtProjectParameters::Type type() const;
void setupFilesPage();
void setupMobilePage();
bool isModulesPageSkipped() const;
int skipModulesPageIfNeeded() const;
FilesPage *m_filesPage;
MobileLibraryWizardOptionPage *m_mobilePage;
bool m_pluginBaseClassesInitialized;
int m_filesPageId;
int m_modulesPageId;
int m_targetPageId;
int m_mobilePageId;
};
} // namespace Internal
......
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** 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.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "mobileapp.h"
#include <QTextStream>
namespace QmakeProjectManager {
namespace Internal {
const QString mainWindowBaseName(QLatin1String("mainwindow"));
const QString mainWindowCppFileName(mainWindowBaseName + QLatin1String(".cpp"));
const QString mainWindowHFileName(mainWindowBaseName + QLatin1String(".h"));
const QString mainWindowUiFileName(mainWindowBaseName + QLatin1String(".ui"));
bool MobileAppGeneratedFileInfo::isOutdated() const
{
return version < AbstractMobileApp::makeStubVersion(MobileApp::StubVersion);
}
MobileApp::MobileApp() : AbstractMobileApp()
{
}
MobileApp::~MobileApp()
{
}
QString MobileApp::pathExtended(int fileType) const
{
const QString pathBase = outputPathBase();
switch (fileType) {
case MainWindowCpp: return pathBase + mainWindowCppFileName;
case MainWindowCppOrigin: return originsRoot() + mainWindowCppFileName;
case MainWindowH: return pathBase + mainWindowHFileName;
case MainWindowHOrigin: return originsRoot() + mainWindowHFileName;
case MainWindowUi: return pathBase + mainWindowUiFileName;
case MainWindowUiOrigin: return originsRoot() + mainWindowUiFileName;
default: qFatal("MobileApp::path() needs more work");
}
return QString();
}
bool MobileApp::adaptCurrentMainCppTemplateLine(QString &line) const
{
Q_UNUSED(line);
return true;
}
void MobileApp::handleCurrentProFileTemplateLine(const QString &line,
QTextStream &proFileTemplate, QTextStream &proFile,
bool &commentOutNextLine) const
{
Q_UNUSED(line);
Q_UNUSED(proFileTemplate);
Q_UNUSED(proFile);
Q_UNUSED(commentOutNextLine);
}
Core::GeneratedFiles MobileApp::generateFiles(QString *errorMessage) const
{
Core::GeneratedFiles files = AbstractMobileApp::generateFiles(errorMessage);
files.append(file(generateFile(AbstractGeneratedFileInfo::DeploymentPriFile, errorMessage), path(DeploymentPri)));
files.append(file(generateFile(MobileAppGeneratedFileInfo::MainWindowCppFile, errorMessage), path(MainWindowCpp)));
files.append(file(generateFile(MobileAppGeneratedFileInfo::MainWindowHFile, errorMessage), path(MainWindowH)));
files.append(file(generateFile(MobileAppGeneratedFileInfo::MainWindowUiFile, errorMessage), path(MainWindowUi)));
files.last().setAttributes(Core::GeneratedFile::OpenEditorAttribute);
return files;
}
QByteArray MobileApp::generateFileExtended(int fileType,
bool *versionAndCheckSum, QString *comment, QString *errorMessage) const
{
Q_UNUSED(comment);
QByteArray data;
*versionAndCheckSum = false;
switch (fileType) {
case MobileAppGeneratedFileInfo::MainWindowCppFile:
data = readBlob(path(MainWindowCppOrigin), errorMessage);
break;
case MobileAppGeneratedFileInfo::MainWindowHFile:
data = readBlob(path(MainWindowHOrigin), errorMessage);
break;
case MobileAppGeneratedFileInfo::MainWindowUiFile:
data = readBlob(path(MainWindowUiOrigin), errorMessage);
break;
default:
Q_ASSERT_X(false, Q_FUNC_INFO, "Whoops, case missing!");
}
return data;
}
QString MobileApp::originsRoot() const
{
return templatesRoot() + QLatin1String("mobileapp/");
}
QString MobileApp::mainWindowClassName() const
{
return QLatin1String("MainWindow");
}
int MobileApp::stubVersionMinor() const { return StubVersion; }
QList<AbstractGeneratedFileInfo> MobileApp::updateableFiles(const QString &mainProFile) const
{
Q_UNUSED(mainProFile)
return QList<AbstractGeneratedFileInfo>(); // Nothing to update, here
}
QList<DeploymentFolder> MobileApp::deploymentFolders() const
{
QList<DeploymentFolder> result;
return result;
}
const int MobileApp::StubVersion = 2;
} // namespace Internal
} // namespace QmakeProjectManager
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** 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.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef MOBILEAPP_H
#define MOBILEAPP_H
#include "abstractmobileapp.h"
namespace QmakeProjectManager {
namespace Internal {
struct MobileAppGeneratedFileInfo : AbstractGeneratedFileInfo
{
enum ExtendedFileType {
MainWindowCppFile = ExtendedFile,
MainWindowHFile,
MainWindowUiFile
};
MobileAppGeneratedFileInfo() : AbstractGeneratedFileInfo() {}
virtual bool isOutdated() const;
};
class MobileApp : public AbstractMobileApp
{
public:
enum ExtendedFileType {
MainWindowCpp = ExtendedFile,
MainWindowCppOrigin,
MainWindowH,
MainWindowHOrigin,
MainWindowUi,
MainWindowUiOrigin
};
MobileApp();
virtual ~MobileApp();
virtual Core::GeneratedFiles generateFiles(QString *errorMessage) const;
static const int StubVersion;
private:
virtual QByteArray generateFileExtended(int fileType,
bool *versionAndCheckSum, QString *comment, 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<AbstractGeneratedFileInfo> updateableFiles(const QString &mainProFile) const;
QList<DeploymentFolder> deploymentFolders() const;
};
} // namespace Internal
} // namespace QmakeProjectManager
#endif // MOBILEAPP_H
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** 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.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "mobilelibraryparameters.h"
#include <QTextStream>
namespace QmakeProjectManager {
namespace Internal {
MobileLibraryParameters::MobileLibraryParameters() :
type(0), libraryType(TypeNone)
{
}
void MobileLibraryParameters::writeProFile(QTextStream &str) const
{
if (type&Linux)
writeLinuxProFile(str);
}
void MobileLibraryParameters::writeLinuxProFile(QTextStream &str) const
{
str << "\n"
"unix:!symbian {\n"
" target.path = /usr/lib\n"
" INSTALLS += target\n"
"}\n";
}
} // namespace Internal
} // namespace QmakeProjectManager
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** 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.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef MOBILELIBRARYPARAMETERS_H
#define MOBILELIBRARYPARAMETERS_H
#include <QString>
QT_BEGIN_NAMESPACE
class QTextStream;
QT_END_NAMESPACE
namespace QmakeProjectManager {
namespace Internal {
// Additional parameters required for creating mobile
// libraries
struct MobileLibraryParameters {
enum Type { TypeNone = 0, Linux = 0x1 };
MobileLibraryParameters();
void writeProFile(QTextStream &str) const;
private:
void writeLinuxProFile(QTextStream &str) const;
public:
uint type;
uint libraryType;
QString fileName;
QString qtPluginDirectory;
};