From d247c0e1e6ffaaafca2d6a25192defc30dd72267 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen <erik.verbruggen@nokia.com> Date: Tue, 8 Dec 2009 11:52:28 +0100 Subject: [PATCH] Namespace clean-ups. --- src/plugins/qmleditor/qmlcodecompletion.cpp | 2 +- src/plugins/qmleditor/qmlcodecompletion.h | 4 +-- src/plugins/qmleditor/qmleditor.cpp | 2 +- src/plugins/qmleditor/qmleditor.h | 6 ++-- src/plugins/qmleditor/qmleditorplugin.cpp | 4 +-- src/plugins/qmleditor/qmlhoverhandler.cpp | 2 +- src/plugins/qmleditor/qmllookupcontext.cpp | 1 - src/plugins/qmleditor/qmllookupcontext.h | 4 +-- .../qml/metatype/QmlMetaTypeBackend.cpp | 2 +- src/shared/qml/metatype/QmlMetaTypeBackend.h | 2 -- .../metatype/QtDeclarativeMetaTypeBackend.cpp | 31 +++++++++---------- .../metatype/QtDeclarativeMetaTypeBackend.h | 10 +++--- src/shared/qml/metatype/exception.cpp | 5 ++- src/shared/qml/metatype/exception.h | 5 ++- .../qml/metatype/invalidmetainfoexception.cpp | 4 +-- .../qml/metatype/invalidmetainfoexception.h | 2 +- src/shared/qml/metatype/metainfo.cpp | 7 ++--- src/shared/qml/metatype/metainfo.h | 12 +++---- src/shared/qml/metatype/nodemetainfo.cpp | 29 ++--------------- src/shared/qml/metatype/nodemetainfo.h | 12 +++---- src/shared/qml/metatype/propertymetainfo.cpp | 10 +++--- src/shared/qml/metatype/propertymetainfo.h | 12 +++---- src/shared/qml/metatype/qmltypesystem.cpp | 1 - src/shared/qml/metatype/qmltypesystem.h | 2 -- src/shared/qml/qml.pri | 8 ++--- 25 files changed, 66 insertions(+), 113 deletions(-) diff --git a/src/plugins/qmleditor/qmlcodecompletion.cpp b/src/plugins/qmleditor/qmlcodecompletion.cpp index 49bac438959..bd67c5c8b83 100644 --- a/src/plugins/qmleditor/qmlcodecompletion.cpp +++ b/src/plugins/qmleditor/qmlcodecompletion.cpp @@ -42,7 +42,7 @@ using namespace QmlEditor; using namespace QmlEditor::Internal; -QmlCodeCompletion::QmlCodeCompletion(QmlModelManagerInterface *modelManager, Qml::MetaType::QmlTypeSystem *typeSystem, QObject *parent) +QmlCodeCompletion::QmlCodeCompletion(QmlModelManagerInterface *modelManager, Qml::QmlTypeSystem *typeSystem, QObject *parent) : TextEditor::ICompletionCollector(parent), m_modelManager(modelManager), m_editor(0), diff --git a/src/plugins/qmleditor/qmlcodecompletion.h b/src/plugins/qmleditor/qmlcodecompletion.h index 0b8c8edfa88..e94df6eb265 100644 --- a/src/plugins/qmleditor/qmlcodecompletion.h +++ b/src/plugins/qmleditor/qmlcodecompletion.h @@ -19,7 +19,7 @@ class QmlCodeCompletion: public TextEditor::ICompletionCollector Q_OBJECT public: - QmlCodeCompletion(QmlModelManagerInterface *modelManager, Qml::MetaType::QmlTypeSystem *typeSystem, QObject *parent = 0); + QmlCodeCompletion(QmlModelManagerInterface *modelManager, Qml::QmlTypeSystem *typeSystem, QObject *parent = 0); virtual ~QmlCodeCompletion(); Qt::CaseSensitivity caseSensitivity() const; @@ -39,7 +39,7 @@ private: int m_startPosition; QList<TextEditor::CompletionItem> m_completions; Qt::CaseSensitivity m_caseSensitivity; - Qml::MetaType::QmlTypeSystem *m_typeSystem; + Qml::QmlTypeSystem *m_typeSystem; }; diff --git a/src/plugins/qmleditor/qmleditor.cpp b/src/plugins/qmleditor/qmleditor.cpp index 6cc759496a2..60cfbbc2e88 100644 --- a/src/plugins/qmleditor/qmleditor.cpp +++ b/src/plugins/qmleditor/qmleditor.cpp @@ -400,7 +400,7 @@ ScriptEditor::ScriptEditor(QWidget *parent) : baseTextDocument()->setSyntaxHighlighter(new QmlHighlighter); m_modelManager = ExtensionSystem::PluginManager::instance()->getObject<QmlModelManagerInterface>(); - m_typeSystem = ExtensionSystem::PluginManager::instance()->getObject<Qml::MetaType::QmlTypeSystem>(); + m_typeSystem = ExtensionSystem::PluginManager::instance()->getObject<Qml::QmlTypeSystem>(); if (m_modelManager) { connect(m_modelManager, SIGNAL(documentUpdated(QmlEditor::QmlDocument::Ptr)), diff --git a/src/plugins/qmleditor/qmleditor.h b/src/plugins/qmleditor/qmleditor.h index 6ad1c2c32c5..a29110039b3 100644 --- a/src/plugins/qmleditor/qmleditor.h +++ b/src/plugins/qmleditor/qmleditor.h @@ -44,9 +44,7 @@ class ICore; } namespace Qml { - namespace MetaType { - class QmlTypeSystem; - } + class QmlTypeSystem; } namespace QmlEditor { @@ -152,7 +150,7 @@ private: QList<QmlJS::DiagnosticMessage> m_diagnosticMessages; QmlDocument::Ptr m_document; QmlModelManagerInterface *m_modelManager; - Qml::MetaType::QmlTypeSystem *m_typeSystem; + Qml::QmlTypeSystem *m_typeSystem; }; } // namespace Internal diff --git a/src/plugins/qmleditor/qmleditorplugin.cpp b/src/plugins/qmleditor/qmleditorplugin.cpp index 3e1d032ee74..ae38bbc18f1 100644 --- a/src/plugins/qmleditor/qmleditorplugin.cpp +++ b/src/plugins/qmleditor/qmleditorplugin.cpp @@ -86,15 +86,13 @@ QmlEditorPlugin::~QmlEditorPlugin() bool QmlEditorPlugin::initialize(const QStringList & /*arguments*/, QString *error_message) { - typedef SharedTools::QScriptHighlighter QScriptHighlighter; - Core::ICore *core = Core::ICore::instance(); if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":/qmleditor/QmlEditor.mimetypes.xml"), error_message)) return false; m_modelManager = new QmlModelManager(this); addAutoReleasedObject(m_modelManager); - Qml::MetaType::QmlTypeSystem *typeSystem = new Qml::MetaType::QmlTypeSystem; + Qml::QmlTypeSystem *typeSystem = new Qml::QmlTypeSystem; addAutoReleasedObject(typeSystem); QList<int> context; diff --git a/src/plugins/qmleditor/qmlhoverhandler.cpp b/src/plugins/qmleditor/qmlhoverhandler.cpp index 4e045539739..1bbe5c09aa9 100644 --- a/src/plugins/qmleditor/qmlhoverhandler.cpp +++ b/src/plugins/qmleditor/qmlhoverhandler.cpp @@ -187,7 +187,7 @@ void QmlHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in QmlExpressionUnderCursor expressionUnderCursor; expressionUnderCursor(tc, doc); - Qml::MetaType::QmlTypeSystem *typeSystem = ExtensionSystem::PluginManager::instance()->getObject<Qml::MetaType::QmlTypeSystem>(); + Qml::QmlTypeSystem *typeSystem = ExtensionSystem::PluginManager::instance()->getObject<Qml::QmlTypeSystem>(); QmlLookupContext context(expressionUnderCursor.expressionScopes(), doc, m_modelManager->snapshot(), typeSystem); QmlResolveExpression resolver(context); diff --git a/src/plugins/qmleditor/qmllookupcontext.cpp b/src/plugins/qmleditor/qmllookupcontext.cpp index e4fc0336565..5720fb6515c 100644 --- a/src/plugins/qmleditor/qmllookupcontext.cpp +++ b/src/plugins/qmleditor/qmllookupcontext.cpp @@ -9,7 +9,6 @@ #include <QDebug> using namespace Qml; -using namespace Qml::MetaType; using namespace QmlEditor; using namespace QmlEditor::Internal; using namespace QmlJS; diff --git a/src/plugins/qmleditor/qmllookupcontext.h b/src/plugins/qmleditor/qmllookupcontext.h index e9708dc853e..3b88217f118 100644 --- a/src/plugins/qmleditor/qmllookupcontext.h +++ b/src/plugins/qmleditor/qmllookupcontext.h @@ -17,7 +17,7 @@ public: QmlLookupContext(const QStack<Qml::QmlSymbol *> &scopes, const QmlDocument::Ptr &doc, const Snapshot &snapshot, - Qml::MetaType::QmlTypeSystem *typeSystem); + Qml::QmlTypeSystem *typeSystem); Qml::QmlSymbol *resolve(const QString &name); Qml::QmlSymbol *resolveType(const QString &name) @@ -44,7 +44,7 @@ private: QStack<Qml::QmlSymbol *> _scopes; QmlDocument::Ptr _doc; Snapshot _snapshot; - Qml::MetaType::QmlTypeSystem *m_typeSystem; + Qml::QmlTypeSystem *m_typeSystem; }; } // namespace Internal diff --git a/src/shared/qml/metatype/QmlMetaTypeBackend.cpp b/src/shared/qml/metatype/QmlMetaTypeBackend.cpp index ec65714989b..f310bf9c787 100644 --- a/src/shared/qml/metatype/QmlMetaTypeBackend.cpp +++ b/src/shared/qml/metatype/QmlMetaTypeBackend.cpp @@ -1,7 +1,7 @@ #include "QmlMetaTypeBackend.h" #include "qmltypesystem.h" -using namespace Qml::MetaType; +using namespace Qml; QmlMetaTypeBackend::QmlMetaTypeBackend(QmlTypeSystem *typeSystem): m_typeSystem(typeSystem) diff --git a/src/shared/qml/metatype/QmlMetaTypeBackend.h b/src/shared/qml/metatype/QmlMetaTypeBackend.h index cd400bfa66a..bda3c2d8d2c 100644 --- a/src/shared/qml/metatype/QmlMetaTypeBackend.h +++ b/src/shared/qml/metatype/QmlMetaTypeBackend.h @@ -6,7 +6,6 @@ #include <qml/qmlsymbol.h> namespace Qml { -namespace MetaType { class QmlTypeSystem; @@ -27,7 +26,6 @@ private: QmlTypeSystem *m_typeSystem; }; -} // namespace MetaType } // namespace Qml #endif // QMLMETATYPEBACKEND_H diff --git a/src/shared/qml/metatype/QtDeclarativeMetaTypeBackend.cpp b/src/shared/qml/metatype/QtDeclarativeMetaTypeBackend.cpp index 53c1308b9ae..acb1374b3b5 100644 --- a/src/shared/qml/metatype/QtDeclarativeMetaTypeBackend.cpp +++ b/src/shared/qml/metatype/QtDeclarativeMetaTypeBackend.cpp @@ -4,7 +4,6 @@ #include <QDebug> namespace Qml { -namespace MetaType { namespace Internal { class QmlDeclarativeSymbol: public QmlBuildInSymbol @@ -31,7 +30,7 @@ class QmlDeclarativeObjectSymbol: public QmlDeclarativeSymbol QmlDeclarativeObjectSymbol &operator=(const QmlDeclarativeObjectSymbol &); public: - QmlDeclarativeObjectSymbol(const QKineticDesigner::NodeMetaInfo &metaInfo, QtDeclarativeMetaTypeBackend* backend): + QmlDeclarativeObjectSymbol(const NodeMetaInfo &metaInfo, QtDeclarativeMetaTypeBackend* backend): QmlDeclarativeSymbol(backend), m_metaInfo(metaInfo) { @@ -71,7 +70,7 @@ public: } public: - static QString key(const QKineticDesigner::NodeMetaInfo &metaInfo) + static QString key(const NodeMetaInfo &metaInfo) { return key(metaInfo.typeName(), metaInfo.majorVersion(), metaInfo.minorVersion()); } @@ -107,7 +106,7 @@ private: } private: - QKineticDesigner::NodeMetaInfo m_metaInfo; + NodeMetaInfo m_metaInfo; QString m_name; bool m_membersToBeDone; @@ -120,7 +119,7 @@ class QmlDeclarativePropertySymbol: public QmlDeclarativeSymbol QmlDeclarativePropertySymbol &operator=(const QmlDeclarativePropertySymbol &); public: - QmlDeclarativePropertySymbol(const QKineticDesigner::PropertyMetaInfo &metaInfo, QtDeclarativeMetaTypeBackend* backend): + QmlDeclarativePropertySymbol(const PropertyMetaInfo &metaInfo, QtDeclarativeMetaTypeBackend* backend): QmlDeclarativeSymbol(backend), m_metaInfo(metaInfo) { @@ -146,21 +145,19 @@ public: } private: - QKineticDesigner::PropertyMetaInfo m_metaInfo; + PropertyMetaInfo m_metaInfo; }; } // namespace Internal -} // namespace MetaType } // namespace Qml using namespace Qml; -using namespace Qml::MetaType; -using namespace Qml::MetaType::Internal; +using namespace Qml::Internal; QtDeclarativeMetaTypeBackend::QtDeclarativeMetaTypeBackend(QmlTypeSystem *typeSystem): QmlMetaTypeBackend(typeSystem) { - foreach (const QKineticDesigner::NodeMetaInfo &metaInfo, QKineticDesigner::MetaInfo::global().allTypes()) { + foreach (const NodeMetaInfo &metaInfo, MetaInfo::global().allTypes()) { m_symbols.insert(QmlDeclarativeObjectSymbol::key(metaInfo), new QmlDeclarativeObjectSymbol(metaInfo, this)); } } @@ -175,7 +172,7 @@ QList<QmlSymbol *> QtDeclarativeMetaTypeBackend::availableTypes(const QString &p QList<QmlSymbol *> result; const QString prefix = package + QLatin1Char('/'); - foreach (const QKineticDesigner::NodeMetaInfo &metaInfo, QKineticDesigner::MetaInfo::global().allTypes()) { + foreach (const NodeMetaInfo &metaInfo, MetaInfo::global().allTypes()) { if (metaInfo.typeName().startsWith(prefix) && metaInfo.majorVersion() == majorVersion && metaInfo.minorVersion() == minorVersion) result.append(getSymbol(metaInfo)); } @@ -195,36 +192,36 @@ QmlSymbol *QtDeclarativeMetaTypeBackend::resolve(const QString &typeName, const return 0; } -QList<QmlSymbol *> QtDeclarativeMetaTypeBackend::members(const QKineticDesigner::NodeMetaInfo &metaInfo) +QList<QmlSymbol *> QtDeclarativeMetaTypeBackend::members(const NodeMetaInfo &metaInfo) { QList<QmlSymbol *> result; - foreach (const QKineticDesigner::PropertyMetaInfo &propertyInfo, metaInfo.properties(false).values()) { + foreach (const PropertyMetaInfo &propertyInfo, metaInfo.properties(false).values()) { result.append(new QmlDeclarativePropertySymbol(propertyInfo, this)); } return result; } -QList<QmlSymbol *> QtDeclarativeMetaTypeBackend::inheritedMembers(const QKineticDesigner::NodeMetaInfo &metaInfo) +QList<QmlSymbol *> QtDeclarativeMetaTypeBackend::inheritedMembers(const NodeMetaInfo &metaInfo) { QList<QmlSymbol *> result; - foreach (const QKineticDesigner::NodeMetaInfo &superNode, metaInfo.directSuperClasses()) { + foreach (const NodeMetaInfo &superNode, metaInfo.directSuperClasses()) { result.append(getSymbol(superNode)->members(true)); } return result; } -QmlDeclarativeSymbol *QtDeclarativeMetaTypeBackend::typeOf(const QKineticDesigner::PropertyMetaInfo &metaInfo) +QmlDeclarativeSymbol *QtDeclarativeMetaTypeBackend::typeOf(const PropertyMetaInfo &metaInfo) { const QString key = QmlDeclarativeObjectSymbol::key(metaInfo.type(), metaInfo.typeMajorVersion(), metaInfo.typeMinorVersion()); return m_symbols.value(key, 0); } -QmlDeclarativeSymbol *QtDeclarativeMetaTypeBackend::getSymbol(const QKineticDesigner::NodeMetaInfo &metaInfo) +QmlDeclarativeSymbol *QtDeclarativeMetaTypeBackend::getSymbol(const NodeMetaInfo &metaInfo) { const QString key = QmlDeclarativeObjectSymbol::key(metaInfo); diff --git a/src/shared/qml/metatype/QtDeclarativeMetaTypeBackend.h b/src/shared/qml/metatype/QtDeclarativeMetaTypeBackend.h index e0693c124ce..32b5557d9ca 100644 --- a/src/shared/qml/metatype/QtDeclarativeMetaTypeBackend.h +++ b/src/shared/qml/metatype/QtDeclarativeMetaTypeBackend.h @@ -8,7 +8,6 @@ #include <QtCore/QList> namespace Qml { -namespace MetaType { namespace Internal { class QmlDeclarativeSymbol; @@ -29,19 +28,18 @@ public: virtual QmlSymbol *resolve(const QString &typeName, const QList<PackageInfo> &packages); protected: - QList<QmlSymbol *> members(const QKineticDesigner::NodeMetaInfo &metaInfo); - QList<QmlSymbol *> inheritedMembers(const QKineticDesigner::NodeMetaInfo &metaInfo); - QmlDeclarativeSymbol *typeOf(const QKineticDesigner::PropertyMetaInfo &metaInfo); + QList<QmlSymbol *> members(const Qml::NodeMetaInfo &metaInfo); + QList<QmlSymbol *> inheritedMembers(const Qml::NodeMetaInfo &metaInfo); + QmlDeclarativeSymbol *typeOf(const Qml::PropertyMetaInfo &metaInfo); private: - QmlDeclarativeSymbol *getSymbol(const QKineticDesigner::NodeMetaInfo &metaInfo); + QmlDeclarativeSymbol *getSymbol(const Qml::NodeMetaInfo &metaInfo); private: QMap<QString, QmlDeclarativeSymbol*> m_symbols; }; } // namespace Internal -} // namespace MetaType } // namespace Qml #endif // QTDECLARATIVEMETATYPEBACKEND_H diff --git a/src/shared/qml/metatype/exception.cpp b/src/shared/qml/metatype/exception.cpp index 1d836476e2c..c4a39e24d60 100644 --- a/src/shared/qml/metatype/exception.cpp +++ b/src/shared/qml/metatype/exception.cpp @@ -5,6 +5,7 @@ #include <cxxabi.h> #endif +#include <QDebug> #include <QRegExp> /*! @@ -18,8 +19,7 @@ the result would be a inconsistent model or a crash. */ - -namespace QKineticDesigner { +using namespace Qml; #ifdef Q_OS_LINUX const char* demangle(const char* name) @@ -160,4 +160,3 @@ QDebug operator<<(QDebug debug, const Exception &exception) \returns the type as a string */ -} diff --git a/src/shared/qml/metatype/exception.h b/src/shared/qml/metatype/exception.h index 093859db6bf..94ff3de30f2 100644 --- a/src/shared/qml/metatype/exception.h +++ b/src/shared/qml/metatype/exception.h @@ -4,9 +4,8 @@ #include <qml/qml_global.h> #include <QString> -#include <QtDebug> -namespace QKineticDesigner { +namespace Qml { class QML_EXPORT Exception { @@ -37,6 +36,6 @@ private: QML_EXPORT QDebug operator<<(QDebug debug, const Exception &exception); -} +} // namespace Qml #endif // EXCEPTION_H diff --git a/src/shared/qml/metatype/invalidmetainfoexception.cpp b/src/shared/qml/metatype/invalidmetainfoexception.cpp index a6caa45b5f9..a1267fa94a4 100644 --- a/src/shared/qml/metatype/invalidmetainfoexception.cpp +++ b/src/shared/qml/metatype/invalidmetainfoexception.cpp @@ -7,7 +7,7 @@ \see NodeMetaInfo PropertyMetaInfo MetaInfo */ -namespace QKineticDesigner { +using namespace Qml; /*! \brief Constructor @@ -31,5 +31,3 @@ QString InvalidMetaInfoException::type() const { return "InvalidMetaInfoException"; } - -} diff --git a/src/shared/qml/metatype/invalidmetainfoexception.h b/src/shared/qml/metatype/invalidmetainfoexception.h index 883616884a9..145dfd021f5 100644 --- a/src/shared/qml/metatype/invalidmetainfoexception.h +++ b/src/shared/qml/metatype/invalidmetainfoexception.h @@ -3,7 +3,7 @@ #include "exception.h" -namespace QKineticDesigner { +namespace Qml { class QML_EXPORT InvalidMetaInfoException : public Exception { diff --git a/src/shared/qml/metatype/metainfo.cpp b/src/shared/qml/metatype/metainfo.cpp index 356c6805b44..9252cf36bfd 100644 --- a/src/shared/qml/metatype/metainfo.cpp +++ b/src/shared/qml/metatype/metainfo.cpp @@ -2,6 +2,7 @@ #include "metainfo.h" #include "propertymetainfo.h" +#include <QDebug> #include <QPair> #include <QtAlgorithms> #include <QMetaProperty> @@ -11,7 +12,7 @@ enum { debug = false }; -namespace QKineticDesigner { +namespace Qml { namespace Internal { class MetaInfoPrivate @@ -68,8 +69,6 @@ void MetaInfoPrivate::initialize() m_isInitialized = true; } - - void MetaInfoPrivate::parseProperties(NodeMetaInfo &nodeMetaInfo, const QMetaObject *qMetaObject) const { Q_ASSERT_X(qMetaObject, Q_FUNC_INFO, "invalid QMetaObject"); @@ -219,7 +218,7 @@ void MetaInfoPrivate::parseNonQmlTypes() } // namespace Internal -using QKineticDesigner::Internal::MetaInfoPrivate; +using Qml::Internal::MetaInfoPrivate; MetaInfo MetaInfo::s_global; QStringList MetaInfo::s_pluginDirs; diff --git a/src/shared/qml/metatype/metainfo.h b/src/shared/qml/metatype/metainfo.h index 86a2447c7f5..9cca3a939bf 100644 --- a/src/shared/qml/metatype/metainfo.h +++ b/src/shared/qml/metatype/metainfo.h @@ -10,7 +10,7 @@ #include <QStringList> #include <QtCore/QSharedPointer> -namespace QKineticDesigner { +namespace Qml { class ModelNode; class AbstractProperty; @@ -27,10 +27,10 @@ QML_EXPORT bool operator!=(const MetaInfo &first, const MetaInfo &second); class QML_EXPORT MetaInfo { - friend class QKineticDesigner::Internal::MetaInfoPrivate; - friend class QKineticDesigner::Internal::MetaInfoParser; - friend class QKineticDesigner::NodeMetaInfo; - friend bool QKineticDesigner::operator==(const MetaInfo &, const MetaInfo &); + friend class Qml::Internal::MetaInfoPrivate; + friend class Qml::Internal::MetaInfoParser; + friend class Qml::NodeMetaInfo; + friend bool Qml::operator==(const MetaInfo &, const MetaInfo &); public: MetaInfo(const MetaInfo &metaInfo); @@ -78,6 +78,6 @@ private: static QStringList s_pluginDirs; }; -} //namespace QKineticDesigner +} // namespace Qml #endif // METAINFO_H diff --git a/src/shared/qml/metatype/nodemetainfo.cpp b/src/shared/qml/metatype/nodemetainfo.cpp index b3b136c076e..32baa146a23 100644 --- a/src/shared/qml/metatype/nodemetainfo.cpp +++ b/src/shared/qml/metatype/nodemetainfo.cpp @@ -12,8 +12,7 @@ #include <QtDeclarative/QmlComponent> #include <private/qmlvaluetype_p.h> -namespace QKineticDesigner { - +namespace Qml { namespace Internal { class NodeMetaInfoData : public QSharedData @@ -668,28 +667,4 @@ void NodeMetaInfo::setQmlFile(const QString &filePath) m_data->qmlFile = filePath; } -//QDataStream& operator<<(QDataStream& stream, const NodeMetaInfo& nodeMetaInfo) -//{ -// stream << nodeMetaInfo.typeName(); -// stream << nodeMetaInfo.majorVersion(); -// stream << nodeMetaInfo.minorVersionTo(); -// -// return stream; -//} -// -//QDataStream& operator>>(QDataStream& stream, NodeMetaInfo& nodeMetaInfo) -//{ -// QString typeName; -// int minorVersion; -// int majorVersion; -// -// stream >> minorVersion; -// stream >> majorVersion; -// stream >> typeName; -// -// nodeMetaInfo = MetaInfo::global().nodeMetaInfo(typeName/*, majorVersion ,minorVersion*/); -// -// return stream; -//} - -} // namespace QKineticDesigner +} // namespace Qml diff --git a/src/shared/qml/metatype/nodemetainfo.h b/src/shared/qml/metatype/nodemetainfo.h index 1d1215a90d3..51aa70a4b71 100644 --- a/src/shared/qml/metatype/nodemetainfo.h +++ b/src/shared/qml/metatype/nodemetainfo.h @@ -10,7 +10,7 @@ class QmlContext; -namespace QKineticDesigner { +namespace Qml { class MetaInfo; @@ -26,10 +26,10 @@ class PropertyMetaInfo; class QML_EXPORT NodeMetaInfo { - friend class QKineticDesigner::MetaInfo; - friend class QKineticDesigner::Internal::ItemLibraryInfoData; - friend class QKineticDesigner::Internal::MetaInfoPrivate; - friend class QKineticDesigner::Internal::MetaInfoParser; + friend class Qml::MetaInfo; + friend class Qml::Internal::ItemLibraryInfoData; + friend class Qml::Internal::MetaInfoPrivate; + friend class Qml::Internal::MetaInfoParser; friend QML_EXPORT uint qHash(const NodeMetaInfo &nodeMetaInfo); friend QML_EXPORT bool operator ==(const NodeMetaInfo &firstNodeInfo, const NodeMetaInfo &secondNodeInfo); @@ -98,6 +98,6 @@ private: QML_EXPORT uint qHash(const NodeMetaInfo &nodeMetaInfo); QML_EXPORT bool operator ==(const NodeMetaInfo &firstNodeInfo, const NodeMetaInfo &secondNodeInfo); -} +} // namespace Qml #endif // NODEMETAINFO_H diff --git a/src/shared/qml/metatype/propertymetainfo.cpp b/src/shared/qml/metatype/propertymetainfo.cpp index fae7fa49bef..931d0f8e527 100644 --- a/src/shared/qml/metatype/propertymetainfo.cpp +++ b/src/shared/qml/metatype/propertymetainfo.cpp @@ -6,10 +6,8 @@ #include "metainfo.h" #include <private/qmlvaluetype_p.h> -namespace QKineticDesigner { - -namespace Internal -{ +namespace Qml { +namespace Internal { class PropertyMetaInfoData : public QSharedData { @@ -42,7 +40,7 @@ public: QHash<QString, QVariant> defaultValueHash; }; -} +} // namespace Internal /*! \class QKineticDesigner::PropertyMetaInfo @@ -375,4 +373,4 @@ QVariant PropertyMetaInfo::castedValue(const QVariant &originalVariant) const } } -} +} // namespace Qml diff --git a/src/shared/qml/metatype/propertymetainfo.h b/src/shared/qml/metatype/propertymetainfo.h index d24b340b784..4fc0dcb2cdf 100644 --- a/src/shared/qml/metatype/propertymetainfo.h +++ b/src/shared/qml/metatype/propertymetainfo.h @@ -7,7 +7,7 @@ #include <QExplicitlySharedDataPointer> #include <QVariant> -namespace QKineticDesigner { +namespace Qml { class MetaInfo; class NodeMetaInfo; @@ -22,10 +22,10 @@ class PropertyMetaInfoData; class QML_EXPORT PropertyMetaInfo { - friend class QKineticDesigner::Internal::MetaInfoPrivate; - friend class QKineticDesigner::Internal::MetaInfoParser; - friend class QKineticDesigner::MetaInfo; - friend class QKineticDesigner::NodeMetaInfo; + friend class Qml::Internal::MetaInfoPrivate; + friend class Qml::Internal::MetaInfoParser; + friend class Qml::MetaInfo; + friend class Qml::NodeMetaInfo; public: PropertyMetaInfo(); ~PropertyMetaInfo(); @@ -78,7 +78,7 @@ private: QExplicitlySharedDataPointer<Internal::PropertyMetaInfoData> m_data; }; -} +} // namespace Qml #endif // PROPERTYMETAINFO_H diff --git a/src/shared/qml/metatype/qmltypesystem.cpp b/src/shared/qml/metatype/qmltypesystem.cpp index 4186151eacc..1f7278f5891 100644 --- a/src/shared/qml/metatype/qmltypesystem.cpp +++ b/src/shared/qml/metatype/qmltypesystem.cpp @@ -8,7 +8,6 @@ #include <QDebug> using namespace Qml; -using namespace Qml::MetaType; QmlTypeSystem::QmlTypeSystem() { diff --git a/src/shared/qml/metatype/qmltypesystem.h b/src/shared/qml/metatype/qmltypesystem.h index d12b1726867..c7558e35aed 100644 --- a/src/shared/qml/metatype/qmltypesystem.h +++ b/src/shared/qml/metatype/qmltypesystem.h @@ -9,7 +9,6 @@ #include <QtCore/QObject> namespace Qml { -namespace MetaType { class QmlMetaTypeBackend; @@ -28,7 +27,6 @@ private: QList<QmlMetaTypeBackend *> backends; }; -} // namespace MetaType } // namespace Qml #endif // QMLTYPESYSTEM_H diff --git a/src/shared/qml/qml.pri b/src/shared/qml/qml.pri index caafdd10ab2..fb6165a5bb6 100644 --- a/src/shared/qml/qml.pri +++ b/src/shared/qml/qml.pri @@ -9,6 +9,7 @@ HEADERS += \ $$PWD/qmldocument.h \ $$PWD/qmlpackageinfo.h \ $$PWD/qmlsymbol.h \ + $$PWD/metatype/exception.h \ $$PWD/metatype/QmlMetaTypeBackend.h \ $$PWD/metatype/qmltypesystem.h @@ -17,6 +18,7 @@ SOURCES += \ $$PWD/qmldocument.cpp \ $$PWD/qmlsymbol.cpp \ $$PWD/qmlpackageinfo.cpp \ + $$PWD/metatype/exception.cpp \ $$PWD/metatype/QmlMetaTypeBackend.cpp \ $$PWD/metatype/qmltypesystem.cpp @@ -30,14 +32,12 @@ contains(QT_CONFIG, declarative) { $$PWD/metatype/nodemetainfo.h \ $$PWD/metatype/propertymetainfo.h \ $$PWD/metatype/QtDeclarativeMetaTypeBackend.h \ - $$PWD/metatype/invalidmetainfoexception.h \ - $$PWD/metatype/exception.h + $$PWD/metatype/invalidmetainfoexception.h SOURCES += \ $$PWD/metatype/metainfo.cpp \ $$PWD/metatype/nodemetainfo.cpp \ $$PWD/metatype/propertymetainfo.cpp \ $$PWD/metatype/QtDeclarativeMetaTypeBackend.cpp \ - $$PWD/metatype/invalidmetainfoexception.cpp \ - $$PWD/metatype/exception.cpp + $$PWD/metatype/invalidmetainfoexception.cpp } -- GitLab