Commit d247c0e1 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Namespace clean-ups.

parent 96e5cae4
......@@ -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),
......
......@@ -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;
};
......
......@@ -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)),
......
......@@ -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
......
......@@ -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;
......
......@@ -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);
......
......@@ -9,7 +9,6 @@
#include <QDebug>
using namespace Qml;
using namespace Qml::MetaType;
using namespace QmlEditor;
using namespace QmlEditor::Internal;
using namespace QmlJS;
......
......@@ -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
......
#include "QmlMetaTypeBackend.h"
#include "qmltypesystem.h"
using namespace Qml::MetaType;
using namespace Qml;
QmlMetaTypeBackend::QmlMetaTypeBackend(QmlTypeSystem *typeSystem):
m_typeSystem(typeSystem)
......
......@@ -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
......@@ -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);
......
......@@ -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
......@@ -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
*/
}
......@@ -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
......@@ -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";
}
}
......@@ -3,7 +3,7 @@
#include "exception.h"
namespace QKineticDesigner {
namespace Qml {
class QML_EXPORT InvalidMetaInfoException : public Exception
{
......
......@@ -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;
......
......@@ -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
......@@ -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
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment