diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index d3d5425f60e..9987b9693ae 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -10777,337 +10777,119 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich - SimpleProEditor + QtModulesInfo - - Debug and Release - - - - - Debug specific - - - - - Release specific - - - - - All platforms - - - - - MS Windows specific - - - - - Linux/Unix specific - - - - - Mac OSX specific - - - - - Target Options - - - - - Type and name of the target. - - - - - Preprocessor Definitions - - - - - Setting of the preprocessor definitions. - - - - - Include path - - - - - Setting of the pathes where the header files are located. - - - - - Libraries - - - - - Defining the libraries to link the target against and the pathes where these are located. - - - - - Source Files - Quelldateien - - - - Header Files - - - - - Forms - - - - - Qt Modules - - - - - Setting up which of the Qt modules will be used in the target application. - - - - - Resource files - - - - - Target name - - - - - The name of the resulting target. - - - - - Configuration - - - - - Configuration. - - - - - Destination directory - - - - - Where the resulting target will be created. - - - - QtCore Module - Core non-GUI classes used by other modules - QtGui Module - Graphical user interface components - QtNetwork Module - Classes for network programming - QtOpenGL Module - OpenGL support classes - QtSql Module - Classes for database integration using SQL - QtScript Module - Classes for evaluating Qt Scripts - QtSvg Module - Classes for displaying the contents of SVG files - QtWebKit Module - Classes for displaying and editing Web content - QtXml Module - Classes for handling XML - QtXmlPatterns Module - An XQuery/XPath engine for XML and custom data models - Phonon Module - Multimedia framework classes - Qt3Support Module - Classes that ease porting from Qt 3 to Qt 4 - QtTest Module - Tool classes for unit testing - QtDBus module - Classes for Inter-Process Communication using the D-Bus - - - Application - - - - - Create a standalone application - - - - - Dynamic Library - - - - - Create a dynamic library for usage in other applications - - - - - Static Library - - - - - Create a static library for usage in other applications - - - - - Add Operator - - - - - Remove Operator - - - - - Replace Operator - - - - - Set Operator - - - - - Unique Add Operator - - Snippets::Internal::SnippetsPlugin diff --git a/share/qtcreator/translations/qtcreator_it.ts b/share/qtcreator/translations/qtcreator_it.ts index 9c335abd637..08daf84d4b6 100644 --- a/share/qtcreator/translations/qtcreator_it.ts +++ b/share/qtcreator/translations/qtcreator_it.ts @@ -10218,337 +10218,119 @@ Per eseguire la ricerca, scrivi questo prefisso, uno spazio e poi il termine da - SimpleProEditor + QtModulesInfo - - Debug and Release - Debug e Release - - - - Debug specific - Specifico del Debug - - - - Release specific - Specifico del Release - - - - All platforms - Tutte le piattaforme - - - - MS Windows specific - Specifico di MS Windows - - - - Linux/Unix specific - Specifico di Linux/Unix - - - - Mac OSX specific - Specifico di Max OSX - - - - Target Options - Opzioni Destinazione - - - - Type and name of the target. - Tipo e nome della destinazione. - - - - Preprocessor Definitions - Definizioni del Preprocessore - - - - Setting of the preprocessor definitions. - Impostazione delle definizioni del preprocessore. - - - - Include path - Percorso degli Include - - - - Setting of the pathes where the header files are located. - Impostazione dei percorsi dove si trovano i file header. - - - - Libraries - Librerie - - - - Defining the libraries to link the target against and the pathes where these are located. - Definizione delle librerie con cui linkare la destinazione a dei percorsi che le contengono. - - - - Source Files - File Sorgenti - - - - Header Files - File Header - - - - Forms - Form - - - - Qt Modules - Moduli Qt - - - - Setting up which of the Qt modules will be used in the target application. - Imposta quali moduli Qt saranno usati nell'applicazione di destinazione. - - - - Resource files - File delle Risorse - - - - Target name - Nome Destinazione - - - - The name of the resulting target. - Il nome della destinazione. - - - - Configuration - Configurazione - - - - Configuration. - Configurazione. - - - - Destination directory - Cartella di Destinazione - - - - Where the resulting target will be created. - La destinazione sarà creata qui dentro. - - - QtCore Module Modulo QtCore - Core non-GUI classes used by other modules Classi di Core, non-GUI, usate dagli altri moduli - QtGui Module Modulo QtGui - Graphical user interface components Componenti dell'interfaccia grafica - QtNetwork Module Modulo QtNetwork - Classes for network programming Classi per la programmazione della rete - QtOpenGL Module Modulo QtOpenGL - OpenGL support classes Classi per il supporto OpenGL - QtSql Module Modulo QtSql - Classes for database integration using SQL Classi per l'integrazione con database SQL - QtScript Module Modulo QtScript - Classes for evaluating Qt Scripts Classi per l'esecuzione di Qt Script - QtSvg Module Modulo QtSvg - Classes for displaying the contents of SVG files Classi per la visualizzazione del contenuto di file SVG - QtWebKit Module Modulo QtWebKit - Classes for displaying and editing Web content Classi per la visualizzazione e modifica del contenuto Web - QtXml Module Modulo QtXml - Classes for handling XML Classi per la gestione di XML - QtXmlPatterns Module Modulo QtXmlPatterns - An XQuery/XPath engine for XML and custom data models Un motore XQuery/XPath per XML e modelli di dati speciali - Phonon Module Modulo Phonon - Multimedia framework classes Classi del framework multimediale - Qt3Support Module Modulo Qt3Support - Classes that ease porting from Qt 3 to Qt 4 Classi che facilitano il porting da Qt 3 a Qt 4 - QtTest Module Modulo QtTest - Tool classes for unit testing Classi di ausilio per lo unit testing - QtDBus module Modulo QtDBus - Classes for Inter-Process Communication using the D-Bus Classi per la comunicazione-intra-processo usando il D-Bus - - - Application - Applicazione - - - - Create a standalone application - Crea un'applicazione - - - - Dynamic Library - Libreria Condivisa - - - - Create a dynamic library for usage in other applications - Crea una libreria condivisa per l'uso in altre applicazioni - - - - Static Library - Libreria Statica - - - - Create a static library for usage in other applications - Crea una libreria statica per l'uso in altre applicazioni - - - - Add Operator - Operatore di Aggiunta - - - - Remove Operator - Operatore di Rimozione - - - - Replace Operator - Operatore di Sostituzione - - - - Set Operator - Operatore di Assegnazione - - - - Unique Add Operator - Operatore di Aggiunta Unica - Snippets::Internal::SnippetsPlugin diff --git a/share/qtcreator/translations/qtcreator_ja.ts b/share/qtcreator/translations/qtcreator_ja.ts index 856539bf09f..1d8cf823d30 100644 --- a/share/qtcreator/translations/qtcreator_ja.ts +++ b/share/qtcreator/translations/qtcreator_ja.ts @@ -10000,337 +10000,119 @@ To do this you type this shortcut and a space in the QuickOpen entry field, and - SimpleProEditor + QtModulesInfo - - Debug and Release - - - - - Debug specific - - - - - Release specific - - - - - All platforms - - - - - MS Windows specific - - - - - Linux/Unix specific - - - - - Mac OSX specific - - - - - Target Options - - - - - Type and name of the target. - - - - - Preprocessor Definitions - - - - - Setting of the preprocessor definitions. - - - - - Include path - - - - - Setting of the pathes where the header files are located. - - - - - Libraries - - - - - Defining the libraries to link the target against and the pathes where these are located. - - - - - Source Files - - - - - Header Files - - - - - Forms - - - - - Qt Modules - - - - - Setting up which of the Qt modules will be used in the target application. - - - - - Resource files - - - - - Target name - - - - - The name of the resulting target. - - - - - Configuration - - - - - Configuration. - - - - - Destination directory - - - - - Where the resulting target will be created. - - - - QtCore Module - Core non-GUI classes used by other modules - QtGui Module - Graphical user interface components - QtNetwork Module - Classes for network programming - QtOpenGL Module - OpenGL support classes - QtSql Module - Classes for database integration using SQL - QtScript Module - Classes for evaluating Qt Scripts - QtSvg Module - Classes for displaying the contents of SVG files - QtWebKit Module - Classes for displaying and editing Web content - QtXml Module - Classes for handling XML - QtXmlPatterns Module - An XQuery/XPath engine for XML and custom data models - Phonon Module - Multimedia framework classes - Qt3Support Module - Classes that ease porting from Qt 3 to Qt 4 - QtTest Module - Tool classes for unit testing - QtDBus module - Classes for Inter-Process Communication using the D-Bus - - - Application - - - - - Create a standalone application - - - - - Dynamic Library - - - - - Create a dynamic library for usage in other applications - - - - - Static Library - - - - - Create a static library for usage in other applications - - - - - Add Operator - - - - - Remove Operator - - - - - Replace Operator - - - - - Set Operator - - - - - Unique Add Operator - - Snippets::Internal::SnippetsPlugin diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.pro b/src/plugins/qt4projectmanager/qt4projectmanager.pro index 6e9f4d0e503..4c14965077c 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.pro +++ b/src/plugins/qt4projectmanager/qt4projectmanager.pro @@ -31,7 +31,7 @@ HEADERS = qt4projectmanagerplugin.h \ deployhelper.h \ embeddedpropertiespage.h \ qt4runconfiguration.h \ - speinfo.h \ + qtmodulesinfo.h \ qt4projectconfigwidget.h \ qt4buildenvironmentwidget.h \ projectloadwizard.h \ @@ -64,7 +64,7 @@ SOURCES = qt4projectmanagerplugin.cpp \ deployhelper.cpp \ embeddedpropertiespage.cpp \ qt4runconfiguration.cpp \ - speinfo.cpp \ + qtmodulesinfo.cpp \ qt4projectconfigwidget.cpp \ qt4buildenvironmentwidget.cpp \ projectloadwizard.cpp \ diff --git a/src/plugins/qt4projectmanager/qtmodulesinfo.cpp b/src/plugins/qt4projectmanager/qtmodulesinfo.cpp new file mode 100644 index 00000000000..206fa60ca41 --- /dev/null +++ b/src/plugins/qt4projectmanager/qtmodulesinfo.cpp @@ -0,0 +1,160 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#include "qtmodulesinfo.h" +#include "qglobal.h" +#include +#include +#include +#include + +using namespace Qt4ProjectManager::Internal; + +struct item +{ + const char * const config; + const QString name; + const QString description; + bool isDefault; +}; + +typedef QVector itemVectorType; +typedef QHash itemHashType; + +const itemVectorType itemVector() +{ + static const struct item items[] = { + {"core", + QCoreApplication::translate("QtModulesInfo", "QtCore Module"), + QCoreApplication::translate("QtModulesInfo", "Core non-GUI classes used by other modules"), + true}, + {"gui", + QCoreApplication::translate("QtModulesInfo", "QtGui Module"), + QCoreApplication::translate("QtModulesInfo", "Graphical user interface components"), + true}, + {"network", + QCoreApplication::translate("QtModulesInfo", "QtNetwork Module"), + QCoreApplication::translate("QtModulesInfo", "Classes for network programming"), + false}, + {"opengl", + QCoreApplication::translate("QtModulesInfo", "QtOpenGL Module"), + QCoreApplication::translate("QtModulesInfo", "OpenGL support classes"), + false}, + {"sql", + QCoreApplication::translate("QtModulesInfo", "QtSql Module"), + QCoreApplication::translate("QtModulesInfo", "Classes for database integration using SQL"), + false}, + {"script", + QCoreApplication::translate("QtModulesInfo", "QtScript Module"), + QCoreApplication::translate("QtModulesInfo", "Classes for evaluating Qt Scripts"), + false}, + {"svg", + QCoreApplication::translate("QtModulesInfo", "QtSvg Module"), + QCoreApplication::translate("QtModulesInfo", "Classes for displaying the contents of SVG files"), + false}, + {"webkit", + QCoreApplication::translate("QtModulesInfo", "QtWebKit Module"), + QCoreApplication::translate("QtModulesInfo", "Classes for displaying and editing Web content"), + false}, + {"xml", + QCoreApplication::translate("QtModulesInfo", "QtXml Module"), + QCoreApplication::translate("QtModulesInfo", "Classes for handling XML"), + false}, + {"xmlpatterns", + QCoreApplication::translate("QtModulesInfo", "QtXmlPatterns Module"), + QCoreApplication::translate("QtModulesInfo", "An XQuery/XPath engine for XML and custom data models"), + false}, + {"phonon", + QCoreApplication::translate("QtModulesInfo", "Phonon Module"), + QCoreApplication::translate("QtModulesInfo", "Multimedia framework classes"), + false}, + {"qt3support", + QCoreApplication::translate("QtModulesInfo", "Qt3Support Module"), + QCoreApplication::translate("QtModulesInfo", "Classes that ease porting from Qt 3 to Qt 4"), + false}, + {"testlib", + QCoreApplication::translate("QtModulesInfo", "QtTest Module"), + QCoreApplication::translate("QtModulesInfo", "Tool classes for unit testing"), + false}, + {"dbus", + QCoreApplication::translate("QtModulesInfo", "QtDBus Module"), + QCoreApplication::translate("QtModulesInfo", "Classes for Inter-Process Communication using the D-Bus", + false)} + }; + const uint itemsCount = sizeof items / sizeof items[0]; + itemVectorType result; + result.reserve(itemsCount); + for (int i = 0; i < itemsCount; i++) + result.append(items + i); + return result; +} + +Q_GLOBAL_STATIC_WITH_INITIALIZER(itemVectorType, staticItemVector, { + *x = itemVector(); +}); + +Q_GLOBAL_STATIC_WITH_INITIALIZER(QStringList, staticModulesList, { + const itemVectorType * const itemVector = staticItemVector(); + for (int i = 0; i < itemVector->count(); i++) + x->append(QString::fromLatin1(itemVector->at(i)->config)); +}); + +Q_GLOBAL_STATIC_WITH_INITIALIZER(itemHashType, staticItemHash, { + const itemVectorType * const itemVector = staticItemVector(); + for (int i = 0; i < itemVector->count(); i++) + x->insert(QString::fromLatin1(itemVector->at(i)->config), itemVector->at(i)); +}); + +QStringList QtModulesInfo::modules() +{ + return *staticModulesList(); +} + +static inline const item *itemForModule(const QString &module) +{ + return staticItemHash()->value(module.toLatin1().data()); +} + +QString QtModulesInfo::moduleName(const QString &module) +{ + const item * const i = itemForModule(module); + return i?i->name:QString(); +} + +QString QtModulesInfo::moduleDescription(const QString &module) +{ + const item * const i = itemForModule(module); + return i?i->description:QString(); +} + +bool QtModulesInfo::moduleIsDefault(const QString &module) +{ + const item * const i = itemForModule(module); + return i?i->isDefault:false; +} diff --git a/src/plugins/qt4projectmanager/qtmodulesinfo.h b/src/plugins/qt4projectmanager/qtmodulesinfo.h new file mode 100644 index 00000000000..f4cc37f9a54 --- /dev/null +++ b/src/plugins/qt4projectmanager/qtmodulesinfo.h @@ -0,0 +1,49 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ +#ifndef QTMODULESINFO_H +#define QTMODULESINFO_H + +#include + +namespace Qt4ProjectManager { +namespace Internal { + +class QtModulesInfo +{ +public: + static QStringList modules(); + static QString moduleName(const QString &module); + static QString moduleDescription(const QString &module); + static bool moduleIsDefault(const QString &module); +}; + +} // namespace Internal +} // namespace Qt4ProjectManager + +#endif // QTMODULESINFO_H diff --git a/src/plugins/qt4projectmanager/speinfo.cpp b/src/plugins/qt4projectmanager/speinfo.cpp deleted file mode 100644 index 5dc02d1a0e7..00000000000 --- a/src/plugins/qt4projectmanager/speinfo.cpp +++ /dev/null @@ -1,362 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Qt Software Information (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** -**************************************************************************/ - -#include "speinfo.h" - -#include -#include -#include - -using namespace Qt4ProjectManager::Internal; - -bool SPEInfo::m_listsInitialized = false; -QList SPEInfo::m_qtmoduleList; - -QHash ,SPEInfoItem*> SPEInfo::m_itemHash; - -const QString SPEInfoItem::keyType("valuetype"); -const QString SPEInfoItem::valueFile("file"); -const QString SPEInfoItem::valuePath("path"); -const QString SPEInfoItem::keyIncludedByDefault("includedbydefault"); -const QString SPEInfoItem::keyImageFileName("imagefilename"); - -class InfoItemModulesCore : public SPEInfoItem -{ -public: - InfoItemModulesCore(): SPEInfoItem("core", QtModule) - { - m_data.insert(keyIncludedByDefault, true); - } - - QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtCore Module"); } - QString description() const - { - return QCoreApplication::translate("SimpleProEditor", - "Core non-GUI classes used by other modules"); - } -}; - -class InfoItemModulesGui : public SPEInfoItem -{ -public: - InfoItemModulesGui(): SPEInfoItem("gui", QtModule) - { - m_data.insert(keyIncludedByDefault, true); - } - - QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtGui Module"); } - QString description() const - { - return QCoreApplication::translate("SimpleProEditor", - "Graphical user interface components"); - } -}; - -class InfoItemModulesNetwork : public SPEInfoItem -{ -public: - InfoItemModulesNetwork(): SPEInfoItem("network", QtModule) - { - m_data.insert(keyIncludedByDefault, false); - } - - QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtNetwork Module"); } - QString description() const - { - return QCoreApplication::translate("SimpleProEditor", - "Classes for network programming"); - } -}; - -class InfoItemModulesOpenGL : public SPEInfoItem -{ -public: - InfoItemModulesOpenGL(): SPEInfoItem("opengl", QtModule) - { - m_data.insert(keyIncludedByDefault, false); - } - - QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtOpenGL Module"); } - QString description() const - { - return QCoreApplication::translate("SimpleProEditor", - "OpenGL support classes"); - } -}; - -class InfoItemModulesSql : public SPEInfoItem -{ -public: - InfoItemModulesSql(): SPEInfoItem("sql", QtModule) - { - m_data.insert(keyIncludedByDefault, false); - } - - QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtSql Module"); } - QString description() const - { - return QCoreApplication::translate("SimpleProEditor", - "Classes for database integration using SQL"); - } -}; - -class InfoItemModulesScript : public SPEInfoItem -{ -public: - InfoItemModulesScript(): SPEInfoItem("script", QtModule) - { - m_data.insert(keyIncludedByDefault, false); - } - - QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtScript Module"); } - QString description() const - { - return QCoreApplication::translate("SimpleProEditor", - "Classes for evaluating Qt Scripts"); - } -}; - -class InfoItemModulesSvg : public SPEInfoItem -{ -public: - InfoItemModulesSvg(): SPEInfoItem("svg", QtModule) - { - m_data.insert(keyIncludedByDefault, false); - } - - QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtSvg Module"); } - QString description() const - { - return QCoreApplication::translate("SimpleProEditor", - "Classes for displaying the contents of SVG files"); - } -}; - -class InfoItemModulesWebKit : public SPEInfoItem -{ -public: - InfoItemModulesWebKit(): SPEInfoItem("webkit", QtModule) - { - m_data.insert(keyIncludedByDefault, false); - } - - QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtWebKit Module"); } - QString description() const - { - return QCoreApplication::translate("SimpleProEditor", - "Classes for displaying and editing Web content"); - } -}; - -class InfoItemModulesXml : public SPEInfoItem -{ -public: - InfoItemModulesXml(): SPEInfoItem("xml", QtModule) - { - m_data.insert(keyIncludedByDefault, false); - } - - QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtXml Module"); } - QString description() const - { - return QCoreApplication::translate("SimpleProEditor", - "Classes for handling XML"); - } -}; - -class InfoItemModulesXmlPatterns : public SPEInfoItem -{ -public: - InfoItemModulesXmlPatterns(): SPEInfoItem("xmlpatterns", QtModule) - { - m_data.insert(keyIncludedByDefault, false); - } - - QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtXmlPatterns Module"); } - QString description() const - { - return QCoreApplication::translate("SimpleProEditor", - "An XQuery/XPath engine for XML and custom data models"); - } -}; - -class InfoItemModulesPhonon : public SPEInfoItem -{ -public: - InfoItemModulesPhonon(): SPEInfoItem("phonon", QtModule) - { - m_data.insert(keyIncludedByDefault, false); - } - - QString name() const { return QCoreApplication::translate("SimpleProEditor", "Phonon Module"); } - QString description() const - { - return QCoreApplication::translate("SimpleProEditor", - "Multimedia framework classes"); - } -}; - -class InfoItemModulesQt3Support : public SPEInfoItem -{ -public: - InfoItemModulesQt3Support(): SPEInfoItem("qt3support", QtModule) - { - m_data.insert(keyIncludedByDefault, false); - } - - QString name() const { return QCoreApplication::translate("SimpleProEditor", "Qt3Support Module"); } - QString description() const - { - return QCoreApplication::translate("SimpleProEditor", - "Classes that ease porting from Qt 3 to Qt 4"); - } -}; - -class InfoItemModulesTest : public SPEInfoItem -{ -public: - InfoItemModulesTest(): SPEInfoItem("testlib", QtModule) - { - m_data.insert(keyIncludedByDefault, false); - } - - QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtTest Module"); } - QString description() const - { - return QCoreApplication::translate("SimpleProEditor", - "Tool classes for unit testing"); - } -}; - -class InfoItemModulesDBus : public SPEInfoItem -{ -public: - InfoItemModulesDBus(): SPEInfoItem("dbus", QtModule) - { - m_data.insert(keyIncludedByDefault, false); - } - - QString name() const { return QCoreApplication::translate("SimpleProEditor", "QtDBus module"); } - QString description() const - { - return QCoreApplication::translate("SimpleProEditor", - "Classes for Inter-Process Communication using the D-Bus"); - } -}; - -SPEInfoItem::SPEInfoItem(const QString &id, InfoKind kind) -: m_id(id) -, m_infoKind(kind) -, m_parentItem(0) -{ -} - -QString SPEInfoItem::name() const -{ - return ""; -} - -QString SPEInfoItem::description() const -{ - return ""; -} - -QVariant SPEInfoItem::data(const QString &key) const -{ - return m_data.value(key); -} - -QString SPEInfoItem::id() const -{ - return m_id; -} - -SPEInfoItem::InfoKind SPEInfoItem::infoKind() const -{ - return m_infoKind; -} - -SPEInfo::~SPEInfo() -{ - deleteLists(); -} - -const QList *SPEInfo::qtModulesList() -{ - if (!m_listsInitialized) - initializeLists(); - return &m_qtmoduleList; -} - -void SPEInfo::addListToHash(const QList &list) -{ - foreach (SPEInfoItem *item, list) - m_itemHash.insert(qMakePair(item->infoKind(), item->id()), item); -} - -void SPEInfo::initializeLists() -{ - m_qtmoduleList - << new InfoItemModulesCore - << new InfoItemModulesGui - << new InfoItemModulesNetwork - << new InfoItemModulesOpenGL - << new InfoItemModulesScript - << new InfoItemModulesSql - << new InfoItemModulesSvg - << new InfoItemModulesWebKit - << new InfoItemModulesXml - << new InfoItemModulesXmlPatterns - << new InfoItemModulesPhonon - << new InfoItemModulesQt3Support - << new InfoItemModulesTest - << new InfoItemModulesDBus; - addListToHash(m_qtmoduleList); - - m_listsInitialized = true; -} - -void SPEInfo::deleteLists() -{ - m_itemHash.clear(); - - qDeleteAll(m_qtmoduleList); - m_qtmoduleList.clear(); - - m_listsInitialized = false; -} - -const SPEInfoItem *SPEInfo::infoOfKindForId(SPEInfoItem::InfoKind kind, - const QString &id, const SPEInfoItem *defaultInfoItem) -{ - QPair keyPair = qMakePair(kind, id); - return m_itemHash.contains(keyPair)?m_itemHash.value(keyPair):defaultInfoItem; -} - -static SPEInfo speInfoInstance; // it's destructor will call deleteLists() diff --git a/src/plugins/qt4projectmanager/speinfo.h b/src/plugins/qt4projectmanager/speinfo.h deleted file mode 100644 index b287697ef2e..00000000000 --- a/src/plugins/qt4projectmanager/speinfo.h +++ /dev/null @@ -1,96 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Qt Software Information (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** -**************************************************************************/ - -#ifndef SIMPLEPROEDITORINFO_H -#define SIMPLEPROEDITORINFO_H - -#include -#include -#include - -namespace Qt4ProjectManager { -namespace Internal { - -class SPEInfoItem -{ -public: - enum InfoKind { - QtModule - }; - - SPEInfoItem(const QString &id, InfoKind kind); - virtual ~SPEInfoItem() {} - - QString id() const; - InfoKind infoKind() const; - virtual QString name() const; - virtual QString description() const; - QVariant data(const QString &key) const; - - static const QString keyType; - static const QString valueFile; - static const QString valuePath; - static const QString keyIncludedByDefault; - static const QString keyImageFileName; - -protected: - QHash m_data; - -private: - QString m_id; - InfoKind m_infoKind; - QPixmap m_image; - const class SPEInfoItem *m_parentItem; -}; - -class SPEInfo -{ -public: - ~SPEInfo(); - - static const QList *qtModulesList(); - static const SPEInfoItem *infoOfKindForId(SPEInfoItem::InfoKind kind, - const QString &id, const SPEInfoItem *defaultInfoItem = NULL); - -private: - static void addListToHash(const QList &list); - static void initializeLists(); - static void deleteLists(); - - static QList m_qtmoduleList; - - static QHash ,SPEInfoItem* > m_itemHash; - - static bool m_listsInitialized; -}; - -} // namespace Internal -} // namespace Qt4ProjectManager - -#endif // SIMPLEPROEDITORINFO_H diff --git a/src/plugins/qt4projectmanager/wizards/modulespage.cpp b/src/plugins/qt4projectmanager/wizards/modulespage.cpp index 6a517c84e9a..639f6c6d7f0 100644 --- a/src/plugins/qt4projectmanager/wizards/modulespage.cpp +++ b/src/plugins/qt4projectmanager/wizards/modulespage.cpp @@ -29,11 +29,12 @@ #include "modulespage.h" -#include "speinfo.h" +#include "qtmodulesinfo.h" #include #include +#include #include #include @@ -58,19 +59,19 @@ ModulesPage::ModulesPage(QWidget *parent) QGridLayout *layout = new QGridLayout; - const QList infoItemsList = *SPEInfo::qtModulesList(); - int itemId = 0; - int rowsCount = (infoItemsList.count() + 1) / 2; - foreach (const SPEInfoItem *infoItem, infoItemsList) { - QCheckBox *moduleCheckBox = new QCheckBox(infoItem->name()); - moduleCheckBox->setToolTip(infoItem->description()); - moduleCheckBox->setWhatsThis(infoItem->description()); - registerField(infoItem->id(), moduleCheckBox); - int row = itemId % rowsCount; - int column = itemId / rowsCount; + const QStringList &modulesList = QtModulesInfo::modules(); + int moduleId = 0; + int rowsCount = (modulesList.count() + 1) / 2; + foreach (const QString &module, modulesList) { + QCheckBox *moduleCheckBox = new QCheckBox(QtModulesInfo::moduleName(module)); + moduleCheckBox->setToolTip(QtModulesInfo::moduleDescription(module)); + moduleCheckBox->setWhatsThis(QtModulesInfo::moduleDescription(module)); + registerField(module, moduleCheckBox); + int row = moduleId % rowsCount; + int column = moduleId / rowsCount; layout->addWidget(moduleCheckBox, row, column); - m_moduleCheckBoxMap[infoItem->id()] = moduleCheckBox; - itemId++; + m_moduleCheckBoxMap[module] = moduleCheckBox; + moduleId++; } vlayout->addLayout(layout); @@ -80,10 +81,10 @@ ModulesPage::ModulesPage(QWidget *parent) // Return the key that goes into the Qt config line for a module QString ModulesPage::idOfModule(const QString &module) { - const QList infoItemsList = *SPEInfo::qtModulesList(); - foreach (const SPEInfoItem *infoItem, infoItemsList) - if (infoItem->name().startsWith(module)) - return infoItem->id(); + const QStringList &moduleIdList = QtModulesInfo::modules(); + foreach (const QString &id, moduleIdList) + if (QtModulesInfo::moduleName(id).startsWith(module)) + return id; return QString(); } @@ -114,13 +115,10 @@ void ModulesPage::setModuleEnabled(const QString &module, bool enabled) const QString ModulesPage::modules(bool selected) const { QStringList modules; - - const QList infoItemsList = *SPEInfo::qtModulesList(); - foreach (const SPEInfoItem *infoItem, infoItemsList) { - if (selected != infoItem->data(SPEInfoItem::keyIncludedByDefault).toBool() - && selected == field(infoItem->id()).toBool()) - modules << infoItem->id(); + foreach (const QString &module, QtModulesInfo::modules()) { + if (selected != QtModulesInfo::moduleIsDefault(module) + && selected == field(module).toBool()) + modules << module; } - return modules.join(QString(QLatin1Char(' '))); }