From a77c94a63b139426c01a19e3a921c19c05ead944 Mon Sep 17 00:00:00 2001 From: Pawel Polanski Date: Tue, 4 Jan 2011 17:06:42 +0100 Subject: [PATCH] Adding qt plugin support to Symbian's library wizard. Task-number: QTCREATORBUG-3436 Reviewed-by: Tobias Hunger --- .../wizards/librarywizarddialog.cpp | 9 ++- .../mobileappwizardsymbianoptionspage.ui | 4 +- .../wizards/mobilelibraryparameters.cpp | 39 +++++++---- .../wizards/mobilelibraryparameters.h | 1 + .../wizards/mobilelibrarywizardoptionpage.cpp | 18 +++++ .../wizards/mobilelibrarywizardoptionpage.h | 2 + .../wizards/mobilelibrarywizardoptionpage.ui | 68 ++++++++++++------- 7 files changed, 100 insertions(+), 41 deletions(-) diff --git a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp index 12605eff59d..c6f21a24c3b 100644 --- a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp +++ b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp @@ -43,6 +43,7 @@ #include #include +#include #include #include @@ -244,7 +245,9 @@ int LibraryWizardDialog::nextId() const // If there was no Symbian target defined we omit "Symbian specific" step // We also omit this step if the library type is not dll - if (symbianTargetEnabled && type() == QtProjectParameters::SharedLibrary) + if (symbianTargetEnabled + && (type() == QtProjectParameters::SharedLibrary + || type() == QtProjectParameters::Qt4Plugin)) next = m_mobilePageId; if (next == m_modulesPageId) @@ -353,6 +356,9 @@ void LibraryWizardDialog::setupFilesPage() void LibraryWizardDialog::setupMobilePage() { m_mobilePage->setSymbianUid(AbstractMobileApp::symbianUidForPath(path()+projectName())); + + if (type() == QtProjectParameters::Qt4Plugin) + m_mobilePage->setQtPluginDirectory(projectName()); m_mobilePage->setLibraryType(type()); } @@ -381,6 +387,7 @@ MobileLibraryParameters LibraryWizardDialog::mobileLibraryParameters() const if (mlp.type & MobileLibraryParameters::Symbian) { mlp.symbianUid = m_mobilePage->symbianUid(); + mlp.qtPluginDirectory = m_mobilePage->qtPluginDirectory(); mlp.symbianCapabilities |= m_mobilePage->networkEnabled()?MobileLibraryParameters::NetworkServices:0; } diff --git a/src/plugins/qt4projectmanager/wizards/mobileappwizardsymbianoptionspage.ui b/src/plugins/qt4projectmanager/wizards/mobileappwizardsymbianoptionspage.ui index 48919f89d56..a4dfcb79675 100644 --- a/src/plugins/qt4projectmanager/wizards/mobileappwizardsymbianoptionspage.ui +++ b/src/plugins/qt4projectmanager/wizards/mobileappwizardsymbianoptionspage.ui @@ -6,8 +6,8 @@ 0 0 - 400 - 300 + 315 + 116 diff --git a/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.cpp b/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.cpp index 9cd17783419..17b0b8c1b30 100644 --- a/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.cpp +++ b/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.cpp @@ -35,6 +35,7 @@ #include "qtprojectparameters.h" #include +#include namespace Qt4ProjectManager { namespace Internal { @@ -94,19 +95,31 @@ void MobileLibraryParameters::writeProFile(QTextStream &str) const void MobileLibraryParameters::writeSymbianProFile(QTextStream &str) const { - if (libraryType != QtProjectParameters::SharedLibrary) - return; //nothing to do when the library is not a shared library - - str << "\n" - "symbian {\n" - " MMP_RULES += EXPORTUNFROZEN\n" - " TARGET.UID3 = " + symbianUid + "\n" - " TARGET.CAPABILITY = " + generateCapabilitySet(symbianCapabilities).toAscii() + "\n" - " TARGET.EPOCALLOWDLLDATA = 1\n" - " addFiles.sources = " + fileName + ".dll\n" - " addFiles.path = !:/sys/bin\n" - " DEPLOYMENT += addFiles\n" - "}\n"; + if (libraryType == QtProjectParameters::SharedLibrary) { + str << "\n" + "symbian {\n" + " MMP_RULES += EXPORTUNFROZEN\n" + " TARGET.UID3 = " + symbianUid + "\n" + " TARGET.CAPABILITY = " + generateCapabilitySet(symbianCapabilities).toAscii() + "\n" + " TARGET.EPOCALLOWDLLDATA = 1\n" + " addFiles.sources = " + fileName + ".dll\n" + " addFiles.path = !:/sys/bin\n" + " DEPLOYMENT += addFiles\n" + "}\n"; + } else if (libraryType == QtProjectParameters::Qt4Plugin) { + str << "\n" + "symbian {\n" + "# Load predefined include paths (e.g. QT_PLUGINS_BASE_DIR) to be used in the pro-files\n" + " load(data_caging_paths)\n" + " MMP_RULES += EXPORTUNFROZEN\n" + " TARGET.UID3 = " + symbianUid + "\n" + " TARGET.CAPABILITY = " + generateCapabilitySet(symbianCapabilities).toAscii() + "\n" + " TARGET.EPOCALLOWDLLDATA = 1\n" + " pluginDeploy.sources = " + fileName + ".dll\n" + " pluginDeploy.path = $$QT_PLUGINS_BASE_DIR/" + QDir::fromNativeSeparators(qtPluginDirectory) + "\n" + " DEPLOYMENT += pluginDeploy\n" + "}\n"; + } } void MobileLibraryParameters::writeMaemoProFile(QTextStream &str) const diff --git a/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.h b/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.h index 86ebf0d129f..7f31c059a72 100644 --- a/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.h +++ b/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.h @@ -84,6 +84,7 @@ public: QString fileName; QString symbianUid; + QString qtPluginDirectory; uint symbianCapabilities; }; diff --git a/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.cpp b/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.cpp index cbdc7e9834b..025df87280a 100644 --- a/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.cpp +++ b/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.cpp @@ -84,9 +84,27 @@ bool MobileLibraryWizardOptionPage::networkEnabled() const return m_d->ui.symbianEnableNetworkCheckBox->isChecked(); } +QString MobileLibraryWizardOptionPage::qtPluginDirectory() const +{ + return m_d->ui.qtPluginLocationLineEdit->text(); +} + +void MobileLibraryWizardOptionPage::setQtPluginDirectory(const QString &directory) +{ + m_d->ui.qtPluginLocationLineEdit->setText(directory); +} + void MobileLibraryWizardOptionPage::setLibraryType(int type) { m_d->libraryType = static_cast(type); + + if (type != QtProjectParameters::Qt4Plugin) { + m_d->ui.qtPluginLocationLineEdit->setVisible(false); + m_d->ui.qtPluginLocationLabel->setVisible(false); + m_d->ui.formLayout_2->removeItem(m_d->ui.horizontalLayout_2); + delete m_d->ui.horizontalLayout_2; + m_d->ui.horizontalLayout_2 = 0; + } } } // namespace Internal diff --git a/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.h b/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.h index 3315da01327..414f04f7f25 100644 --- a/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.h +++ b/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.h @@ -52,6 +52,8 @@ public: QString symbianUid() const; void setNetworkEnabled(bool enableIt); bool networkEnabled() const; + QString qtPluginDirectory() const; + void setQtPluginDirectory(const QString &directory); void setLibraryType(int type); private: diff --git a/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.ui b/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.ui index 6b49cd1d7b3..c42815fe0be 100644 --- a/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.ui +++ b/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.ui @@ -7,13 +7,13 @@ 0 0 404 - 548 + 130 WizardPage - + @@ -22,16 +22,9 @@ QFrame::Raised - + - - - - - Enable network access - - - + @@ -54,7 +47,7 @@ - + Qt::Horizontal @@ -68,24 +61,49 @@ + + + + Plugin's directory name: + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Enable network access + + + - - - - Qt::Vertical - - - - 20 - 40 - - - -