Commit 38edea50 authored by Alessandro Portale's avatar Alessandro Portale

Renaming: QmlStandaloneApp* -> QtQuickApp*

parent 7870769a
......@@ -41,7 +41,7 @@
#include "profilereader.h"
#include "qmakestep.h"
#include "qt4buildconfiguration.h"
#include "wizards/qmlstandaloneapp.h"
#include "wizards/qtquickapp.h"
#include <coreplugin/icore.h>
#include <coreplugin/basefilewizard.h>
......@@ -237,7 +237,7 @@ ProjectExplorer::Project *Qt4Manager::openProject(const QString &fileName)
}
}
QmlStandaloneApp app;
QtQuickApp app;
updateBoilerPlateCodeFiles(&app, canonicalFilePath);
Qt4Project *pro = new Qt4Project(this, canonicalFilePath);
......
......@@ -36,13 +36,13 @@ HEADERS += \
wizards/filespage.h \
wizards/qtwizard.h \
wizards/targetsetuppage.h \
wizards/qmlstandaloneappwizard.h \
wizards/qmlstandaloneappwizardpages.h \
wizards/qtquickapp.h \
wizards/qtquickappwizard.h \
wizards/qtquickappwizardpages.h \
wizards/html5app.h \
wizards/html5appwizard.h \
wizards/html5appwizardpages.h \
wizards/abstractmobileapp.h \
wizards/qmlstandaloneapp.h \
wizards/abstractmobileappwizard.h \
wizards/subdirsprojectwizard.h \
wizards/subdirsprojectwizarddialog.h \
......@@ -102,13 +102,13 @@ SOURCES += qt4projectmanagerplugin.cpp \
wizards/filespage.cpp \
wizards/qtwizard.cpp \
wizards/targetsetuppage.cpp \
wizards/qmlstandaloneappwizard.cpp \
wizards/qmlstandaloneappwizardpages.cpp \
wizards/qtquickapp.cpp \
wizards/qtquickappwizard.cpp \
wizards/qtquickappwizardpages.cpp \
wizards/html5app.cpp \
wizards/html5appwizard.cpp \
wizards/html5appwizardpages.cpp \
wizards/abstractmobileapp.cpp \
wizards/qmlstandaloneapp.cpp \
wizards/abstractmobileappwizard.cpp \
wizards/subdirsprojectwizard.cpp \
wizards/subdirsprojectwizarddialog.cpp \
......@@ -143,7 +143,7 @@ FORMS += makestep.ui \
gettingstartedwelcomepagewidget.ui \
wizards/testwizardpage.ui \
wizards/targetsetuppage.ui \
wizards/qmlstandaloneappwizardsourcespage.ui \
wizards/qtquickappwizardsourcespage.ui \
wizards/html5appwizardsourcespage.ui \
wizards/mobilelibrarywizardoptionpage.ui \
wizards/mobileappwizardgenericoptionspage.ui \
......
......@@ -131,7 +131,7 @@ const char * const QT_SIMULATOR_TARGET_ID = "Qt4ProjectManager.Target.QtSimulato
// ICONS
const char * const ICON_QT_PROJECT = ":/qt4projectmanager/images/qt_project.png";
const char * const ICON_WINDOW = ":/qt4projectmanager/images/window.png";
const char * const ICON_QML_STANDALONE = ":/wizards/images/qml_standalone.png";
const char * const ICON_QTQUICK_APP = ":/wizards/images/qtquickapp.png";
// Env variables
const char * const QMAKEVAR_QMLJSDEBUGGER_PATH = "QMLJSDEBUGGER_PATH";
......
......@@ -43,7 +43,7 @@
#include "wizards/testwizard.h"
#include "wizards/emptyprojectwizard.h"
#include "wizards/subdirsprojectwizard.h"
#include "wizards/qmlstandaloneappwizard.h"
#include "wizards/qtquickappwizard.h"
#include "wizards/html5appwizard.h"
#include "customwidgetwizard/customwidgetwizard.h"
#include "profileeditorfactory.h"
......@@ -145,7 +145,7 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
addAutoReleasedObject(new GuiAppWizard);
addAutoReleasedObject(new ConsoleAppWizard);
addAutoReleasedObject(new MobileAppWizard);
addAutoReleasedObject(new QmlStandaloneAppWizard());
addAutoReleasedObject(new QtQuickAppWizard);
addAutoReleasedObject(new Html5AppWizard);
addAutoReleasedObject(new LibraryWizard);
addAutoReleasedObject(new TestWizard);
......
......@@ -325,7 +325,7 @@ bool AbstractMobileApp::updateFiles(const QList<AbstractGeneratedFileInfo> &list
QFile file(info.fileInfo.absoluteFilePath());
if (!file.open(QIODevice::WriteOnly) || file.write(data) == -1) {
error = QCoreApplication::translate(
"Qt4ProjectManager::Internal::QmlStandaloneApp",
"Qt4ProjectManager::Internal::QtQuickApp",
"Could not write file '%1'.").
arg(QDir::toNativeSeparators(info.fileInfo.canonicalFilePath()));
return false;
......@@ -335,8 +335,8 @@ bool AbstractMobileApp::updateFiles(const QList<AbstractGeneratedFileInfo> &list
}
#ifndef CREATORLESSTEST
// The definition of QmlStandaloneApp::templatesRoot() for
// CREATORLESSTEST is in tests/manual/qmlstandalone/main.cpp
// The definition of QtQuickApp::templatesRoot() for
// CREATORLESSTEST is in tests/manual/appwizards/helpers.cpp
QString AbstractMobileApp::templatesRoot()
{
return Core::ICore::instance()->resourcePath()
......
......@@ -99,7 +99,7 @@ Html5AppWizard::~Html5AppWizard()
Core::BaseFileWizardParameters Html5AppWizard::parameters()
{
Core::BaseFileWizardParameters parameters(ProjectWizard);
parameters.setIcon(QIcon(QLatin1String(Constants::ICON_QML_STANDALONE)));
parameters.setIcon(QIcon(QLatin1String(Constants::ICON_QT_PROJECT)));
parameters.setDisplayName(tr("Html5 Application"));
parameters.setId(QLatin1String("QA.HTML5A Application"));
parameters.setDescription(tr("Creates an Html5 application project that can contain "
......
......@@ -31,8 +31,8 @@
**
**************************************************************************/
#ifndef QMLSTANDALONEAPP_H
#define QMLSTANDALONEAPP_H
#ifndef QTQUICKAPP_H
#define QTQUICKAPP_H
#include "abstractmobileapp.h"
......@@ -42,7 +42,7 @@
namespace Qt4ProjectManager {
namespace Internal {
class QmlStandaloneApp;
class QtQuickApp;
struct QmlModule
{
......@@ -57,13 +57,13 @@ struct QmlModule
};
QmlModule(const QString &name, const QFileInfo &rootDir, const QFileInfo &qmldir,
bool isExternal, QmlStandaloneApp *qmlStandaloneApp);
bool isExternal, QtQuickApp *qtQuickApp);
QString path(Path path) const;
const QString uri; // "com.foo.bar"
const QFileInfo rootDir; // Location of "com/"
const QFileInfo qmldir; // 'qmldir' file.
const bool isExternal; // Either external or inside a source paths
const QmlStandaloneApp *qmlStandaloneApp;
const QtQuickApp *qtQuickApp;
QHash<QString, struct QmlCppPlugin*> cppPlugins; // Just as info. No ownership.
};
......@@ -77,7 +77,7 @@ struct QmlCppPlugin
const QFileInfo proFile; // .pro file for the plugin
};
struct QmlAppGeneratedFileInfo : public AbstractGeneratedFileInfo
struct QtQuickAppGeneratedFileInfo : public AbstractGeneratedFileInfo
{
enum ExtendedFileType {
MainQmlFile = ExtendedFile,
......@@ -86,10 +86,10 @@ struct QmlAppGeneratedFileInfo : public AbstractGeneratedFileInfo
AppViewerHFile
};
QmlAppGeneratedFileInfo() : AbstractGeneratedFileInfo() {}
QtQuickAppGeneratedFileInfo() : AbstractGeneratedFileInfo() {}
};
class QmlStandaloneApp : public AbstractMobileApp
class QtQuickApp : public AbstractMobileApp
{
public:
enum ExtendedFileType {
......@@ -107,8 +107,8 @@ public:
ModulesDir
};
QmlStandaloneApp();
virtual ~QmlStandaloneApp();
QtQuickApp();
virtual ~QtQuickApp();
void setMainQmlFile(const QString &qmlFile);
QString mainQmlFile() const;
......@@ -152,4 +152,4 @@ private:
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // QMLSTANDALONEAPP_H
#endif // QTQUICKAPP_H
......@@ -33,9 +33,9 @@
#include "mobileappwizardpages.h"
#include "qmlstandaloneapp.h"
#include "qmlstandaloneappwizard.h"
#include "qmlstandaloneappwizardpages.h"
#include "qtquickapp.h"
#include "qtquickappwizard.h"
#include "qtquickappwizardpages.h"
#include "targetsetuppage.h"
#include "qt4projectmanagerconstants.h"
......@@ -59,8 +59,8 @@ public:
explicit QmlStandaloneAppWizardDialog(QWidget *parent = 0);
private:
class QmlStandaloneAppWizardSourcesPage *m_qmlSourcesPage;
friend class QmlStandaloneAppWizard;
class QtQuickAppWizardSourcesPage *m_qmlSourcesPage;
friend class QtQuickAppWizard;
};
QmlStandaloneAppWizardDialog::QmlStandaloneAppWizardDialog(QWidget *parent)
......@@ -70,36 +70,36 @@ QmlStandaloneAppWizardDialog::QmlStandaloneAppWizardDialog(QWidget *parent)
setWindowTitle(tr("New Qt Quick Application"));
setIntroDescription(tr("This wizard generates a Qt Quick application project."));
m_qmlSourcesPage = new QmlStandaloneAppWizardSourcesPage;
m_qmlSourcesPage = new QtQuickAppWizardSourcesPage;
addPageWithTitle(m_qmlSourcesPage, tr("QML Sources"));
}
class QmlStandaloneAppWizardPrivate
class QtQuickAppWizardPrivate
{
class QmlStandaloneApp *standaloneApp;
class QtQuickApp *app;
class QmlStandaloneAppWizardDialog *wizardDialog;
friend class QmlStandaloneAppWizard;
friend class QtQuickAppWizard;
};
QmlStandaloneAppWizard::QmlStandaloneAppWizard()
QtQuickAppWizard::QtQuickAppWizard()
: AbstractMobileAppWizard(parameters())
, m_d(new QmlStandaloneAppWizardPrivate)
, m_d(new QtQuickAppWizardPrivate)
{
m_d->standaloneApp = new QmlStandaloneApp;
m_d->app = new QtQuickApp;
m_d->wizardDialog = 0;
}
QmlStandaloneAppWizard::~QmlStandaloneAppWizard()
QtQuickAppWizard::~QtQuickAppWizard()
{
delete m_d->standaloneApp;
delete m_d->app;
delete m_d;
}
Core::BaseFileWizardParameters QmlStandaloneAppWizard::parameters()
Core::BaseFileWizardParameters QtQuickAppWizard::parameters()
{
Core::BaseFileWizardParameters parameters(ProjectWizard);
parameters.setIcon(QIcon(QLatin1String(Constants::ICON_QML_STANDALONE)));
parameters.setIcon(QIcon(QLatin1String(Constants::ICON_QTQUICK_APP)));
parameters.setDisplayName(tr("Qt Quick Application"));
parameters.setId(QLatin1String("QA.QMLA Application"));
parameters.setDescription(tr("Creates a Qt Quick application project that can contain "
......@@ -114,13 +114,13 @@ Core::BaseFileWizardParameters QmlStandaloneAppWizard::parameters()
return parameters;
}
AbstractMobileAppWizardDialog *QmlStandaloneAppWizard::createWizardDialogInternal(QWidget *parent) const
AbstractMobileAppWizardDialog *QtQuickAppWizard::createWizardDialogInternal(QWidget *parent) const
{
m_d->wizardDialog = new QmlStandaloneAppWizardDialog(parent);
return m_d->wizardDialog;
}
void QmlStandaloneAppWizard::projectPathChanged(const QString &path) const
void QtQuickAppWizard::projectPathChanged(const QString &path) const
{
const QList<TargetSetupPage::ImportInfo> &qtVersions
= TargetSetupPage::importInfosForKnownQtVersions(path);
......@@ -139,33 +139,33 @@ void QmlStandaloneAppWizard::projectPathChanged(const QString &path) const
m_d->wizardDialog->m_targetsPage->setImportInfos(qmlQtVersions);
}
void QmlStandaloneAppWizard::prepareGenerateFiles(const QWizard *w,
void QtQuickAppWizard::prepareGenerateFiles(const QWizard *w,
QString *errorMessage) const
{
Q_UNUSED(errorMessage)
const QmlStandaloneAppWizardDialog *wizard = qobject_cast<const QmlStandaloneAppWizardDialog*>(w);
const QString mainQmlFile = wizard->m_qmlSourcesPage->mainQmlFile();
m_d->standaloneApp->setMainQmlFile(mainQmlFile);
m_d->app->setMainQmlFile(mainQmlFile);
}
bool QmlStandaloneAppWizard::postGenerateFilesInternal(const Core::GeneratedFiles &l,
bool QtQuickAppWizard::postGenerateFilesInternal(const Core::GeneratedFiles &l,
QString *errorMessage)
{
const bool success = ProjectExplorer::CustomProjectWizard::postGenerateOpen(l, errorMessage);
if (success && !m_d->standaloneApp->mainQmlFile().isEmpty()) {
ProjectExplorer::ProjectExplorerPlugin::instance()->setCurrentFile(0, m_d->standaloneApp->mainQmlFile());
Core::EditorManager::instance()->openEditor(m_d->standaloneApp->mainQmlFile(),
if (success && !m_d->app->mainQmlFile().isEmpty()) {
ProjectExplorer::ProjectExplorerPlugin::instance()->setCurrentFile(0, m_d->app->mainQmlFile());
Core::EditorManager::instance()->openEditor(m_d->app->mainQmlFile(),
QString(), Core::EditorManager::ModeSwitch);
}
return success;
}
AbstractMobileApp *QmlStandaloneAppWizard::app() const
AbstractMobileApp *QtQuickAppWizard::app() const
{
return m_d->standaloneApp;
return m_d->app;
}
AbstractMobileAppWizardDialog *QmlStandaloneAppWizard::wizardDialog() const
AbstractMobileAppWizardDialog *QtQuickAppWizard::wizardDialog() const
{
return m_d->wizardDialog;
}
......@@ -173,4 +173,4 @@ AbstractMobileAppWizardDialog *QmlStandaloneAppWizard::wizardDialog() const
} // namespace Internal
} // namespace Qt4ProjectManager
#include "qmlstandaloneappwizard.moc"
#include "qtquickappwizard.moc"
......@@ -31,21 +31,21 @@
**
**************************************************************************/
#ifndef QMLSTANDALONEAPPWIZARD_H
#define QMLSTANDALONEAPPWIZARD_H
#ifndef QTQUICKAPPWIZARD_H
#define QTQUICKAPPWIZARD_H
#include "abstractmobileappwizard.h"
namespace Qt4ProjectManager {
namespace Internal {
class QmlStandaloneAppWizard : public AbstractMobileAppWizard
class QtQuickAppWizard : public AbstractMobileAppWizard
{
Q_OBJECT
public:
QmlStandaloneAppWizard();
virtual ~QmlStandaloneAppWizard();
QtQuickAppWizard();
virtual ~QtQuickAppWizard();
private:
static Core::BaseFileWizardParameters parameters();
......@@ -59,10 +59,10 @@ private:
virtual bool postGenerateFilesInternal(const Core::GeneratedFiles &l,
QString *errorMessage);
class QmlStandaloneAppWizardPrivate *m_d;
class QtQuickAppWizardPrivate *m_d;
};
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // QMLSTANDALONEAPPWIZARD_H
#endif // QTQUICKAPPWIZARD_H
......@@ -31,8 +31,8 @@
**
**************************************************************************/
#include "qmlstandaloneappwizardpages.h"
#include "ui_qmlstandaloneappwizardsourcespage.h"
#include "qtquickappwizardpages.h"
#include "ui_qtquickappwizardsourcespage.h"
#include <coreplugin/coreconstants.h>
#include <QtGui/QDesktopServices>
......@@ -43,15 +43,15 @@
namespace Qt4ProjectManager {
namespace Internal {
class QmlStandaloneAppWizardSourcesPagePrivate
class QtQuickAppWizardSourcesPagePrivate
{
Ui::QmlStandaloneAppWizardSourcesPage ui;
friend class QmlStandaloneAppWizardSourcesPage;
Ui::QtQuickAppWizardSourcesPage ui;
friend class QtQuickAppWizardSourcesPage;
};
QmlStandaloneAppWizardSourcesPage::QmlStandaloneAppWizardSourcesPage(QWidget *parent)
QtQuickAppWizardSourcesPage::QtQuickAppWizardSourcesPage(QWidget *parent)
: QWizardPage(parent)
, m_d(new QmlStandaloneAppWizardSourcesPagePrivate)
, m_d(new QtQuickAppWizardSourcesPagePrivate)
{
m_d->ui.setupUi(this);
m_d->ui.mainQmlFileLineEdit->setExpectedKind(Utils::PathChooser::File);
......@@ -65,18 +65,18 @@ QmlStandaloneAppWizardSourcesPage::QmlStandaloneAppWizardSourcesPage(QWidget *pa
m_d->ui.newQmlRadioButton->setChecked(true);
}
QmlStandaloneAppWizardSourcesPage::~QmlStandaloneAppWizardSourcesPage()
QtQuickAppWizardSourcesPage::~QtQuickAppWizardSourcesPage()
{
delete m_d;
}
QString QmlStandaloneAppWizardSourcesPage::mainQmlFile() const
QString QtQuickAppWizardSourcesPage::mainQmlFile() const
{
return m_d->ui.importExistingQmlRadioButton->isChecked() ?
m_d->ui.mainQmlFileLineEdit->path() : QString();
}
bool QmlStandaloneAppWizardSourcesPage::isComplete() const
bool QtQuickAppWizardSourcesPage::isComplete() const
{
return !m_d->ui.importExistingQmlRadioButton->isChecked()
|| m_d->ui.mainQmlFileLineEdit->isValid();
......
......@@ -31,32 +31,31 @@
**
**************************************************************************/
#ifndef QMLSTANDALONEAPPWIZARDPAGES_H
#define QMLSTANDALONEAPPWIZARDPAGES_H
#ifndef QTQUICKAPPWIZARDPAGES_H
#define QTQUICKAPPWIZARDPAGES_H
#include <QtGui/QWizardPage>
#include "qmlstandaloneapp.h"
namespace Qt4ProjectManager {
namespace Internal {
class QmlStandaloneAppWizardSourcesPage : public QWizardPage
class QtQuickAppWizardSourcesPage : public QWizardPage
{
Q_OBJECT
Q_DISABLE_COPY(QmlStandaloneAppWizardSourcesPage)
Q_DISABLE_COPY(QtQuickAppWizardSourcesPage)
public:
explicit QmlStandaloneAppWizardSourcesPage(QWidget *parent = 0);
virtual ~QmlStandaloneAppWizardSourcesPage();
explicit QtQuickAppWizardSourcesPage(QWidget *parent = 0);
virtual ~QtQuickAppWizardSourcesPage();
QString mainQmlFile() const;
virtual bool isComplete() const;
private:
class QmlStandaloneAppWizardSourcesPagePrivate *m_d;
class QtQuickAppWizardSourcesPagePrivate *m_d;
};
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // QMLSTANDALONEAPPWIZARDPAGES_H
#endif // QTQUICKAPPWIZARDPAGES_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QmlStandaloneAppWizardSourcesPage</class>
<widget class="QWizardPage" name="QmlStandaloneAppWizardSourcesPage">
<class>QtQuickAppWizardSourcesPage</class>
<widget class="QWizardPage" name="QtQuickAppWizardSourcesPage">
<property name="geometry">
<rect>
<x>0</x>
......
......@@ -3,6 +3,6 @@
<file>images/console.png</file>
<file>images/gui.png</file>
<file>images/lib.png</file>
<file>images/qml_standalone.png</file>
<file>images/qtquickapp.png</file>
</qresource>
</RCC>
......@@ -4,11 +4,11 @@ DEFINES += \
CREATORLESSTEST
APPSOURCEDIR = $$CREATORSOURCEDIR/src/plugins/qt4projectmanager/wizards
HEADERS += \
$$APPSOURCEDIR/qmlstandaloneapp.h \
$$APPSOURCEDIR/qtquickapp.h \
$$APPSOURCEDIR/html5app.h \
$$APPSOURCEDIR/abstractmobileapp.h
SOURCES += \
$$APPSOURCEDIR/qmlstandaloneapp.cpp \
$$APPSOURCEDIR/qtquickapp.cpp \
$$APPSOURCEDIR/html5app.cpp \
$$APPSOURCEDIR/abstractmobileapp.cpp \
main.cpp \
......
#include "qmlstandaloneapp.h"
#include "qtquickapp.h"
#include "html5app.h"
#include <QtCore>
......@@ -14,17 +14,17 @@ static bool writeFile(const QByteArray &data, const QString &targetFile)
return file.write(data) != -1;
}
bool QmlStandaloneApp::generateFiles(QString *errorMessage) const
bool QtQuickApp::generateFiles(QString *errorMessage) const
{
return writeFile(generateFile(QmlAppGeneratedFileInfo::MainCppFile, errorMessage), path(MainCpp))
&& writeFile(generateFile(QmlAppGeneratedFileInfo::AppProFile, errorMessage), path(AppPro))
&& (useExistingMainQml() ? true : writeFile(generateFile(QmlAppGeneratedFileInfo::MainQmlFile, errorMessage), path(MainQml)))
&& writeFile(generateFile(QmlAppGeneratedFileInfo::AppViewerPriFile, errorMessage), path(AppViewerPri))
&& writeFile(generateFile(QmlAppGeneratedFileInfo::AppViewerCppFile, errorMessage), path(AppViewerCpp))
&& writeFile(generateFile(QmlAppGeneratedFileInfo::AppViewerHFile, errorMessage), path(AppViewerH))
&& writeFile(generateFile(QmlAppGeneratedFileInfo::SymbianSvgIconFile, errorMessage), path(SymbianSvgIcon))
&& writeFile(generateFile(QmlAppGeneratedFileInfo::MaemoPngIconFile, errorMessage), path(MaemoPngIcon))
&& writeFile(generateFile(QmlAppGeneratedFileInfo::DesktopFile, errorMessage), path(Desktop));
return writeFile(generateFile(QtQuickAppGeneratedFileInfo::MainCppFile, errorMessage), path(MainCpp))
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::AppProFile, errorMessage), path(AppPro))
&& (useExistingMainQml() ? true : writeFile(generateFile(QtQuickAppGeneratedFileInfo::MainQmlFile, errorMessage), path(MainQml)))
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::AppViewerPriFile, errorMessage), path(AppViewerPri))
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::AppViewerCppFile, errorMessage), path(AppViewerCpp))
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::AppViewerHFile, errorMessage), path(AppViewerH))
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::SymbianSvgIconFile, errorMessage), path(SymbianSvgIcon))
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::MaemoPngIconFile, errorMessage), path(MaemoPngIcon))
&& writeFile(generateFile(QtQuickAppGeneratedFileInfo::DesktopFile, errorMessage), path(Desktop));
}
bool Html5App::generateFiles(QString *errorMessage) const
......
......@@ -31,7 +31,7 @@
**
**************************************************************************/
#include "qmlstandaloneapp.h"
#include "qtquickapp.h"
#include "html5app.h"
#include <QtCore>
......@@ -44,7 +44,7 @@ int main(int argc, char *argv[])
const QString projectPath = QLatin1String("testprojects");
{
QmlStandaloneApp sAppNew;
QtQuickApp sAppNew;
sAppNew.setProjectPath(projectPath);
sAppNew.setProjectName(QLatin1String("new_qml_app"));
if (!sAppNew.generateFiles(&errorMessage))
......@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
}
{
QmlStandaloneApp sAppImport01;
QtQuickApp sAppImport01;
sAppImport01.setProjectPath(projectPath);
sAppImport01.setProjectName(QLatin1String("imported_scenario_01"));
sAppImport01.setMainQmlFile(QLatin1String("../appwizards/qmlimportscenario_01/myqmlapp.qml"));
......@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
{
const QString rootPath = QLatin1String("../appwizards/qmlimportscenario_02/");
QmlStandaloneApp sAppImport02;
QtQuickApp sAppImport02;
sAppImport02.setProjectPath(projectPath);
sAppImport02.setProjectName(QLatin1String("imported_scenario_02"));
sAppImport02.setMainQmlFile(rootPath + QLatin1String("subfolder1/myqmlapp.qml"));
......
#include "qmlstandaloneapp.h"
#include "qtquickapp.h"
#include <QtCore>
using namespace Qt4ProjectManager::Internal;
......@@ -27,14 +27,14 @@ bool processXmlFile(const QString &xmlFile)
switch (token) {
case QXmlStreamReader::StartElement:
if (reader.name() == tag_app) {
QmlStandaloneApp qmlApp;
QtQuickApp app;
QFileInfo projectPath;
if (!reader.attributes().hasAttribute(attrib_projectPath)) {
qDebug() << "Project without path found";
continue;
}
projectPath = qtDir + reader.attributes().value(attrib_projectPath).toString();
qmlApp.setProjectPath(projectPath.absoluteFilePath());
app.setProjectPath(projectPath.absoluteFilePath());
if (reader.attributes().hasAttribute(attrib_mainQmlFile)) {
const QFileInfo qmlFileOrigin(
qtDir + reader.attributes().value(attrib_mainQmlFile).toString());
......@@ -63,25 +63,25 @@ bool processXmlFile(const QString &xmlFile)
#else // Q_OS_WIN
// Implement me!
#endif // Q_OS_WIN
qmlApp.setMainQmlFile(qmlTargetPath.absoluteFilePath()
app.setMainQmlFile(qmlTargetPath.absoluteFilePath()
+ QLatin1Char('/') + qmlFileOrigin.fileName());
}
qmlApp.setProjectName(reader.attributes().hasAttribute(attrib_projectName)
app.setProjectName(reader.attributes().hasAttribute(attrib_projectName)
? reader.attributes().value(attrib_projectName).toString()
: QFileInfo(qmlApp.mainQmlFile()).baseName());
: QFileInfo(app.mainQmlFile()).baseName());
if (reader.attributes().hasAttribute(attrib_screenOrientation)) {
const QStringRef orientation = reader.attributes().value(attrib_screenOrientation);
qmlApp.setOrientation(orientation == value_screenOrientationLockLandscape ?
app.setOrientation(orientation == value_screenOrientationLockLandscape ?
AbstractMobileApp::ScreenOrientationLockLandscape
: orientation == value_screenOrientationLockPortrait ?
AbstractMobileApp::ScreenOrientationLockPortrait
: AbstractMobileApp::ScreenOrientationAuto);
}
if (reader.attributes().hasAttribute(attrib_networkAccess))
qmlApp.setNetworkEnabled(
app.setNetworkEnabled(
reader.attributes().value(attrib_networkAccess).toString() == QLatin1String("true"));
if (!qmlApp.generateFiles(0))