Prevent symbol clashes for qml classes

Fix namespace usage such that all classes in shared/qml live in the
Qml namespace, and classes in QmlDesigner plugin in the QmlDesigner
namespace.

This should prevent any symbol clashes until we can finally get rid
of the file dublicates (e.g. QmlDocument).
This commit is contained in:
Kai Koehne
2010-01-14 16:22:43 +01:00
parent f808377344
commit 33ec15b9ab
64 changed files with 150 additions and 146 deletions

View File

@@ -32,8 +32,8 @@
#include "addarraymembervisitor.h" #include "addarraymembervisitor.h"
using namespace QmlEditor; using namespace QmlDesigner;
using namespace QmlEditor::Internal; using namespace QmlDesigner::Internal;
using namespace QmlJS; using namespace QmlJS;
using namespace QmlJS::AST; using namespace QmlJS::AST;

View File

@@ -32,7 +32,7 @@
#include "qmlrewriter.h" #include "qmlrewriter.h"
namespace QmlEditor { namespace QmlDesigner {
namespace Internal { namespace Internal {
class AddArrayMemberVisitor: public QMLRewriter class AddArrayMemberVisitor: public QMLRewriter
@@ -67,6 +67,6 @@ private:
}; };
} // namespace Internal } // namespace Internal
} // namespace QmlEditor } // namespace QmlDesigner
#endif // ADDARRAYMEMBERVISITOR_H #endif // ADDARRAYMEMBERVISITOR_H

View File

@@ -32,8 +32,8 @@
#include "addobjectvisitor.h" #include "addobjectvisitor.h"
using namespace QmlEditor; using namespace QmlDesigner;
using namespace QmlEditor::Internal; using namespace QmlDesigner::Internal;
using namespace QmlJS; using namespace QmlJS;
using namespace QmlJS::AST; using namespace QmlJS::AST;

View File

@@ -32,7 +32,7 @@
#include "qmlrewriter.h" #include "qmlrewriter.h"
namespace QmlEditor { namespace QmlDesigner {
namespace Internal { namespace Internal {
class AddObjectVisitor: public QMLRewriter class AddObjectVisitor: public QMLRewriter
@@ -57,6 +57,6 @@ private:
}; };
} // namespace Internal } // namespace Internal
} // namespace QmlEditor } // namespace QmlDesigner
#endif // ADDOBJECTVISITOR_H #endif // ADDOBJECTVISITOR_H

View File

@@ -32,8 +32,8 @@
#include "addpropertyvisitor.h" #include "addpropertyvisitor.h"
using namespace QmlEditor; using namespace QmlDesigner;
using namespace QmlEditor::Internal; using namespace QmlDesigner::Internal;
using namespace QmlJS; using namespace QmlJS;
using namespace QmlJS::AST; using namespace QmlJS::AST;

View File

@@ -33,7 +33,7 @@
#include "qmlrefactoring.h" #include "qmlrefactoring.h"
#include "qmlrewriter.h" #include "qmlrewriter.h"
namespace QmlEditor { namespace QmlDesigner {
namespace Internal { namespace Internal {
class AddPropertyVisitor: public QMLRewriter class AddPropertyVisitor: public QMLRewriter
@@ -44,7 +44,7 @@ public:
quint32 parentLocation, quint32 parentLocation,
const QString &name, const QString &name,
const QString &value, const QString &value,
QmlEditor::QmlRefactoring::PropertyType propertyType, QmlDesigner::QmlRefactoring::PropertyType propertyType,
const QStringList &propertyOrder); const QStringList &propertyOrder);
protected: protected:
@@ -58,11 +58,11 @@ private:
quint32 m_parentLocation; quint32 m_parentLocation;
QString m_name; QString m_name;
QString m_value; QString m_value;
QmlEditor::QmlRefactoring::PropertyType m_propertyType; QmlDesigner::QmlRefactoring::PropertyType m_propertyType;
QStringList m_propertyOrder; QStringList m_propertyOrder;
}; };
} // namespace Internal } // namespace Internal
} // namespace QmlEditor } // namespace QmlDesigner
#endif // ADDPROPERTYVISITOR_H #endif // ADDPROPERTYVISITOR_H

View File

@@ -30,7 +30,7 @@
#include "astobjecttextextractor.h" #include "astobjecttextextractor.h"
#include "qmljsast_p.h" #include "qmljsast_p.h"
using namespace QmlEditor; using namespace QmlDesigner;
using namespace QmlJS::AST; using namespace QmlJS::AST;
ASTObjectTextExtractor::ASTObjectTextExtractor(const QString &text): ASTObjectTextExtractor::ASTObjectTextExtractor(const QString &text):

View File

@@ -35,7 +35,7 @@
#include "qmldocument.h" #include "qmldocument.h"
#include "qmljsastvisitor_p.h" #include "qmljsastvisitor_p.h"
namespace QmlEditor { namespace QmlDesigner {
class ASTObjectTextExtractor: public QmlJS::AST::Visitor class ASTObjectTextExtractor: public QmlJS::AST::Visitor
{ {
@@ -54,6 +54,6 @@ private:
QString m_text; QString m_text;
}; };
} // namespace QmlEditor } // namespace QmlDesigner
#endif // ASTOBJECTTEXTEXTRACTOR_H #endif // ASTOBJECTTEXTEXTRACTOR_H

View File

@@ -37,7 +37,7 @@ using namespace QmlJS::AST;
using namespace QmlDesigner; using namespace QmlDesigner;
using namespace QmlDesigner::Internal; using namespace QmlDesigner::Internal;
using namespace QmlEditor::Internal; using namespace QmlDesigner::Internal;
ChangeImportsVisitor::ChangeImportsVisitor(TextModifier &textModifier, const QSet<Import> &addedImports, const QSet<Import> &removedImports, const QString &source): ChangeImportsVisitor::ChangeImportsVisitor(TextModifier &textModifier, const QSet<Import> &addedImports, const QSet<Import> &removedImports, const QString &source):
QMLRewriter(textModifier), QMLRewriter(textModifier),

View File

@@ -36,7 +36,7 @@
#include "import.h" #include "import.h"
#include "qmlrewriter.h" #include "qmlrewriter.h"
namespace QmlEditor { namespace QmlDesigner {
namespace Internal { namespace Internal {
class ChangeImportsVisitor: public QMLRewriter, protected QmlDesigner::Internal::CopyPasteUtil class ChangeImportsVisitor: public QMLRewriter, protected QmlDesigner::Internal::CopyPasteUtil
@@ -56,6 +56,6 @@ private:
}; };
} // namespace Internal } // namespace Internal
} // namespace QmlEditor } // namespace QmlDesigner
#endif // CHANGEIMPORTSVISITOR_H #endif // CHANGEIMPORTSVISITOR_H

View File

@@ -33,7 +33,7 @@
using namespace QmlJS; using namespace QmlJS;
using namespace QmlJS::AST; using namespace QmlJS::AST;
using namespace QmlEditor::Internal; using namespace QmlDesigner::Internal;
ChangeObjectTypeVisitor::ChangeObjectTypeVisitor(QmlDesigner::TextModifier &modifier, ChangeObjectTypeVisitor::ChangeObjectTypeVisitor(QmlDesigner::TextModifier &modifier,
quint32 nodeLocation, quint32 nodeLocation,

View File

@@ -32,7 +32,7 @@
#include "qmlrewriter.h" #include "qmlrewriter.h"
namespace QmlEditor { namespace QmlDesigner {
namespace Internal { namespace Internal {
class ChangeObjectTypeVisitor: public QMLRewriter class ChangeObjectTypeVisitor: public QMLRewriter
@@ -55,6 +55,6 @@ private:
}; };
} // namespace Internal } // namespace Internal
} // namespace QmlEditor } // namespace QmlDesigner
#endif // CHANGEOBJECTTYPEVISITOR_H #endif // CHANGEOBJECTTYPEVISITOR_H

View File

@@ -34,8 +34,8 @@
using namespace QmlJS; using namespace QmlJS;
using namespace QmlJS::AST; using namespace QmlJS::AST;
using namespace QmlEditor; using namespace QmlDesigner;
using namespace QmlEditor::Internal; using namespace QmlDesigner::Internal;
ChangePropertyVisitor::ChangePropertyVisitor(QmlDesigner::TextModifier &modifier, ChangePropertyVisitor::ChangePropertyVisitor(QmlDesigner::TextModifier &modifier,
quint32 parentLocation, quint32 parentLocation,

View File

@@ -33,7 +33,7 @@
#include "qmlrefactoring.h" #include "qmlrefactoring.h"
#include "qmlrewriter.h" #include "qmlrewriter.h"
namespace QmlEditor { namespace QmlDesigner {
namespace Internal { namespace Internal {
class ChangePropertyVisitor: public QMLRewriter class ChangePropertyVisitor: public QMLRewriter
@@ -65,6 +65,6 @@ private:
}; };
} // namespace Internal } // namespace Internal
} // namespace QmlEditor } // namespace QmlDesigner
#endif // CHANGEPROPERTYVISITOR_H #endif // CHANGEPROPERTYVISITOR_H

View File

@@ -32,7 +32,7 @@
#include <qmljsast_p.h> #include <qmljsast_p.h>
using namespace QmlDesigner; using namespace QmlDesigner;
using namespace QmlEditor; using namespace QmlDesigner;
using namespace QmlJS::AST; using namespace QmlJS::AST;
FirstDefinitionFinder::FirstDefinitionFinder(const QString &text): FirstDefinitionFinder::FirstDefinitionFinder(const QString &text):

View File

@@ -52,7 +52,7 @@ protected:
void extractFirstObjectDefinition(QmlJS::AST::UiObjectInitializer* ast); void extractFirstObjectDefinition(QmlJS::AST::UiObjectInitializer* ast);
private: private:
QmlEditor::QmlDocument::Ptr m_doc; QmlDesigner::QmlDocument::Ptr m_doc;
quint32 m_offset; quint32 m_offset;
QmlJS::AST::UiObjectDefinition *m_firstObjectDefinition; QmlJS::AST::UiObjectDefinition *m_firstObjectDefinition;

View File

@@ -33,8 +33,8 @@
using namespace QmlJS; using namespace QmlJS;
using namespace QmlJS::AST; using namespace QmlJS::AST;
using namespace QmlEditor; using namespace QmlDesigner;
using namespace QmlEditor::Internal; using namespace QmlDesigner::Internal;
QMap<QString, QmlIdSymbol*> IdCollector::operator()(const QString &fileName, QmlJS::AST::UiProgram *ast) QMap<QString, QmlIdSymbol*> IdCollector::operator()(const QString &fileName, QmlJS::AST::UiProgram *ast)
{ {

View File

@@ -38,7 +38,7 @@
#include "qmljsastvisitor_p.h" #include "qmljsastvisitor_p.h"
#include "qmlsymbol.h" #include "qmlsymbol.h"
namespace QmlEditor { namespace QmlDesigner {
namespace Internal { namespace Internal {
class IdCollector: protected QmlJS::AST::Visitor class IdCollector: protected QmlJS::AST::Visitor
@@ -64,6 +64,6 @@ private:
}; };
} // namespace Internal } // namespace Internal
} // namespace QmlEditor } // namespace QmlDesigner
#endif // IDCOLLECTOR_H #endif // IDCOLLECTOR_H

View File

@@ -29,7 +29,7 @@
#include "indenter.h" #include "indenter.h"
using namespace QmlEditor; using namespace QmlDesigner;
Indenter::Indenter() Indenter::Indenter()
{ {

View File

@@ -30,7 +30,7 @@
#ifndef INDENTER_H #ifndef INDENTER_H
#define INDENTER_H #define INDENTER_H
namespace QmlEditor { namespace QmlDesigner {
class Indenter class Indenter
{ {
@@ -38,6 +38,6 @@ public:
Indenter(); Indenter();
}; };
} // namespace QmlEditor } // namespace QmlDesigner
#endif // INDENTER_H #endif // INDENTER_H

View File

@@ -37,7 +37,7 @@
using namespace QmlJS; using namespace QmlJS;
using namespace QmlJS::AST; using namespace QmlJS::AST;
using namespace QmlEditor::Internal; using namespace QmlDesigner::Internal;
using namespace QmlDesigner; using namespace QmlDesigner;
MoveObjectBeforeObjectVisitor::MoveObjectBeforeObjectVisitor(TextModifier &modifier, MoveObjectBeforeObjectVisitor::MoveObjectBeforeObjectVisitor(TextModifier &modifier,

View File

@@ -34,7 +34,7 @@
#include <QtCore/QStack> #include <QtCore/QStack>
namespace QmlEditor { namespace QmlDesigner {
namespace Internal { namespace Internal {
class MoveObjectBeforeObjectVisitor: public QMLRewriter class MoveObjectBeforeObjectVisitor: public QMLRewriter
@@ -74,6 +74,6 @@ private:
}; };
} // namespace Internal } // namespace Internal
} // namespace QmlEditor } // namespace QmlDesigner
#endif // MOVEOBJECTBEFOREOBJECTVISITOR_H #endif // MOVEOBJECTBEFOREOBJECTVISITOR_H

View File

@@ -37,7 +37,7 @@
using namespace QmlJS; using namespace QmlJS;
using namespace QmlJS::AST; using namespace QmlJS::AST;
using namespace QmlEditor::Internal; using namespace QmlDesigner::Internal;
using namespace QmlDesigner; using namespace QmlDesigner;
class Inserter: public QMLRewriter class Inserter: public QMLRewriter

View File

@@ -32,7 +32,7 @@
#include "qmlrewriter.h" #include "qmlrewriter.h"
namespace QmlEditor { namespace QmlDesigner {
namespace Internal { namespace Internal {
class MoveObjectVisitor: public QMLRewriter class MoveObjectVisitor: public QMLRewriter
@@ -67,6 +67,6 @@ private:
}; };
} // namespace Internal } // namespace Internal
} // namespace QmlEditor } // namespace QmlDesigner
#endif // MOVEOBJECTVISITOR_H #endif // MOVEOBJECTVISITOR_H

View File

@@ -32,7 +32,7 @@
#include <qmljsast_p.h> #include <qmljsast_p.h>
using namespace QmlDesigner; using namespace QmlDesigner;
using namespace QmlEditor; using namespace QmlDesigner;
using namespace QmlJS::AST; using namespace QmlJS::AST;
ObjectLengthCalculator::ObjectLengthCalculator(const QString &text): ObjectLengthCalculator::ObjectLengthCalculator(const QString &text):

View File

@@ -50,7 +50,7 @@ protected:
virtual bool visit(QmlJS::AST::UiObjectDefinition *ast); virtual bool visit(QmlJS::AST::UiObjectDefinition *ast);
private: private:
QmlEditor::QmlDocument::Ptr m_doc; QmlDocument::Ptr m_doc;
quint32 m_offset; quint32 m_offset;
quint32 m_length; quint32 m_length;
}; };

View File

@@ -35,7 +35,7 @@
#include "qmljsengine_p.h" #include "qmljsengine_p.h"
#include "qmljsnodepool_p.h" #include "qmljsnodepool_p.h"
using namespace QmlEditor; using namespace QmlDesigner;
using namespace QmlJS; using namespace QmlJS;
QmlDocument::QmlDocument(const QString &fileName) QmlDocument::QmlDocument(const QString &fileName)

View File

@@ -42,7 +42,7 @@
#include "qmljsastfwd_p.h" #include "qmljsastfwd_p.h"
#include "qmlsymbol.h" #include "qmlsymbol.h"
namespace QmlEditor { namespace QmlDesigner {
class CORESHARED_EXPORT QmlDocument class CORESHARED_EXPORT QmlDocument
{ {
@@ -104,6 +104,6 @@ public:
QMap<QString, QmlDocument::Ptr> componentsDefinedByImportedDocuments(const QmlDocument::Ptr &doc, const QString &importPath) const; QMap<QString, QmlDocument::Ptr> componentsDefinedByImportedDocuments(const QmlDocument::Ptr &doc, const QString &importPath) const;
}; };
} // emd of namespace QmlEditor } // emd of namespace QmlDesigner
#endif // QMLDOCUMENT_H #endif // QMLDOCUMENT_H

View File

@@ -40,8 +40,8 @@
#include "removepropertyvisitor.h" #include "removepropertyvisitor.h"
#include "removeuiobjectmembervisitor.h" #include "removeuiobjectmembervisitor.h"
using namespace QmlEditor; using namespace QmlDesigner;
using namespace QmlEditor::Internal; using namespace QmlDesigner::Internal;
QmlRefactoring::QmlRefactoring(const QmlDocument::Ptr &doc, QmlDesigner::TextModifier &modifier, const QStringList &propertyOrder): QmlRefactoring::QmlRefactoring(const QmlDocument::Ptr &doc, QmlDesigner::TextModifier &modifier, const QStringList &propertyOrder):
qmlDocument(doc), qmlDocument(doc),
@@ -56,7 +56,7 @@ bool QmlRefactoring::reparseDocument()
// qDebug() << "QmlRefactoring::reparseDocument() new QML source:" << newSource; // qDebug() << "QmlRefactoring::reparseDocument() new QML source:" << newSource;
QmlEditor::QmlDocument::Ptr tmpDocument(QmlEditor::QmlDocument::create("<ModelToTextMerger>")); QmlDesigner::QmlDocument::Ptr tmpDocument(QmlDesigner::QmlDocument::create("<ModelToTextMerger>"));
tmpDocument->setSource(newSource); tmpDocument->setSource(newSource);
if (tmpDocument->parse()) { if (tmpDocument->parse()) {

View File

@@ -36,7 +36,7 @@
#include <QSet> #include <QSet>
#include <QString> #include <QString>
namespace QmlEditor { namespace QmlDesigner {
class QmlRefactoring class QmlRefactoring
{ {
@@ -75,6 +75,6 @@ private:
QStringList m_propertyOrder; QStringList m_propertyOrder;
}; };
} // namespace QmlEditor } // namespace QmlDesigner
#endif // QMLREFACTORING_H #endif // QMLREFACTORING_H

View File

@@ -39,7 +39,7 @@
using namespace QmlJS; using namespace QmlJS;
using namespace QmlJS::AST; using namespace QmlJS::AST;
using namespace QmlEditor::Internal; using namespace QmlDesigner::Internal;
QMLRewriter::QMLRewriter(QmlDesigner::TextModifier &textModifier): QMLRewriter::QMLRewriter(QmlDesigner::TextModifier &textModifier):
m_textModifier(&textModifier), m_textModifier(&textModifier),

View File

@@ -37,7 +37,7 @@
#include "textmodifier.h" #include "textmodifier.h"
namespace QmlEditor { namespace QmlDesigner {
namespace Internal { namespace Internal {
class QMLRewriter: protected QmlJS::AST::Visitor class QMLRewriter: protected QmlJS::AST::Visitor
@@ -92,6 +92,6 @@ private:
}; };
} // namespace Internal } // namespace Internal
} // namespace QmlEditor } // namespace QmlDesigner
#endif // QMLREWRITER_H #endif // QMLREWRITER_H

View File

@@ -30,7 +30,7 @@
#include "qmljsast_p.h" #include "qmljsast_p.h"
#include "qmlsymbol.h" #include "qmlsymbol.h"
using namespace QmlEditor; using namespace QmlDesigner;
using namespace QmlJS; using namespace QmlJS;
using namespace QmlJS::AST; using namespace QmlJS::AST;

View File

@@ -34,7 +34,7 @@
#include "qmljsastfwd_p.h" #include "qmljsastfwd_p.h"
namespace QmlEditor { namespace QmlDesigner {
class QmlSymbol class QmlSymbol
{ {
@@ -116,6 +116,6 @@ private:
QmlJS::AST::UiPublicMember *propertyNode() const; QmlJS::AST::UiPublicMember *propertyNode() const;
}; };
} // namespace QmlEditor } // namespace QmlDesigner
#endif // QMLSYMBOL_H #endif // QMLSYMBOL_H

View File

@@ -32,7 +32,7 @@
#include "removepropertyvisitor.h" #include "removepropertyvisitor.h"
using namespace QmlEditor::Internal; using namespace QmlDesigner::Internal;
using namespace QmlJS; using namespace QmlJS;
using namespace QmlJS::AST; using namespace QmlJS::AST;

View File

@@ -34,7 +34,7 @@
#include "qmlrewriter.h" #include "qmlrewriter.h"
namespace QmlEditor { namespace QmlDesigner {
namespace Internal { namespace Internal {
class RemovePropertyVisitor: public QMLRewriter class RemovePropertyVisitor: public QMLRewriter
@@ -58,6 +58,6 @@ private:
}; };
} // namespace Internal } // namespace Internal
} // namespace QmlEditor } // namespace QmlDesigner
#endif // REMOVEPROPERTYVISITOR_H #endif // REMOVEPROPERTYVISITOR_H

View File

@@ -33,8 +33,8 @@
#include "removeuiobjectmembervisitor.h" #include "removeuiobjectmembervisitor.h"
using namespace QmlEditor; using namespace QmlDesigner;
using namespace QmlEditor::Internal; using namespace QmlDesigner::Internal;
using namespace QmlJS; using namespace QmlJS;
using namespace QmlJS::AST; using namespace QmlJS::AST;

View File

@@ -34,7 +34,7 @@
#include "qmlrewriter.h" #include "qmlrewriter.h"
namespace QmlEditor { namespace QmlDesigner {
namespace Internal { namespace Internal {
class RemoveUIObjectMemberVisitor: public QMLRewriter class RemoveUIObjectMemberVisitor: public QMLRewriter
@@ -70,6 +70,6 @@ private:
}; };
} // namespace Internal } // namespace Internal
} // namespace QmlEditor } // namespace QmlDesigner
#endif // REMOVEUIOBJECTMEMBERVISITOR_H #endif // REMOVEUIOBJECTMEMBERVISITOR_H

View File

@@ -193,7 +193,7 @@ void ModelToTextMerger::applyChanges()
if (m_rewriteActions.isEmpty()) if (m_rewriteActions.isEmpty())
return; return;
QmlEditor::QmlDocument::Ptr tmpDocument(QmlEditor::QmlDocument::create(QLatin1String("<ModelToTextMerger>"))); QmlDocument::Ptr tmpDocument(QmlDocument::create(QLatin1String("<ModelToTextMerger>")));
tmpDocument->setSource(m_rewriterView->textModifier()->text()); tmpDocument->setSource(m_rewriterView->textModifier()->text());
if (!tmpDocument->parse()) { if (!tmpDocument->parse()) {
qDebug() << "*** Possible problem: QML file wasn't parsed correctly."; qDebug() << "*** Possible problem: QML file wasn't parsed correctly.";
@@ -207,7 +207,7 @@ void ModelToTextMerger::applyChanges()
ModelNodePositionRecalculator positionRecalculator(m_rewriterView->positionStorage(), m_rewriterView->positionStorage()->modelNodes()); ModelNodePositionRecalculator positionRecalculator(m_rewriterView->positionStorage(), m_rewriterView->positionStorage()->modelNodes());
positionRecalculator.connectTo(textModifier); positionRecalculator.connectTo(textModifier);
QmlEditor::QmlRefactoring refactoring(tmpDocument, *textModifier, getPropertyOrder()); QmlDesigner::QmlRefactoring refactoring(tmpDocument, *textModifier, getPropertyOrder());
textModifier->deactivateChangeSignals(); textModifier->deactivateChangeSignals();
textModifier->startGroup(); textModifier->startGroup();
@@ -259,19 +259,19 @@ void ModelToTextMerger::schedule(RewriteAction *action)
m_rewriteActions.append(action); m_rewriteActions.append(action);
} }
QmlEditor::QmlRefactoring::PropertyType ModelToTextMerger::propertyType(const AbstractProperty &property) QmlDesigner::QmlRefactoring::PropertyType ModelToTextMerger::propertyType(const AbstractProperty &property)
{ {
if (property.isBindingProperty()) if (property.isBindingProperty())
return QmlEditor::QmlRefactoring::ObjectBinding; return QmlDesigner::QmlRefactoring::ObjectBinding;
else if (property.isNodeListProperty()) else if (property.isNodeListProperty())
return QmlEditor::QmlRefactoring::ArrayBinding; return QmlDesigner::QmlRefactoring::ArrayBinding;
else if (property.isNodeProperty()) else if (property.isNodeProperty())
return QmlEditor::QmlRefactoring::ObjectBinding; return QmlDesigner::QmlRefactoring::ObjectBinding;
else if (property.isVariantProperty()) else if (property.isVariantProperty())
return QmlEditor::QmlRefactoring::ScriptBinding; return QmlDesigner::QmlRefactoring::ScriptBinding;
Q_ASSERT(!"cannot convert property type"); Q_ASSERT(!"cannot convert property type");
return (QmlEditor::QmlRefactoring::PropertyType) -1; return (QmlDesigner::QmlRefactoring::PropertyType) -1;
} }
QStringList ModelToTextMerger::m_propertyOrder; QStringList ModelToTextMerger::m_propertyOrder;

View File

@@ -77,7 +77,7 @@ protected:
QList<RewriteAction *> scheduledRewriteActions() const QList<RewriteAction *> scheduledRewriteActions() const
{ return m_rewriteActions; } { return m_rewriteActions; }
static QmlEditor::QmlRefactoring::PropertyType propertyType(const AbstractProperty &property); static QmlDesigner::QmlRefactoring::PropertyType propertyType(const AbstractProperty &property);
static QStringList getPropertyOrder(); static QStringList getPropertyOrder();
static bool isInHierarchy(const AbstractProperty &property); static bool isInHierarchy(const AbstractProperty &property);

View File

@@ -34,7 +34,7 @@
using namespace QmlDesigner; using namespace QmlDesigner;
using namespace QmlDesigner::Internal; using namespace QmlDesigner::Internal;
using namespace QmlEditor; using namespace QmlDesigner;
static inline QString toString(QmlRefactoring::PropertyType type) static inline QString toString(QmlRefactoring::PropertyType type)
{ {
@@ -69,7 +69,7 @@ void AddPropertyRewriteAction::dump(const QString &prefix) const
; ;
} }
bool ChangeIdRewriteAction::execute(QmlEditor::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore) bool ChangeIdRewriteAction::execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore)
{ {
const int nodeLocation = positionStore.nodeOffset(m_node); const int nodeLocation = positionStore.nodeOffset(m_node);
static const QLatin1String idPropertyName("id"); static const QLatin1String idPropertyName("id");
@@ -93,7 +93,7 @@ void ChangeIdRewriteAction::dump(const QString &prefix) const
; ;
} }
bool ChangePropertyRewriteAction::execute(QmlEditor::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore) bool ChangePropertyRewriteAction::execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore)
{ {
const int nodeLocation = positionStore.nodeOffset(m_property.parentModelNode()); const int nodeLocation = positionStore.nodeOffset(m_property.parentModelNode());
bool result = false; bool result = false;
@@ -124,7 +124,7 @@ void ChangePropertyRewriteAction::dump(const QString &prefix) const
; ;
} }
bool ChangeTypeRewriteAction::execute(QmlEditor::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore) bool ChangeTypeRewriteAction::execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore)
{ {
const int nodeLocation = positionStore.nodeOffset(m_node); const int nodeLocation = positionStore.nodeOffset(m_node);
bool result = false; bool result = false;
@@ -147,7 +147,7 @@ void ChangeTypeRewriteAction::dump(const QString &prefix) const
; ;
} }
bool RemoveNodeRewriteAction::execute(QmlEditor::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore) bool RemoveNodeRewriteAction::execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore)
{ {
const int nodeLocation = positionStore.nodeOffset(m_node); const int nodeLocation = positionStore.nodeOffset(m_node);
bool result = false; bool result = false;
@@ -165,7 +165,7 @@ void RemoveNodeRewriteAction::dump(const QString &prefix) const
; ;
} }
bool RemovePropertyRewriteAction::execute(QmlEditor::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore) bool RemovePropertyRewriteAction::execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore)
{ {
const int nodeLocation = positionStore.nodeOffset(m_property.parentModelNode()); const int nodeLocation = positionStore.nodeOffset(m_property.parentModelNode());
bool result = false; bool result = false;
@@ -184,7 +184,7 @@ void RemovePropertyRewriteAction::dump(const QString &prefix) const
; ;
} }
bool ReparentNodeRewriteAction::execute(QmlEditor::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore) bool ReparentNodeRewriteAction::execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore)
{ {
const int nodeLocation = positionStore.nodeOffset(m_node); const int nodeLocation = positionStore.nodeOffset(m_node);
const int targetParentObjectLocation = positionStore.nodeOffset(m_targetProperty.parentModelNode()); const int targetParentObjectLocation = positionStore.nodeOffset(m_targetProperty.parentModelNode());

View File

@@ -50,7 +50,7 @@ class MoveNodeRewriteAction;
class RewriteAction class RewriteAction
{ {
public: public:
virtual bool execute(QmlEditor::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore) = 0; virtual bool execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore) = 0;
virtual void dump(const QString &prefix) const = 0; virtual void dump(const QString &prefix) const = 0;
virtual AddPropertyRewriteAction const *asAddPropertyRewriteAction() const { return 0; } virtual AddPropertyRewriteAction const *asAddPropertyRewriteAction() const { return 0; }
@@ -74,11 +74,11 @@ private:
class AddPropertyRewriteAction: public RewriteAction class AddPropertyRewriteAction: public RewriteAction
{ {
public: public:
AddPropertyRewriteAction(const AbstractProperty &property, const QString &valueText, QmlEditor::QmlRefactoring::PropertyType propertyType, const ModelNode &containedModelNode/* = ModelNode()*/): AddPropertyRewriteAction(const AbstractProperty &property, const QString &valueText, QmlDesigner::QmlRefactoring::PropertyType propertyType, const ModelNode &containedModelNode/* = ModelNode()*/):
m_property(property), m_valueText(valueText), m_propertyType(propertyType), m_containedModelNode(containedModelNode) m_property(property), m_valueText(valueText), m_propertyType(propertyType), m_containedModelNode(containedModelNode)
{} {}
virtual bool execute(QmlEditor::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore); virtual bool execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore);
virtual void dump(const QString &prefix) const; virtual void dump(const QString &prefix) const;
virtual AddPropertyRewriteAction const *asAddPropertyRewriteAction() const { return this; } virtual AddPropertyRewriteAction const *asAddPropertyRewriteAction() const { return this; }
@@ -89,7 +89,7 @@ public:
QString valueText() const QString valueText() const
{ return m_valueText; } { return m_valueText; }
QmlEditor::QmlRefactoring::PropertyType propertyType() const QmlDesigner::QmlRefactoring::PropertyType propertyType() const
{ return m_propertyType; } { return m_propertyType; }
ModelNode containedModelNode() const ModelNode containedModelNode() const
@@ -98,7 +98,7 @@ public:
private: private:
AbstractProperty m_property; AbstractProperty m_property;
QString m_valueText; QString m_valueText;
QmlEditor::QmlRefactoring::PropertyType m_propertyType; QmlDesigner::QmlRefactoring::PropertyType m_propertyType;
ModelNode m_containedModelNode; ModelNode m_containedModelNode;
}; };
@@ -109,7 +109,7 @@ public:
m_node(node), m_oldId(oldId), m_newId(newId) m_node(node), m_oldId(oldId), m_newId(newId)
{} {}
virtual bool execute(QmlEditor::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore); virtual bool execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore);
virtual void dump(const QString &prefix) const; virtual void dump(const QString &prefix) const;
virtual ChangeIdRewriteAction const *asChangeIdRewriteAction() const { return this; } virtual ChangeIdRewriteAction const *asChangeIdRewriteAction() const { return this; }
@@ -126,11 +126,11 @@ private:
class ChangePropertyRewriteAction: public RewriteAction class ChangePropertyRewriteAction: public RewriteAction
{ {
public: public:
ChangePropertyRewriteAction(const AbstractProperty &property, const QString &valueText, QmlEditor::QmlRefactoring::PropertyType propertyType, const ModelNode &containedModelNode/* = ModelNode()*/): ChangePropertyRewriteAction(const AbstractProperty &property, const QString &valueText, QmlDesigner::QmlRefactoring::PropertyType propertyType, const ModelNode &containedModelNode/* = ModelNode()*/):
m_property(property), m_valueText(valueText), m_propertyType(propertyType), m_containedModelNode(containedModelNode) m_property(property), m_valueText(valueText), m_propertyType(propertyType), m_containedModelNode(containedModelNode)
{} {}
virtual bool execute(QmlEditor::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore); virtual bool execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore);
virtual void dump(const QString &prefix) const; virtual void dump(const QString &prefix) const;
virtual ChangePropertyRewriteAction const *asChangePropertyRewriteAction() const { return this; } virtual ChangePropertyRewriteAction const *asChangePropertyRewriteAction() const { return this; }
@@ -141,7 +141,7 @@ public:
QString valueText() const QString valueText() const
{ return m_valueText; } { return m_valueText; }
QmlEditor::QmlRefactoring::PropertyType propertyType() const QmlDesigner::QmlRefactoring::PropertyType propertyType() const
{ return m_propertyType; } { return m_propertyType; }
ModelNode containedModelNode() const ModelNode containedModelNode() const
@@ -150,7 +150,7 @@ public:
private: private:
AbstractProperty m_property; AbstractProperty m_property;
QString m_valueText; QString m_valueText;
QmlEditor::QmlRefactoring::PropertyType m_propertyType; QmlDesigner::QmlRefactoring::PropertyType m_propertyType;
ModelNode m_containedModelNode; ModelNode m_containedModelNode;
}; };
@@ -161,7 +161,7 @@ public:
m_node(node) m_node(node)
{} {}
virtual bool execute(QmlEditor::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore); virtual bool execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore);
virtual void dump(const QString &prefix) const; virtual void dump(const QString &prefix) const;
virtual ChangeTypeRewriteAction const *asChangeTypeRewriteAction() const { return this; } virtual ChangeTypeRewriteAction const *asChangeTypeRewriteAction() const { return this; }
@@ -180,7 +180,7 @@ public:
m_node(node) m_node(node)
{} {}
virtual bool execute(QmlEditor::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore); virtual bool execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore);
virtual void dump(const QString &prefix) const; virtual void dump(const QString &prefix) const;
virtual RemoveNodeRewriteAction const *asRemoveNodeRewriteAction() const { return this; } virtual RemoveNodeRewriteAction const *asRemoveNodeRewriteAction() const { return this; }
@@ -199,7 +199,7 @@ public:
m_property(property) m_property(property)
{} {}
virtual bool execute(QmlEditor::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore); virtual bool execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore);
virtual void dump(const QString &prefix) const; virtual void dump(const QString &prefix) const;
virtual RemovePropertyRewriteAction const *asRemovePropertyRewriteAction() const { return this; } virtual RemovePropertyRewriteAction const *asRemovePropertyRewriteAction() const { return this; }
@@ -214,11 +214,11 @@ private:
class ReparentNodeRewriteAction: public RewriteAction class ReparentNodeRewriteAction: public RewriteAction
{ {
public: public:
ReparentNodeRewriteAction(const ModelNode &node, const AbstractProperty &targetProperty, QmlEditor::QmlRefactoring::PropertyType propertyType): ReparentNodeRewriteAction(const ModelNode &node, const AbstractProperty &targetProperty, QmlDesigner::QmlRefactoring::PropertyType propertyType):
m_node(node), m_targetProperty(targetProperty), m_propertyType(propertyType) m_node(node), m_targetProperty(targetProperty), m_propertyType(propertyType)
{} {}
virtual bool execute(QmlEditor::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore); virtual bool execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore);
virtual void dump(const QString &prefix) const; virtual void dump(const QString &prefix) const;
virtual ReparentNodeRewriteAction const *asReparentNodeRewriteAction() const { return this; } virtual ReparentNodeRewriteAction const *asReparentNodeRewriteAction() const { return this; }
@@ -229,13 +229,13 @@ public:
AbstractProperty targetProperty() const AbstractProperty targetProperty() const
{ return m_targetProperty; } { return m_targetProperty; }
QmlEditor::QmlRefactoring::PropertyType propertyType() const QmlDesigner::QmlRefactoring::PropertyType propertyType() const
{ return m_propertyType; } { return m_propertyType; }
private: private:
ModelNode m_node; ModelNode m_node;
AbstractProperty m_targetProperty; AbstractProperty m_targetProperty;
QmlEditor::QmlRefactoring::PropertyType m_propertyType; QmlDesigner::QmlRefactoring::PropertyType m_propertyType;
}; };
class MoveNodeRewriteAction: public RewriteAction class MoveNodeRewriteAction: public RewriteAction
@@ -245,7 +245,7 @@ public:
m_movingNode(movingNode), m_newTrailingNode(newTrailingNode) m_movingNode(movingNode), m_newTrailingNode(newTrailingNode)
{} {}
virtual bool execute(QmlEditor::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore); virtual bool execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore);
virtual void dump(const QString &prefix) const; virtual void dump(const QString &prefix) const;
virtual MoveNodeRewriteAction const *asMoveNodeRewriteAction() const { return this; } virtual MoveNodeRewriteAction const *asMoveNodeRewriteAction() const { return this; }

View File

@@ -391,7 +391,7 @@ void RewriterView::addError(const RewriterView::Error &error)
QMap<ModelNode, QString> RewriterView::extractText(const QList<ModelNode> &nodes) const QMap<ModelNode, QString> RewriterView::extractText(const QList<ModelNode> &nodes) const
{ {
QmlEditor::ASTObjectTextExtractor extract(m_textModifier->text()); QmlDesigner::ASTObjectTextExtractor extract(m_textModifier->text());
QMap<ModelNode, QString> result; QMap<ModelNode, QString> result;
foreach (const ModelNode &node, nodes) { foreach (const ModelNode &node, nodes) {

View File

@@ -90,7 +90,7 @@ int QmlCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
m_startPosition = pos; m_startPosition = pos;
m_completions.clear(); m_completions.clear();
QmlDocument::Ptr qmlDocument = edit->qmlDocument(); Qml::QmlDocument::Ptr qmlDocument = edit->qmlDocument();
// qDebug() << "*** document:" << qmlDocument; // qDebug() << "*** document:" << qmlDocument;
if (qmlDocument.isNull()) if (qmlDocument.isNull())
return pos; return pos;

View File

@@ -338,8 +338,8 @@ QmlTextEditor::QmlTextEditor(QWidget *parent) :
m_typeSystem = ExtensionSystem::PluginManager::instance()->getObject<Qml::QmlTypeSystem>(); m_typeSystem = ExtensionSystem::PluginManager::instance()->getObject<Qml::QmlTypeSystem>();
if (m_modelManager) { if (m_modelManager) {
connect(m_modelManager, SIGNAL(documentUpdated(QmlEditor::QmlDocument::Ptr)), connect(m_modelManager, SIGNAL(documentUpdated(Qml::QmlDocument::Ptr)),
this, SLOT(onDocumentUpdated(QmlEditor::QmlDocument::Ptr))); this, SLOT(onDocumentUpdated(Qml::QmlDocument::Ptr)));
} }
} }
@@ -384,7 +384,7 @@ void QmlTextEditor::updateDocumentNow()
m_modelManager->updateSourceFiles(QStringList() << fileName); m_modelManager->updateSourceFiles(QStringList() << fileName);
} }
void QmlTextEditor::onDocumentUpdated(QmlEditor::QmlDocument::Ptr doc) void QmlTextEditor::onDocumentUpdated(Qml::QmlDocument::Ptr doc)
{ {
if (file()->fileName() != doc->fileName()) if (file()->fileName() != doc->fileName())
return; return;

View File

@@ -108,13 +108,13 @@ public:
virtual void unCommentSelection(); virtual void unCommentSelection();
QmlDocument::Ptr qmlDocument() const { return m_document; } Qml::QmlDocument::Ptr qmlDocument() const { return m_document; }
public slots: public slots:
virtual void setFontSettings(const TextEditor::FontSettings &); virtual void setFontSettings(const TextEditor::FontSettings &);
private slots: private slots:
void onDocumentUpdated(QmlEditor::QmlDocument::Ptr doc); void onDocumentUpdated(Qml::QmlDocument::Ptr doc);
void updateDocument(); void updateDocument();
void updateDocumentNow(); void updateDocumentNow();
@@ -157,7 +157,7 @@ private:
QMap<QString, QList<QmlJS::AST::SourceLocation> > m_ids; // ### use QMultiMap QMap<QString, QList<QmlJS::AST::SourceLocation> > m_ids; // ### use QMultiMap
int m_idsRevision; int m_idsRevision;
QList<QmlJS::DiagnosticMessage> m_diagnosticMessages; QList<QmlJS::DiagnosticMessage> m_diagnosticMessages;
QmlDocument::Ptr m_document; Qml::QmlDocument::Ptr m_document;
QmlModelManagerInterface *m_modelManager; QmlModelManagerInterface *m_modelManager;
Qml::QmlTypeSystem *m_typeSystem; Qml::QmlTypeSystem *m_typeSystem;
QTextCharFormat m_occurrencesFormat; QTextCharFormat m_occurrencesFormat;

View File

@@ -53,7 +53,7 @@ public:
QmlExpressionUnderCursor(); QmlExpressionUnderCursor();
virtual ~QmlExpressionUnderCursor(); virtual ~QmlExpressionUnderCursor();
void operator()(const QTextCursor &cursor, const QmlDocument::Ptr &doc); void operator()(const QTextCursor &cursor, const Qml::QmlDocument::Ptr &doc);
QStack<Qml::QmlSymbol *> expressionScopes() const QStack<Qml::QmlSymbol *> expressionScopes() const
{ return _expressionScopes; } { return _expressionScopes; }

View File

@@ -44,8 +44,8 @@ class QmlLookupContext
{ {
public: public:
QmlLookupContext(const QStack<Qml::QmlSymbol *> &scopes, QmlLookupContext(const QStack<Qml::QmlSymbol *> &scopes,
const QmlDocument::Ptr &doc, const Qml::QmlDocument::Ptr &doc,
const Snapshot &snapshot, const Qml::Snapshot &snapshot,
Qml::QmlTypeSystem *typeSystem); Qml::QmlTypeSystem *typeSystem);
Qml::QmlSymbol *resolve(const QString &name); Qml::QmlSymbol *resolve(const QString &name);
@@ -54,7 +54,7 @@ public:
Qml::QmlSymbol *resolveType(QmlJS::AST::UiQualifiedId *name) Qml::QmlSymbol *resolveType(QmlJS::AST::UiQualifiedId *name)
{ return resolveType(toString(name), _doc->fileName()); } { return resolveType(toString(name), _doc->fileName()); }
QmlDocument::Ptr document() const Qml::QmlDocument::Ptr document() const
{ return _doc; } { return _doc; }
QList<Qml::QmlSymbol*> visibleSymbolsInScope(); QList<Qml::QmlSymbol*> visibleSymbolsInScope();
@@ -71,8 +71,8 @@ private:
private: private:
QStack<Qml::QmlSymbol *> _scopes; QStack<Qml::QmlSymbol *> _scopes;
QmlDocument::Ptr _doc; Qml::QmlDocument::Ptr _doc;
Snapshot _snapshot; Qml::Snapshot _snapshot;
Qml::QmlTypeSystem *m_typeSystem; Qml::QmlTypeSystem *m_typeSystem;
}; };

View File

@@ -52,13 +52,13 @@ QmlModelManager::QmlModelManager(QObject *parent):
{ {
m_synchronizer.setCancelOnWait(true); m_synchronizer.setCancelOnWait(true);
qRegisterMetaType<QmlEditor::QmlDocument::Ptr>("QmlEditor::QmlDocument::Ptr"); qRegisterMetaType<Qml::QmlDocument::Ptr>("Qml::QmlDocument::Ptr");
connect(this, SIGNAL(documentUpdated(QmlEditor::QmlDocument::Ptr)), connect(this, SIGNAL(documentUpdated(Qml::QmlDocument::Ptr)),
this, SLOT(onDocumentUpdated(QmlEditor::QmlDocument::Ptr))); this, SLOT(onDocumentUpdated(Qml::QmlDocument::Ptr)));
} }
Snapshot QmlModelManager::snapshot() const Qml::Snapshot QmlModelManager::snapshot() const
{ {
QMutexLocker locker(&m_mutex); QMutexLocker locker(&m_mutex);
@@ -119,10 +119,10 @@ QMap<QString, QString> QmlModelManager::buildWorkingCopyList()
return workingCopy; return workingCopy;
} }
void QmlModelManager::emitDocumentUpdated(QmlDocument::Ptr doc) void QmlModelManager::emitDocumentUpdated(Qml::QmlDocument::Ptr doc)
{ emit documentUpdated(doc); } { emit documentUpdated(doc); }
void QmlModelManager::onDocumentUpdated(QmlEditor::QmlDocument::Ptr doc) void QmlModelManager::onDocumentUpdated(Qml::QmlDocument::Ptr doc)
{ {
QMutexLocker locker(&m_mutex); QMutexLocker locker(&m_mutex);
@@ -154,7 +154,7 @@ void QmlModelManager::parse(QFutureInterface<void> &future,
} }
} }
QmlDocument::Ptr doc = QmlDocument::create(fileName); Qml::QmlDocument::Ptr doc = Qml::QmlDocument::create(fileName);
doc->setSource(contents); doc->setSource(contents);
doc->parse(); doc->parse();

View File

@@ -52,10 +52,10 @@ class QmlModelManager: public QmlModelManagerInterface
public: public:
QmlModelManager(QObject *parent = 0); QmlModelManager(QObject *parent = 0);
virtual Snapshot snapshot() const; virtual Qml::Snapshot snapshot() const;
virtual void updateSourceFiles(const QStringList &files); virtual void updateSourceFiles(const QStringList &files);
void emitDocumentUpdated(QmlDocument::Ptr doc); void emitDocumentUpdated(Qml::QmlDocument::Ptr doc);
Q_SIGNALS: Q_SIGNALS:
void projectPathChanged(const QString &projectPath); void projectPathChanged(const QString &projectPath);
@@ -63,7 +63,7 @@ Q_SIGNALS:
private Q_SLOTS: private Q_SLOTS:
// this should be executed in the GUI thread. // this should be executed in the GUI thread.
void onDocumentUpdated(QmlEditor::QmlDocument::Ptr doc); void onDocumentUpdated(Qml::QmlDocument::Ptr doc);
protected: protected:
QFuture<void> refreshSourceFiles(const QStringList &sourceFiles); QFuture<void> refreshSourceFiles(const QStringList &sourceFiles);
@@ -77,7 +77,7 @@ protected:
private: private:
mutable QMutex m_mutex; mutable QMutex m_mutex;
Core::ICore *m_core; Core::ICore *m_core;
Snapshot _snapshot; Qml::Snapshot _snapshot;
QFutureSynchronizer<void> m_synchronizer; QFutureSynchronizer<void> m_synchronizer;
}; };

View File

@@ -39,9 +39,13 @@
#include <qml/qmldocument.h> #include <qml/qmldocument.h>
#include <qml/metatype/qmltypesystem.h> #include <qml/metatype/qmltypesystem.h>
namespace QmlEditor {
namespace Qml {
class Snapshot; class Snapshot;
}
namespace QmlEditor {
class QMLEDITOR_EXPORT QmlModelManagerInterface: public QObject class QMLEDITOR_EXPORT QmlModelManagerInterface: public QObject
{ {
@@ -51,11 +55,11 @@ public:
QmlModelManagerInterface(QObject *parent = 0); QmlModelManagerInterface(QObject *parent = 0);
virtual ~QmlModelManagerInterface(); virtual ~QmlModelManagerInterface();
virtual Snapshot snapshot() const = 0; virtual Qml::Snapshot snapshot() const = 0;
virtual void updateSourceFiles(const QStringList &files) = 0; virtual void updateSourceFiles(const QStringList &files) = 0;
signals: signals:
void documentUpdated(QmlEditor::QmlDocument::Ptr doc); void documentUpdated(Qml::QmlDocument::Ptr doc);
}; };
} }

View File

@@ -100,8 +100,8 @@ void QmlProjectPlugin::extensionsInitialized()
QmlEditor::QmlModelManagerInterface *modelManager = pluginManager->getObject<QmlEditor::QmlModelManagerInterface>(); QmlEditor::QmlModelManagerInterface *modelManager = pluginManager->getObject<QmlEditor::QmlModelManagerInterface>();
Q_ASSERT(modelManager); Q_ASSERT(modelManager);
connect(modelManager, SIGNAL(documentUpdated(QmlEditor::QmlDocument::Ptr)), connect(modelManager, SIGNAL(documentUpdated(Qml::QmlDocument::Ptr)),
m_qmlTaskManager, SLOT(documentUpdated(QmlEditor::QmlDocument::Ptr))); m_qmlTaskManager, SLOT(documentUpdated(Qml::QmlDocument::Ptr)));
} }
Q_EXPORT_PLUGIN(QmlProjectPlugin) Q_EXPORT_PLUGIN(QmlProjectPlugin)

View File

@@ -48,7 +48,7 @@ void QmlTaskManager::setTaskWindow(ProjectExplorer::TaskWindow *taskWindow)
m_taskWindow->addCategory(Constants::TASK_CATEGORY_QML, "Qml"); m_taskWindow->addCategory(Constants::TASK_CATEGORY_QML, "Qml");
} }
void QmlTaskManager::documentUpdated(QmlEditor::QmlDocument::Ptr doc) void QmlTaskManager::documentUpdated(Qml::QmlDocument::Ptr doc)
{ {
#if 0 // This will give way too many flickering errors in the build-results pane *when you're typing* #if 0 // This will give way too many flickering errors in the build-results pane *when you're typing*
m_taskWindow->clearTasks(Constants::TASK_CATEGORY_QML); m_taskWindow->clearTasks(Constants::TASK_CATEGORY_QML);

View File

@@ -46,7 +46,7 @@ public:
void setTaskWindow(ProjectExplorer::TaskWindow *taskWindow); void setTaskWindow(ProjectExplorer::TaskWindow *taskWindow);
public slots: public slots:
void documentUpdated(QmlEditor::QmlDocument::Ptr doc); void documentUpdated(Qml::QmlDocument::Ptr doc);
private: private:
ProjectExplorer::TaskWindow *m_taskWindow; ProjectExplorer::TaskWindow *m_taskWindow;

View File

@@ -41,7 +41,7 @@
\defgroup CoreExceptions \defgroup CoreExceptions
*/ */
/*! /*!
\class QmlDesigner::Exception \class Qml::Exception
\ingroup CoreExceptions \ingroup CoreExceptions
\brief This is the abstract base class for all excetions. \brief This is the abstract base class for all excetions.
Exceptions should be used in cases there is no other way to say something goes wrong. For example Exceptions should be used in cases there is no other way to say something goes wrong. For example

View File

@@ -30,7 +30,7 @@
#include "invalidmetainfoexception.h" #include "invalidmetainfoexception.h"
/*! /*!
\class QmlDesigner::InvalidMetaInfoException \class Qml::InvalidMetaInfoException
\ingroup CoreExceptions \ingroup CoreExceptions
\brief Exception for a invalid meta info \brief Exception for a invalid meta info

View File

@@ -254,7 +254,7 @@ QStringList MetaInfo::s_pluginDirs;
/*! /*!
\class QmlDesigner::MetaInfo \class Qml::MetaInfo
\ingroup CoreModel \ingroup CoreModel
\brief The MetaInfo class provides meta information about qml types and properties. \brief The MetaInfo class provides meta information about qml types and properties.
@@ -268,7 +268,7 @@ The MetaInfo object should always be accessed via the model (see Model::metaInfo
Otherwise types specific to a model (like sub components) might Otherwise types specific to a model (like sub components) might
be missed. be missed.
\see Model::metaInfo(), QmlDesigner::NodeMetaInfo, QmlDesigner::PropertyMetaInfo, QmlDesigner::EnumeratorMetaInfo \see Model::metaInfo(), Qml::NodeMetaInfo, Qml::PropertyMetaInfo, Qml::EnumeratorMetaInfo
*/ */
/*! /*!
@@ -486,4 +486,4 @@ bool operator!=(const MetaInfo &first, const MetaInfo &second)
{ {
return !(first == second); return !(first == second);
} }
} //namespace QmlDesigner } //namespace Qml

View File

@@ -80,7 +80,7 @@ public:
} // namespace Internal } // namespace Internal
/*! /*!
\class QmlDesigner::NodeMetaInfo \class Qml::NodeMetaInfo
\ingroup CoreModel \ingroup CoreModel
\brief The NodeMetaInfo class provides meta information about a qml type. \brief The NodeMetaInfo class provides meta information about a qml type.
@@ -93,7 +93,7 @@ if the enclosing type is deregistered from the meta type system (e.g.
a sub component qml file is deleted). Trying to call any accessor methods on an invalid a sub component qml file is deleted). Trying to call any accessor methods on an invalid
NodeMetaInfo object will result in an InvalidMetaInfoException being thrown. NodeMetaInfo object will result in an InvalidMetaInfoException being thrown.
\see QmlDesigner::MetaInfo, QmlDesigner::PropertyMetaInfo, QmlDesigner::EnumeratorMetaInfo \see Qml::MetaInfo, Qml::PropertyMetaInfo, Qml::EnumeratorMetaInfo
*/ */
NodeMetaInfo::NodeMetaInfo() NodeMetaInfo::NodeMetaInfo()

View File

@@ -72,7 +72,7 @@ public:
} // namespace Internal } // namespace Internal
/*! /*!
\class QmlDesigner::PropertyMetaInfo \class Qml::PropertyMetaInfo
\ingroup CoreModel \ingroup CoreModel
\brief The PropertyMetaInfo class provides meta information about a qml type property. \brief The PropertyMetaInfo class provides meta information about a qml type property.
@@ -86,7 +86,7 @@ a sub component qml file is deleted). Trying to call any accessor methods on an
PropertyMetaInfo object will result in an InvalidMetaInfoException being thrown. PropertyMetaInfo object will result in an InvalidMetaInfoException being thrown.
\see QmlDesigner::MetaInfo, QmlDesigner::NodeMetaInfo, QmlDesigner::EnumeratorMetaInfo \see Qml::MetaInfo, Qml::NodeMetaInfo, Qml::EnumeratorMetaInfo
*/ */
PropertyMetaInfo::PropertyMetaInfo() PropertyMetaInfo::PropertyMetaInfo()

View File

@@ -36,7 +36,6 @@
#include "qmljsastfwd_p.h" #include "qmljsastfwd_p.h"
using namespace Qml; using namespace Qml;
using namespace QmlEditor;
using namespace QmlJS; using namespace QmlJS;
QmlDocument::QmlDocument(const QString &fileName) QmlDocument::QmlDocument(const QString &fileName)

View File

@@ -39,7 +39,7 @@
#include "qml_global.h" #include "qml_global.h"
#include "qmlsymbol.h" #include "qmlsymbol.h"
namespace QmlEditor { namespace Qml {
class QML_EXPORT QmlDocument class QML_EXPORT QmlDocument
{ {
@@ -106,6 +106,6 @@ public:
QMap<QString, QmlDocument::Ptr> componentsDefinedByImportedDocuments(const QmlDocument::Ptr &doc, const QString &importPath) const; QMap<QString, QmlDocument::Ptr> componentsDefinedByImportedDocuments(const QmlDocument::Ptr &doc, const QString &importPath) const;
}; };
} // emd of namespace QmlEditor } // end of namespace Qml
#endif // QMLDOCUMENT_H #endif // QMLDOCUMENT_H

View File

@@ -37,7 +37,7 @@ using namespace QmlJS::AST;
using namespace Qml; using namespace Qml;
using namespace Qml::Internal; using namespace Qml::Internal;
QMap<QString, QmlIdSymbol*> QmlIdCollector::operator()(QmlEditor::QmlDocument &doc) QMap<QString, QmlIdSymbol*> QmlIdCollector::operator()(Qml::QmlDocument &doc)
{ {
_doc = &doc; _doc = &doc;
_ids.clear(); _ids.clear();

View File

@@ -46,7 +46,7 @@ namespace Internal {
class QML_EXPORT QmlIdCollector: protected QmlJS::AST::Visitor class QML_EXPORT QmlIdCollector: protected QmlJS::AST::Visitor
{ {
public: public:
QMap<QString, Qml::QmlIdSymbol*> operator()(QmlEditor::QmlDocument &doc); QMap<QString, Qml::QmlIdSymbol*> operator()(Qml::QmlDocument &doc);
QList<QmlJS::DiagnosticMessage> diagnosticMessages() QList<QmlJS::DiagnosticMessage> diagnosticMessages()
{ return _diagnosticMessages; } { return _diagnosticMessages; }
@@ -62,7 +62,7 @@ private:
void addId(const QString &id, QmlJS::AST::UiScriptBinding *ast); void addId(const QString &id, QmlJS::AST::UiScriptBinding *ast);
private: private:
QmlEditor::QmlDocument *_doc; Qml::QmlDocument *_doc;
QMap<QString, Qml::QmlIdSymbol*> _ids; QMap<QString, Qml::QmlIdSymbol*> _ids;
Qml::QmlSymbolFromFile *_currentSymbol; Qml::QmlSymbolFromFile *_currentSymbol;
QList<QmlJS::DiagnosticMessage> _diagnosticMessages; QList<QmlJS::DiagnosticMessage> _diagnosticMessages;

View File

@@ -4,6 +4,7 @@ QT += testlib \
declarative declarative
DESTDIR = $$DESIGNER_BINARY_DIRECTORY DESTDIR = $$DESIGNER_BINARY_DIRECTORY
include(../../../../../src/plugins/qmldesigner/core/core.pri) include(../../../../../src/plugins/qmldesigner/core/core.pri)
include(../../../../../src/shared/qml/qml.pri)
DEFINES+=QTCREATOR_UTILS_STATIC_LIB DEFINES+=QTCREATOR_UTILS_STATIC_LIB
DEPENDPATH += .. DEPENDPATH += ..