forked from qt-creator/qt-creator
QmlDesigner: Remove unneeded qualifications
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
next if file =~ %r{src/shared/qbs|/qmljs/}
s = File.read(file)
s.scan(/^using namespace (.*);$/) {
ns = $1
t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
before = $1
char = $2
if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
m
else
before + char
end
}
if t != s
puts file
File.open(file, 'w').write(t)
end
}
}
Change-Id: I492792bb9e5655c55795e938031efc557c9a462f
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
42af154c77
commit
b6de2d1bd8
@@ -211,7 +211,7 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
|
||||
threadId = 0;
|
||||
|
||||
emit rangedEvent(Event, MaximumRangeType, AnimationFrame, time, 0, QString(),
|
||||
QmlDebug::QmlEventLocation(), frameRate, animationCount, threadId,
|
||||
QmlEventLocation(), frameRate, animationCount, threadId,
|
||||
0, 0);
|
||||
d->maximumTime = qMax(time, d->maximumTime);
|
||||
break;
|
||||
@@ -222,7 +222,7 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
|
||||
break;
|
||||
|
||||
emit this->rangedEvent(Event, MaximumRangeType, subtype, time, 0, QString(),
|
||||
QmlDebug::QmlEventLocation(), 0, 0, 0, 0, 0);
|
||||
QmlEventLocation(), 0, 0, 0, 0, 0);
|
||||
d->maximumTime = qMax(time, d->maximumTime);
|
||||
break;
|
||||
}
|
||||
@@ -244,8 +244,8 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
|
||||
}
|
||||
while (count<5)
|
||||
params[count++] = 0;
|
||||
emit rangedEvent(SceneGraphFrame, QmlDebug::MaximumRangeType, subtype,time, 0,
|
||||
QString(), QmlDebug::QmlEventLocation(), params[0], params[1],
|
||||
emit rangedEvent(SceneGraphFrame, MaximumRangeType, subtype,time, 0,
|
||||
QString(), QmlEventLocation(), params[0], params[1],
|
||||
params[2], params[3], params[4]);
|
||||
break;
|
||||
}
|
||||
@@ -261,8 +261,8 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
|
||||
stream >> width >> height;
|
||||
refcount = 1;
|
||||
}
|
||||
emit rangedEvent(QmlDebug::PixmapCacheEvent, QmlDebug::MaximumRangeType, subtype, time, 0,
|
||||
QString(), QmlDebug::QmlEventLocation(pixUrl,0,0), width, height,
|
||||
emit rangedEvent(PixmapCacheEvent, MaximumRangeType, subtype, time, 0,
|
||||
QString(), QmlEventLocation(pixUrl,0,0), width, height,
|
||||
refcount, 0, 0);
|
||||
d->maximumTime = qMax(time, d->maximumTime);
|
||||
break;
|
||||
@@ -273,8 +273,8 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
|
||||
|
||||
qint64 delta;
|
||||
stream >> delta;
|
||||
emit rangedEvent(QmlDebug::MemoryAllocation, QmlDebug::MaximumRangeType, subtype, time, 0,
|
||||
QString(), QmlDebug::QmlEventLocation(), delta, 0, 0, 0, 0);
|
||||
emit rangedEvent(MemoryAllocation, MaximumRangeType, subtype, time, 0,
|
||||
QString(), QmlEventLocation(), delta, 0, 0, 0, 0);
|
||||
d->maximumTime = qMax(time, d->maximumTime);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -41,9 +41,10 @@
|
||||
#include <QDir>
|
||||
|
||||
using namespace LanguageUtils;
|
||||
using namespace QmlJS;
|
||||
using namespace QmlJS::AST;
|
||||
|
||||
namespace QmlJS {
|
||||
|
||||
namespace {
|
||||
class ImportCacheKey
|
||||
{
|
||||
@@ -76,8 +77,7 @@ bool operator==(const ImportCacheKey &i1, const ImportCacheKey &i2)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class QmlJS::LinkPrivate
|
||||
class LinkPrivate
|
||||
{
|
||||
public:
|
||||
Snapshot snapshot;
|
||||
@@ -602,3 +602,5 @@ void LinkPrivate::loadImplicitDefaultImports(Imports *imports)
|
||||
imports->append(import);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace QmlJS
|
||||
|
||||
@@ -65,12 +65,10 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
} // end of Internal namespace
|
||||
} // end of QmlJS namespace
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
// globally shared data
|
||||
class QmlJS::SharedValueOwner : public ValueOwner
|
||||
class SharedValueOwner : public ValueOwner
|
||||
{
|
||||
public:
|
||||
enum SharedValueOwnerKind{
|
||||
@@ -969,3 +967,5 @@ const Value *ValueOwner::defaultValueForBuiltinType(const QString &name) const
|
||||
}
|
||||
return undefinedValue();
|
||||
}
|
||||
|
||||
} // namespace QmlJS
|
||||
|
||||
@@ -37,7 +37,7 @@ using namespace QmlDesigner::Internal;
|
||||
using namespace QmlJS;
|
||||
using namespace QmlJS::AST;
|
||||
|
||||
AddArrayMemberVisitor::AddArrayMemberVisitor(QmlDesigner::TextModifier &modifier,
|
||||
AddArrayMemberVisitor::AddArrayMemberVisitor(TextModifier &modifier,
|
||||
quint32 parentLocation,
|
||||
const QString &propertyName,
|
||||
const QString &content):
|
||||
@@ -62,7 +62,7 @@ void AddArrayMemberVisitor::findArrayBindingAndInsert(const QString &propertyNam
|
||||
}
|
||||
}
|
||||
|
||||
bool AddArrayMemberVisitor::visit(QmlJS::AST::UiObjectBinding *ast)
|
||||
bool AddArrayMemberVisitor::visit(UiObjectBinding *ast)
|
||||
{
|
||||
if (didRewriting())
|
||||
return false;
|
||||
@@ -73,7 +73,7 @@ bool AddArrayMemberVisitor::visit(QmlJS::AST::UiObjectBinding *ast)
|
||||
return !didRewriting();
|
||||
}
|
||||
|
||||
bool AddArrayMemberVisitor::visit(QmlJS::AST::UiObjectDefinition *ast)
|
||||
bool AddArrayMemberVisitor::visit(UiObjectDefinition *ast)
|
||||
{
|
||||
if (didRewriting())
|
||||
return false;
|
||||
@@ -85,7 +85,7 @@ bool AddArrayMemberVisitor::visit(QmlJS::AST::UiObjectDefinition *ast)
|
||||
}
|
||||
|
||||
// FIXME: duplicate code in the QmlJS::Rewriter class, remove this
|
||||
void AddArrayMemberVisitor::insertInto(QmlJS::AST::UiArrayBinding *arrayBinding)
|
||||
void AddArrayMemberVisitor::insertInto(UiArrayBinding *arrayBinding)
|
||||
{
|
||||
UiObjectMember *lastMember = 0;
|
||||
for (UiArrayMemberList *iter = arrayBinding->members; iter; iter = iter->next)
|
||||
@@ -103,7 +103,7 @@ void AddArrayMemberVisitor::insertInto(QmlJS::AST::UiArrayBinding *arrayBinding)
|
||||
setDidRewriting(true);
|
||||
}
|
||||
|
||||
void AddArrayMemberVisitor::convertAndAdd(QmlJS::AST::UiObjectBinding *objectBinding)
|
||||
void AddArrayMemberVisitor::convertAndAdd(UiObjectBinding *objectBinding)
|
||||
{
|
||||
const int indentDepth = calculateIndentDepth(objectBinding->firstSourceLocation());
|
||||
const QString arrayPrefix = QStringLiteral("[\n") + addIndentation(QString(), indentDepth);
|
||||
|
||||
@@ -37,7 +37,7 @@ using namespace QmlDesigner::Internal;
|
||||
using namespace QmlJS;
|
||||
using namespace QmlJS::AST;
|
||||
|
||||
AddObjectVisitor::AddObjectVisitor(QmlDesigner::TextModifier &modifier,
|
||||
AddObjectVisitor::AddObjectVisitor(TextModifier &modifier,
|
||||
quint32 parentLocation,
|
||||
const QString &content,
|
||||
const PropertyNameList &propertyOrder):
|
||||
@@ -48,7 +48,7 @@ AddObjectVisitor::AddObjectVisitor(QmlDesigner::TextModifier &modifier,
|
||||
{
|
||||
}
|
||||
|
||||
bool AddObjectVisitor::visit(QmlJS::AST::UiObjectBinding *ast)
|
||||
bool AddObjectVisitor::visit(UiObjectBinding *ast)
|
||||
{
|
||||
if (didRewriting())
|
||||
return false;
|
||||
@@ -59,7 +59,7 @@ bool AddObjectVisitor::visit(QmlJS::AST::UiObjectBinding *ast)
|
||||
return !didRewriting();
|
||||
}
|
||||
|
||||
bool AddObjectVisitor::visit(QmlJS::AST::UiObjectDefinition *ast)
|
||||
bool AddObjectVisitor::visit(UiObjectDefinition *ast)
|
||||
{
|
||||
if (didRewriting())
|
||||
return false;
|
||||
@@ -71,7 +71,7 @@ bool AddObjectVisitor::visit(QmlJS::AST::UiObjectDefinition *ast)
|
||||
}
|
||||
|
||||
// FIXME: duplicate code in the QmlJS::Rewriter class, remove this
|
||||
void AddObjectVisitor::insertInto(QmlJS::AST::UiObjectInitializer *ast)
|
||||
void AddObjectVisitor::insertInto(UiObjectInitializer *ast)
|
||||
{
|
||||
UiObjectMemberList *insertAfter = searchMemberToInsertAfter(ast->members, m_propertyOrder);
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@
|
||||
namespace QmlDesigner {
|
||||
namespace Internal {
|
||||
|
||||
AddPropertyVisitor::AddPropertyVisitor(QmlDesigner::TextModifier &modifier,
|
||||
AddPropertyVisitor::AddPropertyVisitor(TextModifier &modifier,
|
||||
quint32 parentLocation,
|
||||
const QmlDesigner::PropertyName &name,
|
||||
const PropertyName &name,
|
||||
const QString &value,
|
||||
QmlRefactoring::PropertyType propertyType,
|
||||
const PropertyNameList &propertyOrder,
|
||||
|
||||
@@ -41,9 +41,9 @@ class AddPropertyVisitor: public QMLRewriter
|
||||
{
|
||||
public:
|
||||
public:
|
||||
AddPropertyVisitor(QmlDesigner::TextModifier &modifier,
|
||||
AddPropertyVisitor(TextModifier &modifier,
|
||||
quint32 parentLocation,
|
||||
const QmlDesigner::PropertyName &name,
|
||||
const PropertyName &name,
|
||||
const QString &value,
|
||||
QmlRefactoring::PropertyType propertyType,
|
||||
const PropertyNameList &propertyOrder,
|
||||
@@ -62,7 +62,7 @@ private:
|
||||
QString m_value;
|
||||
QmlRefactoring::PropertyType m_propertyType;
|
||||
PropertyNameList m_propertyOrder;
|
||||
QmlDesigner::TypeName m_dynamicTypeName;
|
||||
TypeName m_dynamicTypeName;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -55,7 +55,7 @@ QString ASTObjectTextExtractor::operator ()(int location)
|
||||
return m_text;
|
||||
}
|
||||
|
||||
bool ASTObjectTextExtractor::visit(QmlJS::AST::UiObjectBinding *ast)
|
||||
bool ASTObjectTextExtractor::visit(UiObjectBinding *ast)
|
||||
{
|
||||
if (!m_text.isEmpty())
|
||||
return false;
|
||||
@@ -66,7 +66,7 @@ bool ASTObjectTextExtractor::visit(QmlJS::AST::UiObjectBinding *ast)
|
||||
return m_text.isEmpty();
|
||||
}
|
||||
|
||||
bool ASTObjectTextExtractor::visit(QmlJS::AST::UiObjectDefinition *ast)
|
||||
bool ASTObjectTextExtractor::visit(UiObjectDefinition *ast)
|
||||
{
|
||||
if (!m_text.isEmpty())
|
||||
return false;
|
||||
|
||||
@@ -44,7 +44,7 @@ ChangeImportsVisitor::ChangeImportsVisitor(TextModifier &textModifier,
|
||||
QMLRewriter(textModifier), m_source(source)
|
||||
{}
|
||||
|
||||
bool ChangeImportsVisitor::add(QmlJS::AST::UiProgram *ast, const Import &import)
|
||||
bool ChangeImportsVisitor::add(UiProgram *ast, const Import &import)
|
||||
{
|
||||
setDidRewriting(false);
|
||||
if (!ast)
|
||||
@@ -72,7 +72,7 @@ bool ChangeImportsVisitor::add(QmlJS::AST::UiProgram *ast, const Import &import)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChangeImportsVisitor::remove(QmlJS::AST::UiProgram *ast, const Import &import)
|
||||
bool ChangeImportsVisitor::remove(UiProgram *ast, const Import &import)
|
||||
{
|
||||
setDidRewriting(false);
|
||||
if (!ast)
|
||||
@@ -92,7 +92,7 @@ bool ChangeImportsVisitor::remove(QmlJS::AST::UiProgram *ast, const Import &impo
|
||||
return didRewriting();
|
||||
}
|
||||
|
||||
bool ChangeImportsVisitor::equals(QmlJS::AST::UiImport *ast, const Import &import)
|
||||
bool ChangeImportsVisitor::equals(UiImport *ast, const Import &import)
|
||||
{
|
||||
if (import.isLibraryImport())
|
||||
return toString(ast->importUri) == import.url();
|
||||
|
||||
@@ -37,7 +37,7 @@ using namespace QmlJS::AST;
|
||||
using namespace QmlDesigner;
|
||||
using namespace QmlDesigner::Internal;
|
||||
|
||||
ChangePropertyVisitor::ChangePropertyVisitor(QmlDesigner::TextModifier &modifier,
|
||||
ChangePropertyVisitor::ChangePropertyVisitor(TextModifier &modifier,
|
||||
quint32 parentLocation,
|
||||
const QString &name,
|
||||
const QString &value,
|
||||
@@ -50,7 +50,7 @@ ChangePropertyVisitor::ChangePropertyVisitor(QmlDesigner::TextModifier &modifier
|
||||
{
|
||||
}
|
||||
|
||||
bool ChangePropertyVisitor::visit(QmlJS::AST::UiObjectDefinition *ast)
|
||||
bool ChangePropertyVisitor::visit(UiObjectDefinition *ast)
|
||||
{
|
||||
if (didRewriting())
|
||||
return false;
|
||||
@@ -66,7 +66,7 @@ bool ChangePropertyVisitor::visit(QmlJS::AST::UiObjectDefinition *ast)
|
||||
return !didRewriting();
|
||||
}
|
||||
|
||||
bool ChangePropertyVisitor::visit(QmlJS::AST::UiObjectBinding *ast)
|
||||
bool ChangePropertyVisitor::visit(UiObjectBinding *ast)
|
||||
{
|
||||
if (didRewriting())
|
||||
return false;
|
||||
@@ -192,7 +192,7 @@ bool ChangePropertyVisitor::nextMemberOnSameLine(UiObjectMemberList *members)
|
||||
}
|
||||
|
||||
// FIXME: duplicate code in the QmlJS::Rewriter class, remove this
|
||||
void ChangePropertyVisitor::insertIntoArray(QmlJS::AST::UiArrayBinding *ast)
|
||||
void ChangePropertyVisitor::insertIntoArray(UiArrayBinding *ast)
|
||||
{
|
||||
if (!ast)
|
||||
return;
|
||||
|
||||
@@ -46,7 +46,7 @@ FirstDefinitionFinder::FirstDefinitionFinder(const QString &text):
|
||||
|
||||
if (!ok) {
|
||||
qDebug() << text;
|
||||
foreach (const QmlJS::DiagnosticMessage &message, m_doc->diagnosticMessages())
|
||||
foreach (const DiagnosticMessage &message, m_doc->diagnosticMessages())
|
||||
qDebug() << message.message;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ void FirstDefinitionFinder::extractFirstObjectDefinition(UiObjectInitializer* as
|
||||
}
|
||||
}
|
||||
|
||||
bool FirstDefinitionFinder::visit(QmlJS::AST::UiObjectBinding *ast)
|
||||
bool FirstDefinitionFinder::visit(UiObjectBinding *ast)
|
||||
{
|
||||
if (ast->qualifiedTypeNameId && ast->qualifiedTypeNameId->identifierToken.isValid()) {
|
||||
const quint32 start = ast->qualifiedTypeNameId->identifierToken.offset;
|
||||
@@ -94,7 +94,7 @@ bool FirstDefinitionFinder::visit(QmlJS::AST::UiObjectBinding *ast)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FirstDefinitionFinder::visit(QmlJS::AST::UiObjectDefinition *ast)
|
||||
bool FirstDefinitionFinder::visit(UiObjectDefinition *ast)
|
||||
{
|
||||
const quint32 start = ast->firstSourceLocation().offset;
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ MoveObjectBeforeObjectVisitor::MoveObjectBeforeObjectVisitor(TextModifier &modif
|
||||
beforeObjectLocation(beforeObjectLocation)
|
||||
{}
|
||||
|
||||
bool MoveObjectBeforeObjectVisitor::operator ()(QmlJS::AST::UiProgram *ast)
|
||||
bool MoveObjectBeforeObjectVisitor::operator ()(UiProgram *ast)
|
||||
{
|
||||
movingObject = 0;
|
||||
beforeObject = 0;
|
||||
|
||||
@@ -36,15 +36,16 @@
|
||||
|
||||
using namespace QmlJS;
|
||||
using namespace QmlJS::AST;
|
||||
using namespace QmlDesigner::Internal;
|
||||
using namespace QmlDesigner;
|
||||
|
||||
namespace QmlDesigner {
|
||||
namespace Internal {
|
||||
|
||||
class Inserter: public QMLRewriter
|
||||
{
|
||||
public:
|
||||
Inserter(QmlDesigner::TextModifier &modifier,
|
||||
Inserter(TextModifier &modifier,
|
||||
quint32 targetParentObjectLocation,
|
||||
const QmlDesigner::PropertyName &targetPropertyName,
|
||||
const PropertyName &targetPropertyName,
|
||||
bool targetIsArrayBinding,
|
||||
TextModifier::MoveInfo moveInfo,
|
||||
const PropertyNameList &propertyOrder):
|
||||
@@ -150,15 +151,15 @@ private:
|
||||
|
||||
private:
|
||||
quint32 targetParentObjectLocation;
|
||||
QmlDesigner::PropertyName targetPropertyName;
|
||||
PropertyName targetPropertyName;
|
||||
bool targetIsArrayBinding;
|
||||
TextModifier::MoveInfo moveInfo;
|
||||
PropertyNameList propertyOrder;
|
||||
};
|
||||
|
||||
MoveObjectVisitor::MoveObjectVisitor(QmlDesigner::TextModifier &modifier,
|
||||
MoveObjectVisitor::MoveObjectVisitor(TextModifier &modifier,
|
||||
quint32 objectLocation,
|
||||
const QmlDesigner::PropertyName &targetPropertyName,
|
||||
const PropertyName &targetPropertyName,
|
||||
bool targetIsArrayBinding,
|
||||
quint32 targetParentObjectLocation,
|
||||
const PropertyNameList &propertyOrder):
|
||||
@@ -292,3 +293,6 @@ void MoveObjectVisitor::doMove(const TextModifier::MoveInfo &moveInfo)
|
||||
setDidRewriting(findTargetAndInsert(program));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace QmlDesigner
|
||||
|
||||
@@ -60,7 +60,7 @@ bool ObjectLengthCalculator::operator()(const QString &text, quint32 offset,
|
||||
}
|
||||
}
|
||||
|
||||
bool ObjectLengthCalculator::visit(QmlJS::AST::UiObjectBinding *ast)
|
||||
bool ObjectLengthCalculator::visit(UiObjectBinding *ast)
|
||||
{
|
||||
if (m_length > 0)
|
||||
return false;
|
||||
@@ -80,7 +80,7 @@ bool ObjectLengthCalculator::visit(QmlJS::AST::UiObjectBinding *ast)
|
||||
}
|
||||
}
|
||||
|
||||
bool ObjectLengthCalculator::visit(QmlJS::AST::UiObjectDefinition *ast)
|
||||
bool ObjectLengthCalculator::visit(UiObjectDefinition *ast)
|
||||
{
|
||||
if (m_length > 0)
|
||||
return false;
|
||||
|
||||
@@ -47,7 +47,7 @@ QMLRewriter::QMLRewriter(QmlDesigner::TextModifier &textModifier):
|
||||
{
|
||||
}
|
||||
|
||||
bool QMLRewriter::operator()(QmlJS::AST::UiProgram *ast)
|
||||
bool QMLRewriter::operator()(UiProgram *ast)
|
||||
{
|
||||
setDidRewriting(false);
|
||||
|
||||
@@ -71,7 +71,7 @@ QString QMLRewriter::textBetween(int startPosition, int endPosition) const
|
||||
return m_textModifier->text().mid(startPosition, endPosition - startPosition);
|
||||
}
|
||||
|
||||
QString QMLRewriter::textAt(const QmlJS::AST::SourceLocation &location) const
|
||||
QString QMLRewriter::textAt(const SourceLocation &location) const
|
||||
{
|
||||
return m_textModifier->text().mid(location.offset, location.length);
|
||||
}
|
||||
@@ -154,7 +154,7 @@ QString QMLRewriter::removeIndentation(const QString &text, unsigned depth)
|
||||
return result;
|
||||
}
|
||||
|
||||
QmlJS::AST::SourceLocation QMLRewriter::calculateLocation(QmlJS::AST::UiQualifiedId *id)
|
||||
SourceLocation QMLRewriter::calculateLocation(UiQualifiedId *id)
|
||||
{
|
||||
Q_ASSERT(id != 0);
|
||||
|
||||
@@ -170,7 +170,7 @@ QmlJS::AST::SourceLocation QMLRewriter::calculateLocation(QmlJS::AST::UiQualifie
|
||||
return SourceLocation(startLocation.offset, endLocation.end() - startLocation.offset);
|
||||
}
|
||||
|
||||
bool QMLRewriter::isMissingSemicolon(QmlJS::AST::UiObjectMember *member)
|
||||
bool QMLRewriter::isMissingSemicolon(UiObjectMember *member)
|
||||
{
|
||||
UiScriptBinding *binding = AST::cast<UiScriptBinding *>(member);
|
||||
if (binding)
|
||||
@@ -179,7 +179,7 @@ bool QMLRewriter::isMissingSemicolon(QmlJS::AST::UiObjectMember *member)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool QMLRewriter::isMissingSemicolon(QmlJS::AST::Statement *stmt)
|
||||
bool QMLRewriter::isMissingSemicolon(Statement *stmt)
|
||||
{
|
||||
if (ExpressionStatement *eStmt = AST::cast<ExpressionStatement *>(stmt)) {
|
||||
return !eStmt->semicolonToken.isValid();
|
||||
|
||||
@@ -45,7 +45,7 @@ RemovePropertyVisitor::RemovePropertyVisitor(QmlDesigner::TextModifier &modifier
|
||||
{
|
||||
}
|
||||
|
||||
bool RemovePropertyVisitor::visit(QmlJS::AST::UiObjectBinding *ast)
|
||||
bool RemovePropertyVisitor::visit(UiObjectBinding *ast)
|
||||
{
|
||||
if (ast->firstSourceLocation().offset == parentLocation) {
|
||||
//this condition is wrong for the UiObjectBinding case, but we keep it
|
||||
@@ -62,7 +62,7 @@ bool RemovePropertyVisitor::visit(QmlJS::AST::UiObjectBinding *ast)
|
||||
return !didRewriting();
|
||||
}
|
||||
|
||||
bool RemovePropertyVisitor::visit(QmlJS::AST::UiObjectDefinition *ast)
|
||||
bool RemovePropertyVisitor::visit(UiObjectDefinition *ast)
|
||||
{
|
||||
if (ast->firstSourceLocation().offset == parentLocation) {
|
||||
// FIXME: change this to use the QmlJS::Rewriter class
|
||||
@@ -73,7 +73,7 @@ bool RemovePropertyVisitor::visit(QmlJS::AST::UiObjectDefinition *ast)
|
||||
}
|
||||
|
||||
// FIXME: duplicate code in the QmlJS::Rewriter class, remove this
|
||||
void RemovePropertyVisitor::removeFrom(QmlJS::AST::UiObjectInitializer *ast)
|
||||
void RemovePropertyVisitor::removeFrom(UiObjectInitializer *ast)
|
||||
{
|
||||
QString prefix;
|
||||
int dotIdx = propertyName.indexOf(QLatin1Char('.'));
|
||||
|
||||
@@ -39,7 +39,7 @@ using namespace QmlDesigner::Internal;
|
||||
using namespace QmlJS;
|
||||
using namespace QmlJS::AST;
|
||||
|
||||
RemoveUIObjectMemberVisitor::RemoveUIObjectMemberVisitor(QmlDesigner::TextModifier &modifier,
|
||||
RemoveUIObjectMemberVisitor::RemoveUIObjectMemberVisitor(TextModifier &modifier,
|
||||
quint32 objectLocation):
|
||||
QMLRewriter(modifier),
|
||||
objectLocation(objectLocation)
|
||||
@@ -58,15 +58,15 @@ void RemoveUIObjectMemberVisitor::postVisit(Node *)
|
||||
parents.pop();
|
||||
}
|
||||
|
||||
bool RemoveUIObjectMemberVisitor::visit(QmlJS::AST::UiPublicMember *ast) { return visitObjectMember(ast); }
|
||||
bool RemoveUIObjectMemberVisitor::visit(QmlJS::AST::UiObjectDefinition *ast) { return visitObjectMember(ast); }
|
||||
bool RemoveUIObjectMemberVisitor::visit(QmlJS::AST::UiSourceElement *ast) { return visitObjectMember(ast); }
|
||||
bool RemoveUIObjectMemberVisitor::visit(QmlJS::AST::UiObjectBinding *ast) { return visitObjectMember(ast); }
|
||||
bool RemoveUIObjectMemberVisitor::visit(QmlJS::AST::UiScriptBinding *ast) { return visitObjectMember(ast); }
|
||||
bool RemoveUIObjectMemberVisitor::visit(QmlJS::AST::UiArrayBinding *ast) { return visitObjectMember(ast); }
|
||||
bool RemoveUIObjectMemberVisitor::visit(UiPublicMember *ast) { return visitObjectMember(ast); }
|
||||
bool RemoveUIObjectMemberVisitor::visit(UiObjectDefinition *ast) { return visitObjectMember(ast); }
|
||||
bool RemoveUIObjectMemberVisitor::visit(UiSourceElement *ast) { return visitObjectMember(ast); }
|
||||
bool RemoveUIObjectMemberVisitor::visit(UiObjectBinding *ast) { return visitObjectMember(ast); }
|
||||
bool RemoveUIObjectMemberVisitor::visit(UiScriptBinding *ast) { return visitObjectMember(ast); }
|
||||
bool RemoveUIObjectMemberVisitor::visit(UiArrayBinding *ast) { return visitObjectMember(ast); }
|
||||
|
||||
// FIXME: duplicate code in the QmlJS::Rewriter class, remove this
|
||||
bool RemoveUIObjectMemberVisitor::visitObjectMember(QmlJS::AST::UiObjectMember *ast)
|
||||
bool RemoveUIObjectMemberVisitor::visitObjectMember(UiObjectMember *ast)
|
||||
{
|
||||
const quint32 memberStart = ast->firstSourceLocation().offset;
|
||||
|
||||
@@ -106,8 +106,8 @@ UiArrayBinding *RemoveUIObjectMemberVisitor::containingArray() const
|
||||
}
|
||||
|
||||
// FIXME: duplicate code in the QmlJS::Rewriter class, remove this
|
||||
void RemoveUIObjectMemberVisitor::extendToLeadingOrTrailingComma(QmlJS::AST::UiArrayBinding *parentArray,
|
||||
QmlJS::AST::UiObjectMember *ast,
|
||||
void RemoveUIObjectMemberVisitor::extendToLeadingOrTrailingComma(UiArrayBinding *parentArray,
|
||||
UiObjectMember *ast,
|
||||
int &start,
|
||||
int &end) const
|
||||
{
|
||||
|
||||
@@ -135,10 +135,10 @@ static QString qualifiedTypeNameForContext(const ObjectValue *objectValue,
|
||||
foreach (const LanguageUtils::FakeMetaObject::Export &e, cppComponent->metaObject()->exports()) {
|
||||
if (e.type == className)
|
||||
packages << e.package;
|
||||
if (e.package == QmlJS::CppQmlTypes::cppPackage)
|
||||
if (e.package == CppQmlTypes::cppPackage)
|
||||
cppName = e.type;
|
||||
}
|
||||
if (packages.size() == 1 && packages.at(0) == QmlJS::CppQmlTypes::cppPackage)
|
||||
if (packages.size() == 1 && packages.at(0) == CppQmlTypes::cppPackage)
|
||||
return packages.at(0) + QLatin1Char('.') + className;
|
||||
}
|
||||
// try to recover a "global context name"
|
||||
@@ -264,7 +264,7 @@ static QString qualifiedTypeNameForContext(const ObjectValue *objectValue,
|
||||
return optimalName(possibleFiles);
|
||||
} while (false);
|
||||
if (!cppName.isEmpty())
|
||||
return QmlJS::CppQmlTypes::cppPackage + QLatin1Char('.') + cppName;
|
||||
return CppQmlTypes::cppPackage + QLatin1Char('.') + cppName;
|
||||
if (const CppComponentValue *cppComponent = value_cast<CppComponentValue>(objectValue)) {
|
||||
if (cppComponent->moduleName().isEmpty())
|
||||
return cppComponent->className();
|
||||
@@ -280,7 +280,7 @@ class PropertyMemberProcessor : public MemberProcessor
|
||||
public:
|
||||
PropertyMemberProcessor(const ContextPtr &context) : m_context(context)
|
||||
{}
|
||||
bool processProperty(const QString &name, const Value *value, const QmlJS::PropertyInfo &)
|
||||
bool processProperty(const QString &name, const Value *value, const PropertyInfo &)
|
||||
{
|
||||
PropertyName propertyName = name.toUtf8();
|
||||
const ASTPropertyReference *ref = value_cast<ASTPropertyReference>(value);
|
||||
@@ -567,13 +567,13 @@ public:
|
||||
private:
|
||||
NodeMetaInfoPrivate(Model *model, TypeName type, int maj = -1, int min = -1);
|
||||
|
||||
const QmlJS::CppComponentValue *getCppComponentValue() const;
|
||||
const QmlJS::ObjectValue *getObjectValue() const;
|
||||
const CppComponentValue *getCppComponentValue() const;
|
||||
const ObjectValue *getObjectValue() const;
|
||||
void setupPropertyInfo(QList<PropertyInfo> propertyInfos);
|
||||
void setupLocalPropertyInfo(QList<PropertyInfo> propertyInfos);
|
||||
QString lookupName() const;
|
||||
QStringList lookupNameComponent() const;
|
||||
const QmlJS::CppComponentValue *getNearestCppComponentValue() const;
|
||||
const CppComponentValue *getNearestCppComponentValue() const;
|
||||
QString fullQualifiedImportAliasType() const;
|
||||
|
||||
TypeName m_qualfiedTypeName;
|
||||
@@ -591,7 +591,7 @@ private:
|
||||
QSet<QString> m_prototypeCacheNegatives;
|
||||
|
||||
//storing the pointer would not be save
|
||||
QmlJS::ContextPtr context() const;
|
||||
ContextPtr context() const;
|
||||
const Document *document() const;
|
||||
|
||||
QPointer<Model> m_model;
|
||||
@@ -721,7 +721,7 @@ NodeMetaInfoPrivate::NodeMetaInfoPrivate(Model *model, TypeName type, int maj, i
|
||||
}
|
||||
}
|
||||
|
||||
const QmlJS::CppComponentValue *NodeMetaInfoPrivate::getCppComponentValue() const
|
||||
const CppComponentValue *NodeMetaInfoPrivate::getCppComponentValue() const
|
||||
{
|
||||
const QList<TypeName> nameComponents = m_qualfiedTypeName.split('.');
|
||||
if (nameComponents.size() < 2)
|
||||
@@ -748,29 +748,29 @@ const QmlJS::CppComponentValue *NodeMetaInfoPrivate::getCppComponentValue() cons
|
||||
return cppValue;
|
||||
}
|
||||
|
||||
const QmlJS::CppComponentValue *value = value_cast<CppComponentValue>(getObjectValue());
|
||||
const CppComponentValue *value = value_cast<CppComponentValue>(getObjectValue());
|
||||
if (value)
|
||||
return value;
|
||||
|
||||
// maybe 'type' is a cpp name
|
||||
const QmlJS::CppComponentValue *cppValue = context()->valueOwner()->cppQmlTypes().objectByCppName(type);
|
||||
const CppComponentValue *cppValue = context()->valueOwner()->cppQmlTypes().objectByCppName(type);
|
||||
|
||||
return cppValue;
|
||||
}
|
||||
|
||||
const QmlJS::ObjectValue *NodeMetaInfoPrivate::getObjectValue() const
|
||||
const ObjectValue *NodeMetaInfoPrivate::getObjectValue() const
|
||||
{
|
||||
return context()->lookupType(document(), lookupNameComponent());
|
||||
}
|
||||
|
||||
QmlJS::ContextPtr NodeMetaInfoPrivate::context() const
|
||||
ContextPtr NodeMetaInfoPrivate::context() const
|
||||
{
|
||||
if (m_model && m_model->rewriterView() && m_model->rewriterView()->scopeChain())
|
||||
return m_model->rewriterView()->scopeChain()->context();
|
||||
return QmlJS::ContextPtr(0);
|
||||
return ContextPtr(0);
|
||||
}
|
||||
|
||||
const QmlJS::Document *NodeMetaInfoPrivate::document() const
|
||||
const Document *NodeMetaInfoPrivate::document() const
|
||||
{
|
||||
if (m_model && m_model->rewriterView())
|
||||
return m_model->rewriterView()->document();
|
||||
@@ -815,7 +815,7 @@ bool NodeMetaInfoPrivate::isPropertyWritable(const PropertyName &propertyName) c
|
||||
return true;
|
||||
}
|
||||
|
||||
const QmlJS::CppComponentValue *qmlObjectValue = getNearestCppComponentValue();
|
||||
const CppComponentValue *qmlObjectValue = getNearestCppComponentValue();
|
||||
if (!qmlObjectValue)
|
||||
return true;
|
||||
if (qmlObjectValue->hasProperty(propertyName))
|
||||
@@ -846,7 +846,7 @@ bool NodeMetaInfoPrivate::isPropertyList(const PropertyName &propertyName) const
|
||||
return true;
|
||||
}
|
||||
|
||||
const QmlJS::CppComponentValue *qmlObjectValue = getNearestCppComponentValue();
|
||||
const CppComponentValue *qmlObjectValue = getNearestCppComponentValue();
|
||||
if (!qmlObjectValue)
|
||||
return false;
|
||||
return qmlObjectValue->isListProperty(propertyName);
|
||||
@@ -873,7 +873,7 @@ bool NodeMetaInfoPrivate::isPropertyPointer(const PropertyName &propertyName) co
|
||||
return true;
|
||||
}
|
||||
|
||||
const QmlJS::CppComponentValue *qmlObjectValue = getNearestCppComponentValue();
|
||||
const CppComponentValue *qmlObjectValue = getNearestCppComponentValue();
|
||||
if (!qmlObjectValue)
|
||||
return false;
|
||||
return qmlObjectValue->isPointer(propertyName);
|
||||
@@ -1239,7 +1239,7 @@ QList<TypeDescription> NodeMetaInfoPrivate::prototypes() const
|
||||
return m_prototypes;
|
||||
}
|
||||
|
||||
const QmlJS::CppComponentValue *NodeMetaInfoPrivate::getNearestCppComponentValue() const
|
||||
const CppComponentValue *NodeMetaInfoPrivate::getNearestCppComponentValue() const
|
||||
{
|
||||
if (m_isFileComponent)
|
||||
return findQmlPrototype(getObjectValue(), context());
|
||||
|
||||
@@ -243,7 +243,7 @@ void ModelToTextMerger::applyChanges()
|
||||
ModelNodePositionRecalculator positionRecalculator(m_rewriterView->positionStorage(), m_rewriterView->positionStorage()->modelNodes());
|
||||
positionRecalculator.connectTo(textModifier);
|
||||
|
||||
QmlDesigner::QmlRefactoring refactoring(tmpDocument, *textModifier, getPropertyOrder());
|
||||
QmlRefactoring refactoring(tmpDocument, *textModifier, getPropertyOrder());
|
||||
|
||||
textModifier->deactivateChangeSignals();
|
||||
textModifier->startGroup();
|
||||
@@ -312,26 +312,26 @@ void ModelToTextMerger::schedule(RewriteAction *action)
|
||||
m_rewriteActions.append(action);
|
||||
}
|
||||
|
||||
QmlDesigner::QmlRefactoring::PropertyType ModelToTextMerger::propertyType(const AbstractProperty &property, const QString &textValue)
|
||||
QmlRefactoring::PropertyType ModelToTextMerger::propertyType(const AbstractProperty &property, const QString &textValue)
|
||||
{
|
||||
if (property.isBindingProperty() || property.isSignalHandlerProperty()) {
|
||||
QString val = textValue.trimmed();
|
||||
if (val.isEmpty())
|
||||
return QmlDesigner::QmlRefactoring::ObjectBinding;
|
||||
return QmlRefactoring::ObjectBinding;
|
||||
const QChar lastChar = val.at(val.size() - 1);
|
||||
if (lastChar == '}' || lastChar == ';')
|
||||
return QmlDesigner::QmlRefactoring::ObjectBinding;
|
||||
return QmlRefactoring::ObjectBinding;
|
||||
else
|
||||
return QmlDesigner::QmlRefactoring::ScriptBinding;
|
||||
return QmlRefactoring::ScriptBinding;
|
||||
} else if (property.isNodeListProperty())
|
||||
return QmlDesigner::QmlRefactoring::ArrayBinding;
|
||||
return QmlRefactoring::ArrayBinding;
|
||||
else if (property.isNodeProperty())
|
||||
return QmlDesigner::QmlRefactoring::ObjectBinding;
|
||||
return QmlRefactoring::ObjectBinding;
|
||||
else if (property.isVariantProperty())
|
||||
return QmlDesigner::QmlRefactoring::ScriptBinding;
|
||||
return QmlRefactoring::ScriptBinding;
|
||||
|
||||
Q_ASSERT(!"cannot convert property type");
|
||||
return (QmlDesigner::QmlRefactoring::PropertyType) -1;
|
||||
return (QmlRefactoring::PropertyType) -1;
|
||||
}
|
||||
|
||||
PropertyNameList ModelToTextMerger::m_propertyOrder;
|
||||
|
||||
@@ -127,7 +127,7 @@ QString AddPropertyRewriteAction::info() const
|
||||
return QStringLiteral("AddPropertyRewriteAction for property \"%1\" (type: %2)").arg(m_property.name(), toString(m_propertyType));
|
||||
}
|
||||
|
||||
bool ChangeIdRewriteAction::execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore)
|
||||
bool ChangeIdRewriteAction::execute(QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore)
|
||||
{
|
||||
const int nodeLocation = positionStore.nodeOffset(m_node);
|
||||
static const PropertyName idPropertyName("id");
|
||||
@@ -172,7 +172,7 @@ QString ChangeIdRewriteAction::info() const
|
||||
return QString("ChangeIdRewriteAction from \"%1\" to \"%2\"").arg(m_oldId, m_newId);
|
||||
}
|
||||
|
||||
bool ChangePropertyRewriteAction::execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore)
|
||||
bool ChangePropertyRewriteAction::execute(QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore)
|
||||
{
|
||||
const int nodeLocation = positionStore.nodeOffset(m_property.parentModelNode());
|
||||
bool result = false;
|
||||
@@ -222,7 +222,7 @@ QString ChangePropertyRewriteAction::info() const
|
||||
(m_containedModelNode.isValid() ? m_containedModelNode.id() : "(none)"));
|
||||
}
|
||||
|
||||
bool ChangeTypeRewriteAction::execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore)
|
||||
bool ChangeTypeRewriteAction::execute(QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore)
|
||||
{
|
||||
const int nodeLocation = positionStore.nodeOffset(m_node);
|
||||
bool result = false;
|
||||
@@ -248,7 +248,7 @@ QString ChangeTypeRewriteAction::info() const
|
||||
return QString("ChangeTypeRewriteAction");
|
||||
}
|
||||
|
||||
bool RemoveNodeRewriteAction::execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore)
|
||||
bool RemoveNodeRewriteAction::execute(QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore)
|
||||
{
|
||||
const int nodeLocation = positionStore.nodeOffset(m_node);
|
||||
bool result = refactoring.removeObject(nodeLocation);
|
||||
@@ -266,7 +266,7 @@ QString RemoveNodeRewriteAction::info() const
|
||||
return QString("RemoveNodeRewriteAction");
|
||||
}
|
||||
|
||||
bool RemovePropertyRewriteAction::execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore)
|
||||
bool RemovePropertyRewriteAction::execute(QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore)
|
||||
{
|
||||
const int nodeLocation = positionStore.nodeOffset(m_property.parentModelNode());
|
||||
bool result = refactoring.removeProperty(nodeLocation, m_property.name());
|
||||
@@ -285,7 +285,7 @@ QString RemovePropertyRewriteAction::info() const
|
||||
return QStringLiteral("RemovePropertyRewriteAction for property \"%1\"").arg(QLatin1String(m_property.name()));
|
||||
}
|
||||
|
||||
bool ReparentNodeRewriteAction::execute(QmlDesigner::QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore)
|
||||
bool ReparentNodeRewriteAction::execute(QmlRefactoring &refactoring, ModelNodePositionStorage &positionStore)
|
||||
{
|
||||
const int nodeLocation = positionStore.nodeOffset(m_node);
|
||||
const int targetParentObjectLocation = positionStore.nodeOffset(m_targetProperty.parentModelNode());
|
||||
@@ -352,7 +352,7 @@ QString MoveNodeRewriteAction::info() const
|
||||
}
|
||||
}
|
||||
|
||||
bool AddImportRewriteAction::execute(QmlDesigner::QmlRefactoring &refactoring,
|
||||
bool AddImportRewriteAction::execute(QmlRefactoring &refactoring,
|
||||
ModelNodePositionStorage &/*positionStore*/)
|
||||
{
|
||||
const bool result = refactoring.addImport(m_import);
|
||||
@@ -370,7 +370,7 @@ QString AddImportRewriteAction::info() const
|
||||
return toInfo(m_import);
|
||||
}
|
||||
|
||||
bool RemoveImportRewriteAction::execute(QmlDesigner::QmlRefactoring &refactoring,
|
||||
bool RemoveImportRewriteAction::execute(QmlRefactoring &refactoring,
|
||||
ModelNodePositionStorage &/*positionStore*/)
|
||||
{
|
||||
const bool result = refactoring.removeImport(m_import);
|
||||
|
||||
@@ -323,7 +323,7 @@ public:
|
||||
: m_snapshot(snapshot)
|
||||
, m_doc(doc)
|
||||
, m_link(snapshot, vContext,
|
||||
QmlJS::ModelManagerInterface::instance()->builtins(doc))
|
||||
ModelManagerInterface::instance()->builtins(doc))
|
||||
, m_context(m_link(doc, &m_diagnosticLinkMessages))
|
||||
, m_scopeChain(doc, m_context)
|
||||
, m_scopeBuilder(&m_scopeChain)
|
||||
@@ -854,14 +854,14 @@ bool TextToModelMerger::load(const QString &data, DifferenceHandler &differenceH
|
||||
|
||||
if (!doc->isParsedCorrectly()) {
|
||||
QList<RewriterView::Error> errors;
|
||||
foreach (const QmlJS::DiagnosticMessage &message, doc->diagnosticMessages())
|
||||
foreach (const DiagnosticMessage &message, doc->diagnosticMessages())
|
||||
errors.append(RewriterView::Error(message, QUrl::fromLocalFile(doc->fileName())));
|
||||
m_rewriterView->setErrors(errors);
|
||||
setActive(false);
|
||||
return false;
|
||||
}
|
||||
snapshot.insert(doc);
|
||||
m_vContext = QmlJS::ModelManagerInterface::instance()->defaultVContext(Dialect::Qml, doc, true);
|
||||
m_vContext = ModelManagerInterface::instance()->defaultVContext(Dialect::Qml, doc, true);
|
||||
ReadingContext ctxt(snapshot, doc, m_vContext);
|
||||
m_scopeChain = QSharedPointer<const ScopeChain>(
|
||||
new ScopeChain(ctxt.scopeChain()));
|
||||
@@ -870,7 +870,7 @@ bool TextToModelMerger::load(const QString &data, DifferenceHandler &differenceH
|
||||
QList<RewriterView::Error> errors;
|
||||
QList<RewriterView::Error> warnings;
|
||||
|
||||
foreach (const QmlJS::DiagnosticMessage &diagnosticMessage, ctxt.diagnosticLinkMessages()) {
|
||||
foreach (const DiagnosticMessage &diagnosticMessage, ctxt.diagnosticLinkMessages()) {
|
||||
errors.append(RewriterView::Error(diagnosticMessage, QUrl::fromLocalFile(doc->fileName())));
|
||||
}
|
||||
|
||||
@@ -878,13 +878,13 @@ bool TextToModelMerger::load(const QString &data, DifferenceHandler &differenceH
|
||||
setupPossibleImports(snapshot, m_vContext);
|
||||
|
||||
if (m_rewriterView->model()->imports().isEmpty()) {
|
||||
const QmlJS::DiagnosticMessage diagnosticMessage(QmlJS::Severity::Error, AST::SourceLocation(0, 0, 0, 0), QCoreApplication::translate("QmlDesigner::TextToModelMerger", "No import statements found"));
|
||||
const DiagnosticMessage diagnosticMessage(Severity::Error, AST::SourceLocation(0, 0, 0, 0), QCoreApplication::translate("QmlDesigner::TextToModelMerger", "No import statements found"));
|
||||
errors.append(RewriterView::Error(diagnosticMessage, QUrl::fromLocalFile(doc->fileName())));
|
||||
}
|
||||
|
||||
foreach (const QmlDesigner::Import &import, m_rewriterView->model()->imports()) {
|
||||
if (import.isLibraryImport() && import.url() == QStringLiteral("QtQuick") && !supportedQtQuickVersion(import.version())) {
|
||||
const QmlJS::DiagnosticMessage diagnosticMessage(QmlJS::Severity::Error, AST::SourceLocation(0, 0, 0, 0),
|
||||
const DiagnosticMessage diagnosticMessage(Severity::Error, AST::SourceLocation(0, 0, 0, 0),
|
||||
QCoreApplication::translate("QmlDesigner::TextToModelMerger", "Unsupported QtQuick version"));
|
||||
errors.append(RewriterView::Error(diagnosticMessage, QUrl::fromLocalFile(doc->fileName())));
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ QmlExpressionUnderCursor::QmlExpressionUnderCursor()
|
||||
: _expressionNode(0), _expressionOffset(0), _expressionLength(0)
|
||||
{}
|
||||
|
||||
QmlJS::AST::ExpressionNode *QmlExpressionUnderCursor::operator()(const QTextCursor &cursor)
|
||||
ExpressionNode *QmlExpressionUnderCursor::operator()(const QTextCursor &cursor)
|
||||
{
|
||||
_expressionNode = 0;
|
||||
_expressionOffset = -1;
|
||||
@@ -152,4 +152,3 @@ ExpressionNode *QmlExpressionUnderCursor::expressionNode() const
|
||||
{
|
||||
return _expressionNode;
|
||||
}
|
||||
|
||||
|
||||
@@ -651,7 +651,7 @@ IAssistProposal *QmlJSCompletionAssistProcessor::perform(const AssistInterface *
|
||||
|
||||
// currently path-in-stringliteral is the only completion available in imports
|
||||
if (contextFinder.isInImport()) {
|
||||
QmlJS::ModelManagerInterface::ProjectInfo pInfo = QmlJS::ModelManagerInterface::instance()
|
||||
ModelManagerInterface::ProjectInfo pInfo = ModelManagerInterface::instance()
|
||||
->projectInfo(ProjectExplorer::ProjectTree::currentProject());
|
||||
QmlBundle platform = pInfo.extendedBundle.bundleForLanguage(document->language());
|
||||
if (!platform.supportedImports().isEmpty()) {
|
||||
@@ -661,8 +661,8 @@ IAssistProposal *QmlJSCompletionAssistProcessor::perform(const AssistInterface *
|
||||
expressionUnderCursor(tc);
|
||||
QString libVersion = contextFinder.libVersionImport();
|
||||
if (!libVersion.isNull()) {
|
||||
QStringList completions=platform.supportedImports().complete(libVersion, QString(), QmlJS::PersistentTrie::LookupFlags(QmlJS::PersistentTrie::CaseInsensitive|QmlJS::PersistentTrie::SkipChars|QmlJS::PersistentTrie::SkipSpaces));
|
||||
completions = QmlJS::PersistentTrie::matchStrengthSort(libVersion, completions);
|
||||
QStringList completions=platform.supportedImports().complete(libVersion, QString(), PersistentTrie::LookupFlags(PersistentTrie::CaseInsensitive|PersistentTrie::SkipChars|PersistentTrie::SkipSpaces));
|
||||
completions = PersistentTrie::matchStrengthSort(libVersion, completions);
|
||||
|
||||
int toSkip = qMax(libVersion.lastIndexOf(QLatin1Char(' '))
|
||||
, libVersion.lastIndexOf(QLatin1Char('.')));
|
||||
@@ -691,7 +691,7 @@ IAssistProposal *QmlJSCompletionAssistProcessor::perform(const AssistInterface *
|
||||
tc.setPosition(m_startPosition - 1);
|
||||
|
||||
QmlExpressionUnderCursor expressionUnderCursor;
|
||||
QmlJS::AST::ExpressionNode *expression = expressionUnderCursor(tc);
|
||||
AST::ExpressionNode *expression = expressionUnderCursor(tc);
|
||||
|
||||
if (expression != 0 && ! isLiteral(expression)) {
|
||||
// Evaluate the expression under cursor.
|
||||
|
||||
@@ -134,8 +134,8 @@ void QmlJSEditorWidget::finalizeInitialization()
|
||||
|
||||
textDocument()->setCodec(QTextCodec::codecForName("UTF-8")); // qml files are defined to be utf-8
|
||||
|
||||
m_modelManager = QmlJS::ModelManagerInterface::instance();
|
||||
m_contextPane = ExtensionSystem::PluginManager::getObject<QmlJS::IContextPane>();
|
||||
m_modelManager = ModelManagerInterface::instance();
|
||||
m_contextPane = ExtensionSystem::PluginManager::getObject<IContextPane>();
|
||||
|
||||
m_modelManager->activateScan();
|
||||
|
||||
@@ -207,7 +207,7 @@ static void appendExtraSelectionsForMessages(
|
||||
}
|
||||
}
|
||||
|
||||
void QmlJSEditorWidget::updateCodeWarnings(QmlJS::Document::Ptr doc)
|
||||
void QmlJSEditorWidget::updateCodeWarnings(Document::Ptr doc)
|
||||
{
|
||||
if (doc->ast()) {
|
||||
setExtraSelections(CodeWarningsSelection, QList<QTextEdit::ExtraSelection>());
|
||||
@@ -348,7 +348,7 @@ void QmlJSEditorWidget::updateUses()
|
||||
continue;
|
||||
|
||||
QTextEdit::ExtraSelection sel;
|
||||
sel.format = textDocument()->fontSettings().toTextCharFormat(TextEditor::C_OCCURRENCES);
|
||||
sel.format = textDocument()->fontSettings().toTextCharFormat(C_OCCURRENCES);
|
||||
sel.cursor = textCursor();
|
||||
sel.cursor.setPosition(loc.begin());
|
||||
sel.cursor.setPosition(loc.end(), QTextCursor::KeepAnchor);
|
||||
@@ -791,7 +791,7 @@ void QmlJSEditorWidget::semanticInfoUpdated(const SemanticInfo &semanticInfo)
|
||||
if (m_firstSementicInfo) {
|
||||
m_firstSementicInfo = false;
|
||||
if (semanticInfo.document->language() == Dialect::QmlQtQuick2Ui) {
|
||||
Core::InfoBarEntry info(Core::Id(Constants::QML_UI_FILE_WARNING),
|
||||
InfoBarEntry info(Id(Constants::QML_UI_FILE_WARNING),
|
||||
tr("This file should only be edited in <b>Design</b> mode."));
|
||||
info.setCustomButtonInfo(tr("Switch Mode"), []() { ModeManager::activateMode(Core::Constants::MODE_DESIGN); });
|
||||
textDocument()->infoBar()->addInfo(info);
|
||||
@@ -840,16 +840,16 @@ bool QmlJSEditorWidget::hideContextPane()
|
||||
}
|
||||
|
||||
AssistInterface *QmlJSEditorWidget::createAssistInterface(
|
||||
TextEditor::AssistKind assistKind,
|
||||
TextEditor::AssistReason reason) const
|
||||
AssistKind assistKind,
|
||||
AssistReason reason) const
|
||||
{
|
||||
if (assistKind == TextEditor::Completion) {
|
||||
if (assistKind == Completion) {
|
||||
return new QmlJSCompletionAssistInterface(document(),
|
||||
position(),
|
||||
textDocument()->filePath().toString(),
|
||||
reason,
|
||||
m_qmlJsEditorDocument->semanticInfo());
|
||||
} else if (assistKind == TextEditor::QuickFix) {
|
||||
} else if (assistKind == QuickFix) {
|
||||
return new QmlJSQuickFixAssistInterface(const_cast<QmlJSEditorWidget *>(this), reason);
|
||||
}
|
||||
return 0;
|
||||
@@ -868,7 +868,7 @@ QString QmlJSEditorWidget::foldReplacementText(const QTextBlock &block) const
|
||||
return QLatin1String("id: ") + objectId + QLatin1String("...");
|
||||
}
|
||||
|
||||
return TextEditor::TextEditorWidget::foldReplacementText(block);
|
||||
return TextEditorWidget::foldReplacementText(block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -89,8 +89,8 @@ QmlJSEditorPlugin::QmlJSEditorPlugin() :
|
||||
m_reformatFileAction(0),
|
||||
m_currentDocument(0),
|
||||
m_jsonManager(new Utils::JsonSchemaManager(
|
||||
QStringList() << Core::ICore::userResourcePath() + QLatin1String("/json/")
|
||||
<< Core::ICore::resourcePath() + QLatin1String("/json/")))
|
||||
QStringList() << ICore::userResourcePath() + QLatin1String("/json/")
|
||||
<< ICore::resourcePath() + QLatin1String("/json/")))
|
||||
{
|
||||
m_instance = this;
|
||||
}
|
||||
@@ -119,63 +119,63 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
|
||||
connect(m_modelManager, SIGNAL(aboutToRemoveFiles(QStringList)),
|
||||
m_qmlTaskManager, SLOT(documentsRemoved(QStringList)));
|
||||
|
||||
Core::Context context(Constants::C_QMLJSEDITOR_ID);
|
||||
Context context(Constants::C_QMLJSEDITOR_ID);
|
||||
|
||||
addAutoReleasedObject(new QmlJSEditorFactory);
|
||||
|
||||
Core::ActionContainer *contextMenu = Core::ActionManager::createMenu(Constants::M_CONTEXT);
|
||||
Core::ActionContainer *qmlToolsMenu = Core::ActionManager::actionContainer(Core::Id(QmlJSTools::Constants::M_TOOLS_QMLJS));
|
||||
ActionContainer *contextMenu = ActionManager::createMenu(Constants::M_CONTEXT);
|
||||
ActionContainer *qmlToolsMenu = ActionManager::actionContainer(Id(QmlJSTools::Constants::M_TOOLS_QMLJS));
|
||||
|
||||
Core::Context globalContext(Core::Constants::C_GLOBAL);
|
||||
Context globalContext(Core::Constants::C_GLOBAL);
|
||||
qmlToolsMenu->addSeparator(globalContext);
|
||||
|
||||
Core::Command *cmd;
|
||||
cmd = Core::ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR);
|
||||
Command *cmd;
|
||||
cmd = ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR);
|
||||
contextMenu->addAction(cmd);
|
||||
qmlToolsMenu->addAction(cmd);
|
||||
|
||||
QAction *findUsagesAction = new QAction(tr("Find Usages"), this);
|
||||
cmd = Core::ActionManager::registerAction(findUsagesAction, Constants::FIND_USAGES, context);
|
||||
cmd = ActionManager::registerAction(findUsagesAction, Constants::FIND_USAGES, context);
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+U")));
|
||||
connect(findUsagesAction, SIGNAL(triggered()), this, SLOT(findUsages()));
|
||||
contextMenu->addAction(cmd);
|
||||
qmlToolsMenu->addAction(cmd);
|
||||
|
||||
QAction *renameUsagesAction = new QAction(tr("Rename Symbol Under Cursor"), this);
|
||||
cmd = Core::ActionManager::registerAction(renameUsagesAction, Constants::RENAME_USAGES, context);
|
||||
cmd = ActionManager::registerAction(renameUsagesAction, Constants::RENAME_USAGES, context);
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+R")));
|
||||
connect(renameUsagesAction, SIGNAL(triggered()), this, SLOT(renameUsages()));
|
||||
contextMenu->addAction(cmd);
|
||||
qmlToolsMenu->addAction(cmd);
|
||||
|
||||
QAction *semanticScan = new QAction(tr("Run Checks"), this);
|
||||
cmd = Core::ActionManager::registerAction(semanticScan, Core::Id(Constants::RUN_SEMANTIC_SCAN), globalContext);
|
||||
cmd = ActionManager::registerAction(semanticScan, Id(Constants::RUN_SEMANTIC_SCAN), globalContext);
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+C")));
|
||||
connect(semanticScan, SIGNAL(triggered()), this, SLOT(runSemanticScan()));
|
||||
qmlToolsMenu->addAction(cmd);
|
||||
|
||||
m_reformatFileAction = new QAction(tr("Reformat File"), this);
|
||||
cmd = Core::ActionManager::registerAction(m_reformatFileAction, Core::Id(Constants::REFORMAT_FILE), context);
|
||||
cmd = ActionManager::registerAction(m_reformatFileAction, Id(Constants::REFORMAT_FILE), context);
|
||||
connect(m_reformatFileAction, SIGNAL(triggered()), this, SLOT(reformatFile()));
|
||||
qmlToolsMenu->addAction(cmd);
|
||||
|
||||
QAction *showQuickToolbar = new QAction(tr("Show Qt Quick Toolbar"), this);
|
||||
cmd = Core::ActionManager::registerAction(showQuickToolbar, Constants::SHOW_QT_QUICK_HELPER, context);
|
||||
cmd->setDefaultKeySequence(Core::UseMacShortcuts ? QKeySequence(Qt::META + Qt::ALT + Qt::Key_Space)
|
||||
cmd = ActionManager::registerAction(showQuickToolbar, Constants::SHOW_QT_QUICK_HELPER, context);
|
||||
cmd->setDefaultKeySequence(UseMacShortcuts ? QKeySequence(Qt::META + Qt::ALT + Qt::Key_Space)
|
||||
: QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Space));
|
||||
connect(showQuickToolbar, SIGNAL(triggered()), this, SLOT(showContextPane()));
|
||||
contextMenu->addAction(cmd);
|
||||
qmlToolsMenu->addAction(cmd);
|
||||
|
||||
// Insert marker for "Refactoring" menu:
|
||||
Core::Command *sep = contextMenu->addSeparator(globalContext);
|
||||
Command *sep = contextMenu->addSeparator(globalContext);
|
||||
sep->action()->setObjectName(QLatin1String(Constants::M_REFACTORING_MENU_INSERTION_POINT));
|
||||
contextMenu->addSeparator(globalContext);
|
||||
|
||||
cmd = Core::ActionManager::command(TextEditor::Constants::AUTO_INDENT_SELECTION);
|
||||
cmd = ActionManager::command(TextEditor::Constants::AUTO_INDENT_SELECTION);
|
||||
contextMenu->addAction(cmd);
|
||||
|
||||
cmd = Core::ActionManager::command(TextEditor::Constants::UN_COMMENT_SELECTION);
|
||||
cmd = ActionManager::command(TextEditor::Constants::UN_COMMENT_SELECTION);
|
||||
contextMenu->addAction(cmd);
|
||||
|
||||
m_quickFixAssistProvider = new QmlJSQuickFixAssistProvider;
|
||||
@@ -183,14 +183,14 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
|
||||
|
||||
errorMessage->clear();
|
||||
|
||||
Core::FileIconProvider::registerIconOverlayForSuffix(":/qmljseditor/images/qmlfile.png", "qml");
|
||||
FileIconProvider::registerIconOverlayForSuffix(":/qmljseditor/images/qmlfile.png", "qml");
|
||||
|
||||
registerQuickFixes(this);
|
||||
|
||||
addAutoReleasedObject(new QmlJSOutlineWidgetFactory);
|
||||
|
||||
addAutoReleasedObject(new QuickToolBar);
|
||||
addAutoReleasedObject(new Internal::QuickToolBarSettingsPage);
|
||||
addAutoReleasedObject(new QuickToolBarSettingsPage);
|
||||
|
||||
connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)), SLOT(currentEditorChanged(Core::IEditor*)));
|
||||
|
||||
@@ -217,13 +217,13 @@ Utils::JsonSchemaManager *QmlJSEditorPlugin::jsonManager() const
|
||||
|
||||
void QmlJSEditorPlugin::findUsages()
|
||||
{
|
||||
if (QmlJSEditorWidget *editor = qobject_cast<QmlJSEditorWidget*>(Core::EditorManager::currentEditor()->widget()))
|
||||
if (QmlJSEditorWidget *editor = qobject_cast<QmlJSEditorWidget*>(EditorManager::currentEditor()->widget()))
|
||||
editor->findUsages();
|
||||
}
|
||||
|
||||
void QmlJSEditorPlugin::renameUsages()
|
||||
{
|
||||
if (QmlJSEditorWidget *editor = qobject_cast<QmlJSEditorWidget*>(Core::EditorManager::currentEditor()->widget()))
|
||||
if (QmlJSEditorWidget *editor = qobject_cast<QmlJSEditorWidget*>(EditorManager::currentEditor()->widget()))
|
||||
editor->renameUsages();
|
||||
}
|
||||
|
||||
@@ -242,15 +242,15 @@ void QmlJSEditorPlugin::reformatFile()
|
||||
|
||||
void QmlJSEditorPlugin::showContextPane()
|
||||
{
|
||||
if (QmlJSEditorWidget *editor = qobject_cast<QmlJSEditorWidget*>(Core::EditorManager::currentEditor()->widget()))
|
||||
if (QmlJSEditorWidget *editor = qobject_cast<QmlJSEditorWidget*>(EditorManager::currentEditor()->widget()))
|
||||
editor->showContextPane();
|
||||
}
|
||||
|
||||
Core::Command *QmlJSEditorPlugin::addToolAction(QAction *a,
|
||||
Core::Context &context, Core::Id id,
|
||||
Core::ActionContainer *c1, const QString &keySequence)
|
||||
Command *QmlJSEditorPlugin::addToolAction(QAction *a,
|
||||
Context &context, Id id,
|
||||
ActionContainer *c1, const QString &keySequence)
|
||||
{
|
||||
Core::Command *command = Core::ActionManager::registerAction(a, id, context);
|
||||
Command *command = ActionManager::registerAction(a, id, context);
|
||||
if (!keySequence.isEmpty())
|
||||
command->setDefaultKeySequence(QKeySequence(keySequence));
|
||||
c1->addAction(command);
|
||||
@@ -262,7 +262,7 @@ QmlJSQuickFixAssistProvider *QmlJSEditorPlugin::quickFixAssistProvider() const
|
||||
return m_quickFixAssistProvider;
|
||||
}
|
||||
|
||||
void QmlJSEditorPlugin::currentEditorChanged(Core::IEditor *editor)
|
||||
void QmlJSEditorPlugin::currentEditorChanged(IEditor *editor)
|
||||
{
|
||||
QmlJSEditorDocument *document = 0;
|
||||
if (editor)
|
||||
|
||||
@@ -834,7 +834,7 @@ static void find_helper(QFutureInterface<FindReferences::Usage> &future,
|
||||
if (!doc)
|
||||
return;
|
||||
|
||||
QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance();
|
||||
ModelManagerInterface *modelManager = ModelManagerInterface::instance();
|
||||
|
||||
Link link(snapshot, modelManager->defaultVContext(doc->language(), doc), modelManager->builtins(doc));
|
||||
ContextPtr context = link();
|
||||
@@ -957,12 +957,12 @@ void FindReferences::displayResults(int first, int last)
|
||||
const QString label = tr("QML/JS Usages:");
|
||||
|
||||
if (replacement.isEmpty()) {
|
||||
m_currentSearch = Core::SearchResultWindow::instance()->startNewSearch(
|
||||
label, QString(), symbolName, Core::SearchResultWindow::SearchOnly);
|
||||
m_currentSearch = SearchResultWindow::instance()->startNewSearch(
|
||||
label, QString(), symbolName, SearchResultWindow::SearchOnly);
|
||||
} else {
|
||||
m_currentSearch = Core::SearchResultWindow::instance()->startNewSearch(
|
||||
label, QString(), symbolName, Core::SearchResultWindow::SearchAndReplace,
|
||||
Core::SearchResultWindow::PreserveCaseDisabled);
|
||||
m_currentSearch = SearchResultWindow::instance()->startNewSearch(
|
||||
label, QString(), symbolName, SearchResultWindow::SearchAndReplace,
|
||||
SearchResultWindow::PreserveCaseDisabled);
|
||||
m_currentSearch->setTextToReplace(replacement);
|
||||
connect(m_currentSearch, SIGNAL(replaceButtonClicked(QString,QList<Core::SearchResultItem>,bool)),
|
||||
SLOT(onReplaceButtonClicked(QString,QList<Core::SearchResultItem>,bool)));
|
||||
@@ -971,7 +971,7 @@ void FindReferences::displayResults(int first, int last)
|
||||
this, SLOT(openEditor(Core::SearchResultItem)));
|
||||
connect(m_currentSearch, SIGNAL(cancelled()), this, SLOT(cancel()));
|
||||
connect(m_currentSearch, SIGNAL(paused(bool)), this, SLOT(setPaused(bool)));
|
||||
Core::SearchResultWindow::instance()->popup(IOutputPane::Flags(IOutputPane::ModeSwitch | IOutputPane::WithFocus));
|
||||
SearchResultWindow::instance()->popup(IOutputPane::Flags(IOutputPane::ModeSwitch | IOutputPane::WithFocus));
|
||||
|
||||
FutureProgress *progress = ProgressManager::addTask(
|
||||
m_watcher.future(), tr("Searching for Usages"),
|
||||
@@ -1014,7 +1014,7 @@ void FindReferences::setPaused(bool paused)
|
||||
m_watcher.setPaused(paused);
|
||||
}
|
||||
|
||||
void FindReferences::openEditor(const Core::SearchResultItem &item)
|
||||
void FindReferences::openEditor(const SearchResultItem &item)
|
||||
{
|
||||
if (item.path.size() > 0) {
|
||||
EditorManager::openEditorAt(QDir::fromNativeSeparators(item.path.first()),
|
||||
@@ -1024,7 +1024,7 @@ void FindReferences::openEditor(const Core::SearchResultItem &item)
|
||||
}
|
||||
}
|
||||
|
||||
void FindReferences::onReplaceButtonClicked(const QString &text, const QList<Core::SearchResultItem> &items, bool preserveCase)
|
||||
void FindReferences::onReplaceButtonClicked(const QString &text, const QList<SearchResultItem> &items, bool preserveCase)
|
||||
{
|
||||
const QStringList fileNames = TextEditor::BaseFileFind::replaceAll(text, items, preserveCase);
|
||||
|
||||
@@ -1039,9 +1039,9 @@ void FindReferences::onReplaceButtonClicked(const QString &text, const QList<Cor
|
||||
}
|
||||
|
||||
if (!changedOnDisk.isEmpty())
|
||||
QmlJS::ModelManagerInterface::instance()->updateSourceFiles(changedOnDisk, true);
|
||||
ModelManagerInterface::instance()->updateSourceFiles(changedOnDisk, true);
|
||||
if (!changedUnsavedEditors.isEmpty())
|
||||
QmlJS::ModelManagerInterface::instance()->updateSourceFiles(changedUnsavedEditors, false);
|
||||
ModelManagerInterface::instance()->updateSourceFiles(changedUnsavedEditors, false);
|
||||
|
||||
Core::SearchResultWindow::instance()->hide();
|
||||
SearchResultWindow::instance()->hide();
|
||||
}
|
||||
|
||||
@@ -47,15 +47,15 @@ QmlJSHighlighter::QmlJSHighlighter(QTextDocument *parent)
|
||||
m_inMultilineComment(false)
|
||||
{
|
||||
m_currentBlockParentheses.reserve(20);
|
||||
static QVector<TextEditor::TextStyle> categories;
|
||||
static QVector<TextStyle> categories;
|
||||
if (categories.isEmpty()) {
|
||||
categories << TextEditor::C_NUMBER
|
||||
<< TextEditor::C_STRING
|
||||
<< TextEditor::C_TYPE
|
||||
<< TextEditor::C_KEYWORD
|
||||
<< TextEditor::C_FIELD
|
||||
<< TextEditor::C_COMMENT
|
||||
<< TextEditor::C_VISUAL_WHITESPACE;
|
||||
categories << C_NUMBER
|
||||
<< C_STRING
|
||||
<< C_TYPE
|
||||
<< C_KEYWORD
|
||||
<< C_FIELD
|
||||
<< C_COMMENT
|
||||
<< C_VISUAL_WHITESPACE;
|
||||
}
|
||||
setTextFormatCategories(categories);
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace {
|
||||
|
||||
QmlJSHoverHandler::QmlJSHoverHandler() : m_modelManager(0)
|
||||
{
|
||||
m_modelManager = QmlJS::ModelManagerInterface::instance();
|
||||
m_modelManager = ModelManagerInterface::instance();
|
||||
}
|
||||
|
||||
static inline QString getModuleName(const ScopeChain &scopeChain, const Document::Ptr &qmlDocument,
|
||||
@@ -377,8 +377,8 @@ void QmlJSHoverHandler::operateTooltip(TextEditorWidget *editorWidget, const QPo
|
||||
Utils::ToolTip::show(point, toolTip(), editorWidget);
|
||||
}
|
||||
|
||||
void QmlJSHoverHandler::prettyPrintTooltip(const QmlJS::Value *value,
|
||||
const QmlJS::ContextPtr &context)
|
||||
void QmlJSHoverHandler::prettyPrintTooltip(const Value *value,
|
||||
const ContextPtr &context)
|
||||
{
|
||||
if (! value)
|
||||
return;
|
||||
|
||||
@@ -57,7 +57,7 @@ QmlJSQuickFixOperation::QmlJSQuickFixOperation(const QmlJSQuickFixInterface &int
|
||||
|
||||
void QmlJSQuickFixOperation::perform()
|
||||
{
|
||||
QmlJSRefactoringChanges refactoring(QmlJS::ModelManagerInterface::instance(),
|
||||
QmlJSRefactoringChanges refactoring(ModelManagerInterface::instance(),
|
||||
m_interface->semanticInfo().snapshot);
|
||||
QmlJSRefactoringFilePtr current = refactoring.file(fileName());
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ using namespace Internal;
|
||||
// QuickFixAssistInterface
|
||||
// -----------------------
|
||||
QmlJSQuickFixAssistInterface::QmlJSQuickFixAssistInterface(QmlJSEditorWidget *editor,
|
||||
TextEditor::AssistReason reason)
|
||||
AssistReason reason)
|
||||
: AssistInterface(editor->document(), editor->position(),
|
||||
editor->textDocument()->filePath().toString(), reason)
|
||||
, m_semanticInfo(editor->qmlJsEditorDocument()->semanticInfo())
|
||||
@@ -94,7 +94,7 @@ IAssistProcessor *QmlJSQuickFixAssistProvider::createProcessor() const
|
||||
|
||||
QList<QuickFixFactory *> QmlJSQuickFixAssistProvider::quickFixFactories() const
|
||||
{
|
||||
QList<TextEditor::QuickFixFactory *> results;
|
||||
QList<QuickFixFactory *> results;
|
||||
foreach (QmlJSQuickFixFactory *f, ExtensionSystem::PluginManager::getObjects<QmlJSQuickFixFactory>())
|
||||
results.append(f);
|
||||
return results;
|
||||
|
||||
@@ -70,12 +70,12 @@ class SplitInitializerOp: public QmlJSQuickFixFactory
|
||||
|
||||
const int pos = interface->currentFile()->cursor().position();
|
||||
|
||||
if (QmlJS::AST::Node *member = interface->semanticInfo().rangeAt(pos)) {
|
||||
if (QmlJS::AST::UiObjectBinding *b = QmlJS::AST::cast<QmlJS::AST::UiObjectBinding *>(member)) {
|
||||
if (Node *member = interface->semanticInfo().rangeAt(pos)) {
|
||||
if (UiObjectBinding *b = AST::cast<UiObjectBinding *>(member)) {
|
||||
if (b->initializer->lbraceToken.startLine == b->initializer->rbraceToken.startLine)
|
||||
objectInitializer = b->initializer;
|
||||
|
||||
} else if (QmlJS::AST::UiObjectDefinition *b = QmlJS::AST::cast<QmlJS::AST::UiObjectDefinition *>(member)) {
|
||||
} else if (UiObjectDefinition *b = AST::cast<UiObjectDefinition *>(member)) {
|
||||
if (b->initializer->lbraceToken.startLine == b->initializer->rbraceToken.startLine)
|
||||
objectInitializer = b->initializer;
|
||||
}
|
||||
@@ -106,9 +106,9 @@ class SplitInitializerOp: public QmlJSQuickFixFactory
|
||||
|
||||
Utils::ChangeSet changes;
|
||||
|
||||
for (QmlJS::AST::UiObjectMemberList *it = _objectInitializer->members; it; it = it->next) {
|
||||
if (QmlJS::AST::UiObjectMember *member = it->member) {
|
||||
const QmlJS::AST::SourceLocation loc = member->firstSourceLocation();
|
||||
for (UiObjectMemberList *it = _objectInitializer->members; it; it = it->next) {
|
||||
if (UiObjectMember *member = it->member) {
|
||||
const SourceLocation loc = member->firstSourceLocation();
|
||||
|
||||
// insert a newline at the beginning of this binding
|
||||
changes.insert(currentFile->startOf(loc), QLatin1String("\n"));
|
||||
|
||||
@@ -363,7 +363,7 @@ protected:
|
||||
return false;
|
||||
}
|
||||
|
||||
void addMessages(QList<QmlJS::DiagnosticMessage> messages,
|
||||
void addMessages(QList<DiagnosticMessage> messages,
|
||||
const Document::Ptr &doc)
|
||||
{
|
||||
foreach (const DiagnosticMessage &d, messages) {
|
||||
@@ -399,10 +399,10 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
void addMessages(const QList<QmlJS::StaticAnalysis::Message> &messages,
|
||||
void addMessages(const QList<StaticAnalysis::Message> &messages,
|
||||
const Document::Ptr &doc)
|
||||
{
|
||||
foreach (const QmlJS::StaticAnalysis::Message &d, messages) {
|
||||
foreach (const StaticAnalysis::Message &d, messages) {
|
||||
int line = d.location.startLine;
|
||||
int column = qMax(1U, d.location.startColumn);
|
||||
int length = d.location.length;
|
||||
|
||||
@@ -79,7 +79,7 @@ static inline const ObjectValue * getPropertyChangesTarget(Node *node, const Sco
|
||||
}
|
||||
|
||||
QuickToolBar::QuickToolBar(QObject *parent)
|
||||
: ::QmlJS::IContextPane(parent)
|
||||
: ::IContextPane(parent)
|
||||
, m_editorWidget(0)
|
||||
, m_blockWriting(false)
|
||||
{
|
||||
@@ -116,7 +116,7 @@ QuickToolBar::~QuickToolBar()
|
||||
m_widget = 0;
|
||||
}
|
||||
|
||||
void QuickToolBar::apply(TextEditor::TextEditorWidget *editorWidget, Document::Ptr document, const ScopeChain *scopeChain, AST::Node *node, bool update, bool force)
|
||||
void QuickToolBar::apply(TextEditor::TextEditorWidget *editorWidget, Document::Ptr document, const ScopeChain *scopeChain, Node *node, bool update, bool force)
|
||||
{
|
||||
if (!QuickToolBarSettings::get().enableContextPane && !force && !update) {
|
||||
contextWidget()->hide();
|
||||
@@ -246,7 +246,7 @@ void QuickToolBar::apply(TextEditor::TextEditorWidget *editorWidget, Document::P
|
||||
|
||||
}
|
||||
|
||||
bool QuickToolBar::isAvailable(TextEditor::TextEditorWidget *, Document::Ptr document, AST::Node *node)
|
||||
bool QuickToolBar::isAvailable(TextEditor::TextEditorWidget *, Document::Ptr document, Node *node)
|
||||
{
|
||||
if (document.isNull())
|
||||
return false;
|
||||
|
||||
@@ -49,7 +49,7 @@ class QmlConsoleManagerPrivate
|
||||
public:
|
||||
Internal::QmlConsoleItemModel *qmlConsoleItemModel;
|
||||
Internal::QmlConsolePane *qmlConsolePane;
|
||||
QmlJS::IScriptEvaluator *scriptEvaluator;
|
||||
IScriptEvaluator *scriptEvaluator;
|
||||
};
|
||||
|
||||
QmlConsoleManager::QmlConsoleManager(QObject *parent)
|
||||
@@ -81,7 +81,7 @@ ConsoleItem *QmlConsoleManager::rootItem() const
|
||||
return d->qmlConsoleItemModel->root();
|
||||
}
|
||||
|
||||
void QmlConsoleManager::setScriptEvaluator(QmlJS::IScriptEvaluator *scriptEvaluator)
|
||||
void QmlConsoleManager::setScriptEvaluator(IScriptEvaluator *scriptEvaluator)
|
||||
{
|
||||
d->scriptEvaluator = scriptEvaluator;
|
||||
if (!scriptEvaluator)
|
||||
|
||||
@@ -40,10 +40,6 @@
|
||||
|
||||
namespace QmlJSTools {
|
||||
|
||||
namespace {
|
||||
typedef QmlJS::QmlBundle QmlBundle;
|
||||
typedef QmlJS::QmlLanguageBundles QmlLanguageBundles;
|
||||
}
|
||||
using namespace QmlJS;
|
||||
|
||||
/*!
|
||||
|
||||
@@ -83,18 +83,18 @@ QmlJSCodeStylePreferencesWidget::~QmlJSCodeStylePreferencesWidget()
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void QmlJSCodeStylePreferencesWidget::setPreferences(TextEditor::ICodeStylePreferences *preferences)
|
||||
void QmlJSCodeStylePreferencesWidget::setPreferences(ICodeStylePreferences *preferences)
|
||||
{
|
||||
m_preferences = preferences;
|
||||
m_ui->tabPreferencesWidget->setPreferences(preferences);
|
||||
if (m_preferences)
|
||||
connect(m_preferences, &TextEditor::ICodeStylePreferences::currentTabSettingsChanged,
|
||||
connect(m_preferences, &ICodeStylePreferences::currentTabSettingsChanged,
|
||||
this, &QmlJSCodeStylePreferencesWidget::slotSettingsChanged);
|
||||
updatePreview();
|
||||
}
|
||||
|
||||
|
||||
void QmlJSCodeStylePreferencesWidget::decorateEditor(const TextEditor::FontSettings &fontSettings)
|
||||
void QmlJSCodeStylePreferencesWidget::decorateEditor(const FontSettings &fontSettings)
|
||||
{
|
||||
const ISnippetProvider *provider = ExtensionSystem::PluginManager::getObject<ISnippetProvider>(
|
||||
[](ISnippetProvider *current) {
|
||||
@@ -122,7 +122,7 @@ void QmlJSCodeStylePreferencesWidget::updatePreview()
|
||||
{
|
||||
QTextDocument *doc = m_ui->previewTextEdit->document();
|
||||
|
||||
const TextEditor::TabSettings &ts = m_preferences
|
||||
const TabSettings &ts = m_preferences
|
||||
? m_preferences->currentTabSettings()
|
||||
: TextEditorSettings::codeStyle()->tabSettings();
|
||||
m_ui->previewTextEdit->textDocument()->setTabSettings(ts);
|
||||
@@ -157,9 +157,9 @@ QmlJSCodeStyleSettingsPage::QmlJSCodeStyleSettingsPage(/*QSharedPointer<CppFileS
|
||||
QWidget *QmlJSCodeStyleSettingsPage::widget()
|
||||
{
|
||||
if (!m_widget) {
|
||||
TextEditor::SimpleCodeStylePreferences *originalTabPreferences
|
||||
SimpleCodeStylePreferences *originalTabPreferences
|
||||
= QmlJSToolsSettings::globalCodeStyle();
|
||||
m_pageTabPreferences = new TextEditor::SimpleCodeStylePreferences(m_widget);
|
||||
m_pageTabPreferences = new SimpleCodeStylePreferences(m_widget);
|
||||
m_pageTabPreferences->setDelegatingPool(originalTabPreferences->delegatingPool());
|
||||
m_pageTabPreferences->setTabSettings(originalTabPreferences->tabSettings());
|
||||
m_pageTabPreferences->setCurrentDelegate(originalTabPreferences->currentDelegate());
|
||||
@@ -175,7 +175,7 @@ void QmlJSCodeStyleSettingsPage::apply()
|
||||
if (m_widget) {
|
||||
QSettings *s = Core::ICore::settings();
|
||||
|
||||
TextEditor::SimpleCodeStylePreferences *originalTabPreferences = QmlJSToolsSettings::globalCodeStyle();
|
||||
SimpleCodeStylePreferences *originalTabPreferences = QmlJSToolsSettings::globalCodeStyle();
|
||||
if (originalTabPreferences->tabSettings() != m_pageTabPreferences->tabSettings()) {
|
||||
originalTabPreferences->setTabSettings(m_pageTabPreferences->tabSettings());
|
||||
originalTabPreferences->toSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID), s);
|
||||
|
||||
@@ -44,11 +44,11 @@ using namespace QmlJS::AST;
|
||||
LocatorData::LocatorData(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
QmlJS::ModelManagerInterface *manager = QmlJS::ModelManagerInterface::instance();
|
||||
ModelManagerInterface *manager = ModelManagerInterface::instance();
|
||||
|
||||
connect(manager, &QmlJS::ModelManagerInterface::documentUpdated,
|
||||
connect(manager, &ModelManagerInterface::documentUpdated,
|
||||
this, &LocatorData::onDocumentUpdated);
|
||||
connect(manager, &QmlJS::ModelManagerInterface::aboutToRemoveFiles,
|
||||
connect(manager, &ModelManagerInterface::aboutToRemoveFiles,
|
||||
this, &LocatorData::onAboutToRemoveFiles);
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ QHash<QString, QList<LocatorData::Entry> > LocatorData::entries() const
|
||||
return m_entries;
|
||||
}
|
||||
|
||||
void LocatorData::onDocumentUpdated(const QmlJS::Document::Ptr &doc)
|
||||
void LocatorData::onDocumentUpdated(const Document::Ptr &doc)
|
||||
{
|
||||
QList<Entry> entries = FunctionFinder().run(doc);
|
||||
QMutexLocker l(&m_mutex);
|
||||
|
||||
@@ -71,7 +71,7 @@ using namespace QmlJSTools;
|
||||
using namespace QmlJSTools::Internal;
|
||||
|
||||
|
||||
ModelManagerInterface::ProjectInfo QmlJSTools::Internal::ModelManager::defaultProjectInfoForProject(
|
||||
ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject(
|
||||
ProjectExplorer::Project *project) const
|
||||
{
|
||||
ModelManagerInterface::ProjectInfo projectInfo(project);
|
||||
@@ -171,9 +171,9 @@ void QmlJSTools::setupProjectInfoQmlBundles(ModelManagerInterface::ProjectInfo &
|
||||
}
|
||||
}
|
||||
|
||||
QHash<QString,QmlJS::Dialect> ModelManager::languageForSuffix() const
|
||||
QHash<QString,Dialect> ModelManager::languageForSuffix() const
|
||||
{
|
||||
QHash<QString,QmlJS::Dialect> res = ModelManagerInterface::languageForSuffix();
|
||||
QHash<QString,Dialect> res = ModelManagerInterface::languageForSuffix();
|
||||
|
||||
if (ICore::instance()) {
|
||||
Utils::MimeDatabase mdb;
|
||||
@@ -223,7 +223,7 @@ void ModelManager::delayedInitialization()
|
||||
connect(ProjectExplorer::SessionManager::instance(), &ProjectExplorer::SessionManager::startupProjectChanged,
|
||||
this, &ModelManager::updateDefaultProjectInfo);
|
||||
|
||||
QmlJS::ViewerContext qbsVContext;
|
||||
ViewerContext qbsVContext;
|
||||
qbsVContext.language = Dialect::QmlQbs;
|
||||
qbsVContext.maybeAddPath(ICore::resourcePath() + QLatin1String("/qbs"));
|
||||
setDefaultVContext(qbsVContext);
|
||||
|
||||
@@ -40,7 +40,7 @@ CreatorCodeFormatter::CreatorCodeFormatter()
|
||||
{
|
||||
}
|
||||
|
||||
CreatorCodeFormatter::CreatorCodeFormatter(const TextEditor::TabSettings &tabSettings)
|
||||
CreatorCodeFormatter::CreatorCodeFormatter(const TabSettings &tabSettings)
|
||||
{
|
||||
setTabSize(tabSettings.m_tabSize);
|
||||
setIndentSize(tabSettings.m_indentSize);
|
||||
|
||||
@@ -39,9 +39,10 @@
|
||||
#include <projectexplorer/editorconfiguration.h>
|
||||
|
||||
using namespace QmlJS;
|
||||
using namespace QmlJSTools;
|
||||
|
||||
class QmlJSTools::QmlJSRefactoringChangesData : public TextEditor::RefactoringChangesData
|
||||
namespace QmlJSTools {
|
||||
|
||||
class QmlJSRefactoringChangesData : public TextEditor::RefactoringChangesData
|
||||
{
|
||||
public:
|
||||
QmlJSRefactoringChangesData(ModelManagerInterface *modelManager,
|
||||
@@ -90,8 +91,8 @@ public:
|
||||
m_modelManager->updateSourceFiles(QStringList(fileName), true);
|
||||
}
|
||||
|
||||
QmlJS::ModelManagerInterface *m_modelManager;
|
||||
QmlJS::Snapshot m_snapshot;
|
||||
ModelManagerInterface *m_modelManager;
|
||||
Snapshot m_snapshot;
|
||||
};
|
||||
|
||||
QmlJSRefactoringChanges::QmlJSRefactoringChanges(ModelManagerInterface *modelManager,
|
||||
@@ -129,7 +130,7 @@ QmlJSRefactoringFile::QmlJSRefactoringFile(const QString &fileName, const QShare
|
||||
m_fileName.clear();
|
||||
}
|
||||
|
||||
QmlJSRefactoringFile::QmlJSRefactoringFile(TextEditor::TextEditorWidget *editor, QmlJS::Document::Ptr document)
|
||||
QmlJSRefactoringFile::QmlJSRefactoringFile(TextEditor::TextEditorWidget *editor, Document::Ptr document)
|
||||
: RefactoringFile(editor)
|
||||
, m_qmljsDocument(document)
|
||||
{
|
||||
@@ -195,3 +196,5 @@ void QmlJSRefactoringFile::fileChanged()
|
||||
m_qmljsDocument.clear();
|
||||
RefactoringFile::fileChanged();
|
||||
}
|
||||
|
||||
} // namespace QmlJSTools
|
||||
|
||||
@@ -150,7 +150,7 @@ AST::Node *SemanticInfo::rangeAt(int cursorPosition) const
|
||||
}
|
||||
|
||||
// ### the name and behavior of this function is dubious
|
||||
QmlJS::AST::Node *SemanticInfo::declaringMemberNoProperties(int cursorPosition) const
|
||||
Node *SemanticInfo::declaringMemberNoProperties(int cursorPosition) const
|
||||
{
|
||||
AST::Node *node = rangeAt(cursorPosition);
|
||||
|
||||
@@ -191,7 +191,7 @@ QList<AST::Node *> SemanticInfo::rangePath(int cursorPosition) const
|
||||
return path;
|
||||
}
|
||||
|
||||
ScopeChain SemanticInfo::scopeChain(const QList<QmlJS::AST::Node *> &path) const
|
||||
ScopeChain SemanticInfo::scopeChain(const QList<Node *> &path) const
|
||||
{
|
||||
Q_ASSERT(m_rootScopeChain);
|
||||
|
||||
|
||||
@@ -39,11 +39,13 @@
|
||||
#include <QtTest>
|
||||
|
||||
using namespace QmlJS;
|
||||
using namespace QmlJSTools;
|
||||
|
||||
void QmlJSTools::Internal::QmlJSToolsPlugin::test_basic()
|
||||
namespace QmlJSTools {
|
||||
namespace Internal {
|
||||
|
||||
void QmlJSToolsPlugin::test_basic()
|
||||
{
|
||||
QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance();
|
||||
ModelManagerInterface *modelManager = ModelManagerInterface::instance();
|
||||
|
||||
const QString welcomescreenRootPath = Core::ICore::resourcePath() + QLatin1String("/welcomescreen/welcomescreen.qml");
|
||||
modelManager->updateSourceFiles(QStringList(welcomescreenRootPath), false);
|
||||
@@ -88,3 +90,6 @@ void QmlJSTools::Internal::QmlJSToolsPlugin::test_basic()
|
||||
QCOMPARE(qmlImageValue->className(), QLatin1String("Image"));
|
||||
QCOMPARE(qmlImageValue->propertyType(QLatin1String("source")), QLatin1String("QUrl"));
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace QmlJSTools
|
||||
|
||||
@@ -131,13 +131,13 @@ ExtensionSystem::IPlugin::ShutdownFlag QmlJSToolsPlugin::aboutToShutdown()
|
||||
return SynchronousShutdown;
|
||||
}
|
||||
|
||||
void QmlJSToolsPlugin::onTaskStarted(Core::Id type)
|
||||
void QmlJSToolsPlugin::onTaskStarted(Id type)
|
||||
{
|
||||
if (type == QmlJS::Constants::TASK_INDEX)
|
||||
m_resetCodeModelAction->setEnabled(false);
|
||||
}
|
||||
|
||||
void QmlJSToolsPlugin::onAllTasksFinished(Core::Id type)
|
||||
void QmlJSToolsPlugin::onAllTasksFinished(Id type)
|
||||
{
|
||||
if (type == QmlJS::Constants::TASK_INDEX)
|
||||
m_resetCodeModelAction->setEnabled(true);
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace QmlJSTools {
|
||||
|
||||
const char idKey[] = "QmlJSGlobal";
|
||||
|
||||
static TextEditor::SimpleCodeStylePreferences *m_globalCodeStyle = 0;
|
||||
static SimpleCodeStylePreferences *m_globalCodeStyle = 0;
|
||||
|
||||
QmlJSToolsSettings::QmlJSToolsSettings(QObject *parent)
|
||||
: QObject(parent)
|
||||
|
||||
@@ -50,8 +50,7 @@ LocalQmlProfilerRunner *LocalQmlProfilerRunner::createLocalRunner(
|
||||
LocalApplicationRunConfiguration *larc =
|
||||
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
|
||||
QTC_ASSERT(larc, return 0);
|
||||
ProjectExplorer::EnvironmentAspect *environment
|
||||
= runConfiguration->extraAspect<ProjectExplorer::EnvironmentAspect>();
|
||||
EnvironmentAspect *environment = runConfiguration->extraAspect<EnvironmentAspect>();
|
||||
QTC_ASSERT(environment, return 0);
|
||||
Configuration conf;
|
||||
conf.executable = larc->executable();
|
||||
@@ -102,8 +101,7 @@ void LocalQmlProfilerRunner::start()
|
||||
m_launcher.setEnvironment(m_configuration.environment);
|
||||
connect(&m_launcher, SIGNAL(processExited(int,QProcess::ExitStatus)),
|
||||
this, SLOT(spontaneousStop(int,QProcess::ExitStatus)));
|
||||
m_launcher.start(ProjectExplorer::ApplicationLauncher::Gui, m_configuration.executable,
|
||||
arguments);
|
||||
m_launcher.start(ApplicationLauncher::Gui, m_configuration.executable, arguments);
|
||||
|
||||
emit started();
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ void QmlProfilerAttachDialog::setPort(const int port)
|
||||
d->portSpinBox->setValue(port);
|
||||
}
|
||||
|
||||
ProjectExplorer::Kit *QmlProfilerAttachDialog::kit() const
|
||||
Kit *QmlProfilerAttachDialog::kit() const
|
||||
{
|
||||
return d->kitChooser->currentKit();
|
||||
}
|
||||
|
||||
@@ -342,7 +342,7 @@ void QmlProfilerClientManager::qmlComplete(qint64 maximumTime)
|
||||
d->modelManager->traceTime()->increaseEndTime(maximumTime);
|
||||
d->qmlDataReady = true;
|
||||
if (!d->v8clientplugin ||
|
||||
d->v8clientplugin.data()->state() != QmlDebug::QmlDebugClient::Enabled ||
|
||||
d->v8clientplugin.data()->state() != QmlDebugClient::Enabled ||
|
||||
d->v8DataReady) {
|
||||
emit dataReadyForProcessing();
|
||||
// once complete is sent, reset the flags
|
||||
@@ -355,7 +355,7 @@ void QmlProfilerClientManager::v8Complete()
|
||||
{
|
||||
d->v8DataReady = true;
|
||||
if (!d->qmlclientplugin ||
|
||||
d->qmlclientplugin.data()->state() != QmlDebug::QmlDebugClient::Enabled ||
|
||||
d->qmlclientplugin.data()->state() != QmlDebugClient::Enabled ||
|
||||
d->qmlDataReady) {
|
||||
emit dataReadyForProcessing();
|
||||
// once complete is sent, reset the flags
|
||||
|
||||
@@ -68,9 +68,9 @@ struct RootEventType : public QmlProfilerDataModel::QmlEventTypeData {
|
||||
{
|
||||
QString rootEventName = QmlProfilerEventsMainView::tr("<program>");
|
||||
displayName = rootEventName;
|
||||
location = QmlDebug::QmlEventLocation(rootEventName, 1, 1);
|
||||
message = QmlDebug::MaximumMessage;
|
||||
rangeType = QmlDebug::MaximumRangeType;
|
||||
location = QmlEventLocation(rootEventName, 1, 1);
|
||||
message = MaximumMessage;
|
||||
rangeType = MaximumRangeType;
|
||||
detailType = -1;
|
||||
data = QmlProfilerEventsMainView::tr("Main Program");
|
||||
}
|
||||
@@ -339,30 +339,30 @@ bool QmlProfilerEventsWidget::showExtendedStatistics() const
|
||||
|
||||
void QmlProfilerEventsWidget::setShowJavaScript(bool show)
|
||||
{
|
||||
d->modelProxy->setEventTypeAccepted(QmlDebug::Javascript, show);
|
||||
d->modelProxy->setEventTypeAccepted(Javascript, show);
|
||||
d->modelProxy->limitToRange(d->rangeStart, d->rangeEnd);
|
||||
}
|
||||
|
||||
void QmlProfilerEventsWidget::setShowQml(bool show)
|
||||
{
|
||||
d->modelProxy->setEventTypeAccepted(QmlDebug::Binding, show);
|
||||
d->modelProxy->setEventTypeAccepted(QmlDebug::HandlingSignal, show);
|
||||
d->modelProxy->setEventTypeAccepted(QmlDebug::Compiling, show);
|
||||
d->modelProxy->setEventTypeAccepted(QmlDebug::Creating, show);
|
||||
d->modelProxy->setEventTypeAccepted(Binding, show);
|
||||
d->modelProxy->setEventTypeAccepted(HandlingSignal, show);
|
||||
d->modelProxy->setEventTypeAccepted(Compiling, show);
|
||||
d->modelProxy->setEventTypeAccepted(Creating, show);
|
||||
d->modelProxy->limitToRange(d->rangeStart, d->rangeEnd);
|
||||
}
|
||||
|
||||
bool QmlProfilerEventsWidget::showJavaScript() const
|
||||
{
|
||||
return d->modelProxy->eventTypeAccepted(QmlDebug::Javascript);
|
||||
return d->modelProxy->eventTypeAccepted(Javascript);
|
||||
}
|
||||
|
||||
bool QmlProfilerEventsWidget::showQml() const
|
||||
{
|
||||
return d->modelProxy->eventTypeAccepted(QmlDebug::Binding) &&
|
||||
d->modelProxy->eventTypeAccepted(QmlDebug::HandlingSignal) &&
|
||||
d->modelProxy->eventTypeAccepted(QmlDebug::Compiling) &&
|
||||
d->modelProxy->eventTypeAccepted(QmlDebug::Creating);
|
||||
return d->modelProxy->eventTypeAccepted(Binding) &&
|
||||
d->modelProxy->eventTypeAccepted(HandlingSignal) &&
|
||||
d->modelProxy->eventTypeAccepted(Compiling) &&
|
||||
d->modelProxy->eventTypeAccepted(Creating);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -700,15 +700,15 @@ void QmlProfilerEventsMainView::parseModelProxy()
|
||||
}
|
||||
}
|
||||
|
||||
QString QmlProfilerEventsMainView::nameForType(QmlDebug::RangeType typeNumber)
|
||||
QString QmlProfilerEventsMainView::nameForType(RangeType typeNumber)
|
||||
{
|
||||
switch (typeNumber) {
|
||||
case QmlDebug::Painting: return QmlProfilerEventsMainView::tr("Paint");
|
||||
case QmlDebug::Compiling: return QmlProfilerEventsMainView::tr("Compile");
|
||||
case QmlDebug::Creating: return QmlProfilerEventsMainView::tr("Create");
|
||||
case QmlDebug::Binding: return QmlProfilerEventsMainView::tr("Binding");
|
||||
case QmlDebug::HandlingSignal: return QmlProfilerEventsMainView::tr("Signal");
|
||||
case QmlDebug::Javascript: return QmlProfilerEventsMainView::tr("JavaScript");
|
||||
case Painting: return QmlProfilerEventsMainView::tr("Paint");
|
||||
case Compiling: return QmlProfilerEventsMainView::tr("Compile");
|
||||
case Creating: return QmlProfilerEventsMainView::tr("Create");
|
||||
case Binding: return QmlProfilerEventsMainView::tr("Binding");
|
||||
case HandlingSignal: return QmlProfilerEventsMainView::tr("Signal");
|
||||
case Javascript: return QmlProfilerEventsMainView::tr("JavaScript");
|
||||
default: return QString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -646,21 +646,21 @@ void QmlProfilerTool::clientsDisconnected()
|
||||
// If the connection is closed while the app is still running, no special action is needed
|
||||
}
|
||||
|
||||
template<QmlDebug::ProfileFeature feature>
|
||||
template<ProfileFeature feature>
|
||||
void QmlProfilerTool::updateFeaturesMenu(quint64 features)
|
||||
{
|
||||
if (features & (1ULL << (feature))) {
|
||||
QAction *action = d->m_featuresMenu->addAction(tr(QmlProfilerModelManager::featureName(
|
||||
static_cast<QmlDebug::ProfileFeature>(feature))));
|
||||
static_cast<ProfileFeature>(feature))));
|
||||
action->setCheckable(true);
|
||||
action->setData(static_cast<uint>(feature));
|
||||
action->setChecked(d->m_profilerState->recordingFeatures() & (1ULL << (feature)));
|
||||
}
|
||||
updateFeaturesMenu<static_cast<QmlDebug::ProfileFeature>(feature + 1)>(features);
|
||||
updateFeaturesMenu<static_cast<ProfileFeature>(feature + 1)>(features);
|
||||
}
|
||||
|
||||
template<>
|
||||
void QmlProfilerTool::updateFeaturesMenu<QmlDebug::MaximumProfileFeature>(quint64 features)
|
||||
void QmlProfilerTool::updateFeaturesMenu<MaximumProfileFeature>(quint64 features)
|
||||
{
|
||||
Q_UNUSED(features);
|
||||
return;
|
||||
@@ -672,7 +672,7 @@ void QmlProfilerTool::setAvailableFeatures(quint64 features)
|
||||
d->m_profilerState->setRecordingFeatures(features); // by default, enable them all.
|
||||
if (d->m_featuresMenu) {
|
||||
d->m_featuresMenu->clear();
|
||||
updateFeaturesMenu<static_cast<QmlDebug::ProfileFeature>(0)>(features);
|
||||
updateFeaturesMenu<static_cast<ProfileFeature>(0)>(features);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,41 +79,41 @@ Q_STATIC_ASSERT(sizeof(MESSAGE_STRINGS) == QmlDebug::MaximumMessage * sizeof(con
|
||||
namespace QmlProfiler {
|
||||
namespace Internal {
|
||||
|
||||
static QPair<QmlDebug::Message, QmlDebug::RangeType> qmlTypeAsEnum(const QString &typeString)
|
||||
static QPair<Message, RangeType> qmlTypeAsEnum(const QString &typeString)
|
||||
{
|
||||
QPair<QmlDebug::Message, QmlDebug::RangeType> ret(QmlDebug::MaximumMessage,
|
||||
QmlDebug::MaximumRangeType);
|
||||
QPair<Message, RangeType> ret(MaximumMessage,
|
||||
MaximumRangeType);
|
||||
|
||||
for (int i = 0; i < QmlDebug::MaximumMessage; ++i) {
|
||||
for (int i = 0; i < MaximumMessage; ++i) {
|
||||
if (typeString == _(MESSAGE_STRINGS[i])) {
|
||||
ret.first = static_cast<QmlDebug::Message>(i);
|
||||
ret.first = static_cast<Message>(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < QmlDebug::MaximumRangeType; ++i) {
|
||||
for (int i = 0; i < MaximumRangeType; ++i) {
|
||||
if (typeString == _(RANGE_TYPE_STRINGS[i])) {
|
||||
ret.second = static_cast<QmlDebug::RangeType>(i);
|
||||
ret.second = static_cast<RangeType>(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret.first == QmlDebug::MaximumMessage && ret.second == QmlDebug::MaximumRangeType) {
|
||||
if (ret.first == MaximumMessage && ret.second == MaximumRangeType) {
|
||||
bool isNumber = false;
|
||||
int type = typeString.toUInt(&isNumber);
|
||||
if (isNumber && type < QmlDebug::MaximumRangeType)
|
||||
if (isNumber && type < MaximumRangeType)
|
||||
// Allow saving ranges as numbers, but not messages.
|
||||
ret.second = static_cast<QmlDebug::RangeType>(type);
|
||||
ret.second = static_cast<RangeType>(type);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static QString qmlTypeAsString(QmlDebug::Message message, QmlDebug::RangeType rangeType)
|
||||
static QString qmlTypeAsString(Message message, RangeType rangeType)
|
||||
{
|
||||
if (rangeType < QmlDebug::MaximumRangeType)
|
||||
if (rangeType < MaximumRangeType)
|
||||
return _(RANGE_TYPE_STRINGS[rangeType]);
|
||||
else if (message != QmlDebug::MaximumMessage)
|
||||
else if (message != MaximumMessage)
|
||||
return _(MESSAGE_STRINGS[message]);
|
||||
else
|
||||
return QString::number((int)rangeType);
|
||||
@@ -247,7 +247,7 @@ void QmlProfilerFileReader::loadEventData(QXmlStreamReader &stream)
|
||||
}
|
||||
|
||||
if (elementName == _("type")) {
|
||||
QPair<QmlDebug::Message, QmlDebug::RangeType> enums = qmlTypeAsEnum(readData);
|
||||
QPair<Message, RangeType> enums = qmlTypeAsEnum(readData);
|
||||
event.message = enums.first;
|
||||
event.rangeType = enums.second;
|
||||
break;
|
||||
@@ -513,14 +513,14 @@ void QmlProfilerFileWriter::save(QIODevice *device)
|
||||
const QmlProfilerDataModel::QmlEventTypeData &event = m_qmlEvents[range.typeIndex];
|
||||
|
||||
// special: animation event
|
||||
if (event.message == QmlDebug::Event && event.detailType == QmlDebug::AnimationFrame) {
|
||||
if (event.message == Event && event.detailType == AnimationFrame) {
|
||||
stream.writeAttribute(_("framerate"), QString::number(range.numericData1));
|
||||
stream.writeAttribute(_("animationcount"), QString::number(range.numericData2));
|
||||
stream.writeAttribute(_("thread"), QString::number(range.numericData3));
|
||||
}
|
||||
|
||||
// special: pixmap cache event
|
||||
if (event.message == QmlDebug::PixmapCacheEvent) {
|
||||
if (event.message == PixmapCacheEvent) {
|
||||
if (event.detailType == PixmapSizeKnown) {
|
||||
stream.writeAttribute(_("width"), QString::number(range.numericData1));
|
||||
stream.writeAttribute(_("height"), QString::number(range.numericData2));
|
||||
@@ -531,7 +531,7 @@ void QmlProfilerFileWriter::save(QIODevice *device)
|
||||
stream.writeAttribute(_("refCount"), QString::number(range.numericData3));
|
||||
}
|
||||
|
||||
if (event.message == QmlDebug::SceneGraphFrame) {
|
||||
if (event.message == SceneGraphFrame) {
|
||||
// special: scenegraph frame events
|
||||
if (range.numericData1 > 0)
|
||||
stream.writeAttribute(_("timing1"), QString::number(range.numericData1));
|
||||
@@ -546,7 +546,7 @@ void QmlProfilerFileWriter::save(QIODevice *device)
|
||||
}
|
||||
|
||||
// special: memory allocation event
|
||||
if (event.message == QmlDebug::MemoryAllocation)
|
||||
if (event.message == MemoryAllocation)
|
||||
stream.writeAttribute(_("amount"), QString::number(range.numericData1));
|
||||
|
||||
stream.writeEndElement();
|
||||
|
||||
@@ -135,8 +135,8 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, Analyzer::IAnalyzerT
|
||||
|
||||
d->m_modelProxy->addModel(new QmlProfilerAnimationsModel(modelManager, d->m_modelProxy));
|
||||
|
||||
for (int i = 0; i < QmlDebug::MaximumRangeType; ++i)
|
||||
d->m_modelProxy->addModel(new QmlProfilerRangeModel(modelManager, (QmlDebug::RangeType)i,
|
||||
for (int i = 0; i < MaximumRangeType; ++i)
|
||||
d->m_modelProxy->addModel(new QmlProfilerRangeModel(modelManager, (RangeType)i,
|
||||
d->m_modelProxy));
|
||||
|
||||
// Connect this last so that it's executed after the models have updated their data.
|
||||
|
||||
@@ -81,11 +81,11 @@ QmlApplicationWizard::QmlApplicationWizard()
|
||||
QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY_DISPLAY));
|
||||
setDisplayName(tr("Qt Quick UI"));
|
||||
setDescription(tr("Creates a Qt Quick UI project."));
|
||||
setRequiredFeatures(Core::Feature(QtSupport::Constants::FEATURE_QMLPROJECT)
|
||||
| Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK));
|
||||
setRequiredFeatures(Feature(QtSupport::Constants::FEATURE_QMLPROJECT)
|
||||
| Feature(QtSupport::Constants::FEATURE_QT_QUICK));
|
||||
}
|
||||
|
||||
Core::BaseFileWizard *QmlApplicationWizard::create(QWidget *parent, const WizardDialogParameters ¶meters) const
|
||||
BaseFileWizard *QmlApplicationWizard::create(QWidget *parent, const WizardDialogParameters ¶meters) const
|
||||
{
|
||||
QmlApplicationWizardDialog *wizardDialog = new QmlApplicationWizardDialog(parent, parameters);
|
||||
|
||||
@@ -113,7 +113,7 @@ GeneratedFiles QmlApplicationWizard::generateFiles(const QWizard *w,
|
||||
bool QmlApplicationWizard::postGenerateFiles(const QWizard * /*wizard*/, const GeneratedFiles &l,
|
||||
QString *errorMessage)
|
||||
{
|
||||
return ProjectExplorer::CustomProjectWizard::postGenerateOpen(l, errorMessage);
|
||||
return CustomProjectWizard::postGenerateOpen(l, errorMessage);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -89,18 +89,18 @@ QmlProject::~QmlProject()
|
||||
delete m_rootNode;
|
||||
}
|
||||
|
||||
void QmlProject::addedTarget(ProjectExplorer::Target *target)
|
||||
void QmlProject::addedTarget(Target *target)
|
||||
{
|
||||
connect(target, SIGNAL(addedRunConfiguration(ProjectExplorer::RunConfiguration*)),
|
||||
this, SLOT(addedRunConfiguration(ProjectExplorer::RunConfiguration*)));
|
||||
foreach (ProjectExplorer::RunConfiguration *rc, target->runConfigurations())
|
||||
foreach (RunConfiguration *rc, target->runConfigurations())
|
||||
addedRunConfiguration(rc);
|
||||
}
|
||||
|
||||
void QmlProject::onActiveTargetChanged(ProjectExplorer::Target *target)
|
||||
void QmlProject::onActiveTargetChanged(Target *target)
|
||||
{
|
||||
if (m_activeTarget)
|
||||
disconnect(m_activeTarget, &ProjectExplorer::Target::kitChanged, this, &QmlProject::onKitChanged);
|
||||
disconnect(m_activeTarget, &Target::kitChanged, this, &QmlProject::onKitChanged);
|
||||
m_activeTarget = target;
|
||||
if (m_activeTarget)
|
||||
connect(target, SIGNAL(kitChanged()), this, SLOT(onKitChanged()));
|
||||
@@ -115,7 +115,7 @@ void QmlProject::onKitChanged()
|
||||
refresh(Configuration);
|
||||
}
|
||||
|
||||
void QmlProject::addedRunConfiguration(ProjectExplorer::RunConfiguration *rc)
|
||||
void QmlProject::addedRunConfiguration(RunConfiguration *rc)
|
||||
{
|
||||
// The enabled state of qml runconfigurations can only be decided after
|
||||
// they have been added to a project
|
||||
@@ -297,14 +297,14 @@ IDocument *QmlProject::document() const
|
||||
return m_file;
|
||||
}
|
||||
|
||||
ProjectExplorer::IProjectManager *QmlProject::projectManager() const
|
||||
IProjectManager *QmlProject::projectManager() const
|
||||
{
|
||||
return m_manager;
|
||||
}
|
||||
|
||||
bool QmlProject::supportsKit(ProjectExplorer::Kit *k, QString *errorMessage) const
|
||||
bool QmlProject::supportsKit(Kit *k, QString *errorMessage) const
|
||||
{
|
||||
Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(k);
|
||||
Id deviceType = DeviceTypeKitInformation::deviceTypeId(k);
|
||||
if (deviceType != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
|
||||
if (errorMessage)
|
||||
*errorMessage = tr("Device type is not desktop.");
|
||||
@@ -333,7 +333,7 @@ bool QmlProject::supportsKit(ProjectExplorer::Kit *k, QString *errorMessage) con
|
||||
return true;
|
||||
}
|
||||
|
||||
ProjectExplorer::ProjectNode *QmlProject::rootProjectNode() const
|
||||
ProjectNode *QmlProject::rootProjectNode() const
|
||||
{
|
||||
return m_rootNode;
|
||||
}
|
||||
|
||||
@@ -129,11 +129,11 @@ static void initializeMetaTypeSystem(const QString &resourcePath)
|
||||
qWarning() << qPrintable(errorAndWarning);
|
||||
}
|
||||
|
||||
static QmlDesigner::Model* createModel(const QString &typeName, int major = 1, int minor = 1, Model *metaInfoPropxyModel = 0)
|
||||
static Model* createModel(const QString &typeName, int major = 1, int minor = 1, Model *metaInfoPropxyModel = 0)
|
||||
{
|
||||
QApplication::processEvents();
|
||||
|
||||
QmlDesigner::Model *model = QmlDesigner::Model::create(typeName, major, minor, metaInfoPropxyModel);
|
||||
Model *model = Model::create(typeName, major, minor, metaInfoPropxyModel);
|
||||
|
||||
QPlainTextEdit *textEdit = new QPlainTextEdit;
|
||||
QObject::connect(model, SIGNAL(destroyed()), textEdit, SLOT(deleteLater()));
|
||||
@@ -145,7 +145,7 @@ static QmlDesigner::Model* createModel(const QString &typeName, int major = 1, i
|
||||
NotIndentingTextEditModifier *modifier = new NotIndentingTextEditModifier(textEdit);
|
||||
modifier->setParent(textEdit);
|
||||
|
||||
QmlDesigner::RewriterView *rewriterView = new QmlDesigner::RewriterView(QmlDesigner::RewriterView::Validate, model);
|
||||
RewriterView *rewriterView = new RewriterView(RewriterView::Validate, model);
|
||||
rewriterView->setCheckSemanticErrors(false);
|
||||
rewriterView->setTextModifier(modifier);
|
||||
|
||||
@@ -2162,7 +2162,7 @@ void tst_TestCore::testModelRootNode()
|
||||
QVERIFY(childNode.isValid());
|
||||
QVERIFY(rootModelNode.isValid());
|
||||
QVERIFY(rootModelNode.isRootNode());
|
||||
} catch (const QmlDesigner::Exception &exception) {
|
||||
} catch (const Exception &exception) {
|
||||
QString errorMsg = tr("Exception: %1 %2 %3:%4").arg(exception.type(), exception.function(), exception.file()).arg(exception.line());
|
||||
QFAIL(errorMsg.toLatin1().constData());
|
||||
}
|
||||
|
||||
@@ -68,11 +68,11 @@ void tst_SimpleReader::testWellFormed()
|
||||
" propertyBlah: false\n"
|
||||
"}\n";
|
||||
|
||||
QmlJS::SimpleReaderNode::WeakPtr weak01;
|
||||
QmlJS::SimpleReaderNode::WeakPtr weak02;
|
||||
SimpleReaderNode::WeakPtr weak01;
|
||||
SimpleReaderNode::WeakPtr weak02;
|
||||
{
|
||||
QmlJS::SimpleReader reader;
|
||||
QmlJS::SimpleReaderNode::Ptr rootNode = reader.readFromSource(source);
|
||||
SimpleReader reader;
|
||||
SimpleReaderNode::Ptr rootNode = reader.readFromSource(source);
|
||||
QVERIFY(reader.errors().isEmpty());
|
||||
QVERIFY(rootNode);
|
||||
QVERIFY(rootNode->isValid());
|
||||
@@ -90,7 +90,7 @@ void tst_SimpleReader::testWellFormed()
|
||||
QVERIFY(rootNode->children().first()->properties().contains("property01"));
|
||||
QCOMPARE(rootNode->children().first()->property("property01").toInt(), 10);
|
||||
|
||||
QmlJS::SimpleReaderNode::Ptr secondChild = rootNode->children().at(1);
|
||||
SimpleReaderNode::Ptr secondChild = rootNode->children().at(1);
|
||||
|
||||
QVERIFY(secondChild);
|
||||
QVERIFY(secondChild->isValid());
|
||||
@@ -102,7 +102,7 @@ void tst_SimpleReader::testWellFormed()
|
||||
|
||||
QCOMPARE(secondChild->children().count(), 1);
|
||||
|
||||
QmlJS::SimpleReaderNode::Ptr innerChild = secondChild->children().first();
|
||||
SimpleReaderNode::Ptr innerChild = secondChild->children().first();
|
||||
|
||||
QVERIFY(innerChild);
|
||||
QVERIFY(innerChild->isValid());
|
||||
@@ -134,8 +134,8 @@ void tst_SimpleReader::testIllFormed01()
|
||||
" }\n"
|
||||
" propertyBlah: false\n"
|
||||
"}\n";
|
||||
QmlJS::SimpleReader reader;
|
||||
QmlJS::SimpleReaderNode::Ptr rootNode = reader.readFromSource(source);
|
||||
SimpleReader reader;
|
||||
SimpleReaderNode::Ptr rootNode = reader.readFromSource(source);
|
||||
|
||||
QVERIFY(!rootNode);
|
||||
QVERIFY(!reader.errors().empty());
|
||||
@@ -157,8 +157,8 @@ void tst_SimpleReader::testIllFormed02()
|
||||
" }\n"
|
||||
"}\n";
|
||||
|
||||
QmlJS::SimpleReader reader;
|
||||
QmlJS::SimpleReaderNode::Ptr rootNode = reader.readFromSource(source);
|
||||
SimpleReader reader;
|
||||
SimpleReaderNode::Ptr rootNode = reader.readFromSource(source);
|
||||
|
||||
QVERIFY(rootNode);
|
||||
QVERIFY(rootNode->isValid());
|
||||
@@ -167,7 +167,7 @@ void tst_SimpleReader::testIllFormed02()
|
||||
QVERIFY(!reader.errors().empty());
|
||||
QCOMPARE(reader.errors().count(), 2);
|
||||
|
||||
QmlJS::SimpleReaderNode::Ptr firstChild = rootNode->children().at(0);
|
||||
SimpleReaderNode::Ptr firstChild = rootNode->children().at(0);
|
||||
|
||||
QVERIFY(firstChild);
|
||||
QVERIFY(firstChild->isValid());
|
||||
@@ -192,8 +192,8 @@ void tst_SimpleReader::testArrays()
|
||||
variantList << QVariant(QLatin1String("string01")) << QVariant(QLatin1String("string02"));
|
||||
const QVariant variant = variantList;
|
||||
|
||||
QmlJS::SimpleReader reader;
|
||||
QmlJS::SimpleReaderNode::Ptr rootNode = reader.readFromSource(source);
|
||||
SimpleReader reader;
|
||||
SimpleReaderNode::Ptr rootNode = reader.readFromSource(source);
|
||||
|
||||
QVERIFY(rootNode);
|
||||
QVERIFY(rootNode->isValid());
|
||||
@@ -202,7 +202,7 @@ void tst_SimpleReader::testArrays()
|
||||
QCOMPARE(rootNode->property("propertyArray"), variant);
|
||||
|
||||
|
||||
QmlJS::SimpleReaderNode::Ptr firstChild = rootNode->children().at(0);
|
||||
SimpleReaderNode::Ptr firstChild = rootNode->children().at(0);
|
||||
|
||||
QVERIFY(firstChild);
|
||||
QVERIFY(firstChild->isValid());
|
||||
@@ -243,8 +243,8 @@ void tst_SimpleReader::testBug01()
|
||||
" }\n"
|
||||
"}\n";
|
||||
|
||||
QmlJS::SimpleReader reader;
|
||||
QmlJS::SimpleReaderNode::Ptr rootNode = reader.readFromSource(source);
|
||||
SimpleReader reader;
|
||||
SimpleReaderNode::Ptr rootNode = reader.readFromSource(source);
|
||||
|
||||
QVERIFY(rootNode);
|
||||
QVERIFY(rootNode->isValid());
|
||||
|
||||
Reference in New Issue
Block a user