Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
6559ec7d
Commit
6559ec7d
authored
Jun 29, 2010
by
Roberto Raggi
Browse files
Cleanup.
parent
1952f06c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmljsinspector/qmljsdelta.cpp
View file @
6559ec7d
...
...
@@ -331,6 +331,10 @@ static QString propertyName(UiQualifiedId *id)
void
Delta
::
operator
()(
Document
::
Ptr
doc
,
Document
::
Ptr
previousDoc
)
{
_doc
=
doc
;
_previousDoc
=
previousDoc
;
_changes
.
clear
();
const
QUrl
url
=
QUrl
::
fromLocalFile
(
doc
->
fileName
());
ScriptBindingParser
bindingParser
(
doc
,
ClientProxy
::
instance
()
->
objectReferences
(
url
));
bindingParser
.
process
();
...
...
@@ -399,18 +403,26 @@ void Delta::operator()(Document::Ptr doc, Document::Ptr previousDoc)
}
void
Delta
::
updateScriptBinding
(
const
QDeclarativeDebugObjectReference
&
objectReference
,
UiScriptBinding
*
scriptBinding
,
const
QString
&
propertyName
,
const
QString
&
scriptCode
)
UiScriptBinding
*
scriptBinding
,
const
QString
&
propertyName
,
const
QString
&
scriptCode
)
{
qDebug
()
<<
"update script:"
<<
propertyName
<<
scriptCode
<<
scriptBinding
;
QVariant
expr
=
scriptCode
;
//qDebug() << " " << scriptBinding->statement->kind << typeid(*scriptBinding->statement).name();
bool
isLiteral
=
isLiteralValue
(
scriptBinding
);
const
bool
isLiteral
=
isLiteralValue
(
scriptBinding
);
if
(
isLiteral
)
expr
=
castToLiteral
(
scriptCode
,
scriptBinding
);
ClientProxy
::
instance
()
->
setBindingForObject
(
objectReference
.
debugId
(),
propertyName
,
expr
,
isLiteral
);
Change
change
;
change
.
script
=
scriptBinding
;
change
.
ref
=
objectReference
;
change
.
isLiteral
=
isLiteral
;
_changes
.
append
(
change
);
ClientProxy
::
instance
()
->
setBindingForObject
(
objectReference
.
debugId
(),
propertyName
,
expr
,
isLiteral
);
// ### remove
}
bool
Delta
::
compare
(
UiQualifiedId
*
id
,
UiQualifiedId
*
other
)
...
...
@@ -437,3 +449,18 @@ UiObjectMemberList *Delta::objectMembers(UiObjectMember *object)
return
0
;
}
Document
::
Ptr
Delta
::
document
()
const
{
return
_doc
;
}
Document
::
Ptr
Delta
::
previousDocument
()
const
{
return
_previousDoc
;
}
QList
<
Delta
::
Change
>
Delta
::
changes
()
const
{
return
_changes
;
}
src/plugins/qmljsinspector/qmljsdelta.h
View file @
6559ec7d
...
...
@@ -40,9 +40,23 @@ namespace Internal {
class
Delta
{
public:
struct
Change
{
Change
()
:
script
(
0
),
isLiteral
(
false
)
{}
QmlJS
::
AST
::
UiScriptBinding
*
script
;
bool
isLiteral
;
QDeclarativeDebugObjectReference
ref
;
};
public:
void
operator
()(
QmlJS
::
Document
::
Ptr
doc
,
QmlJS
::
Document
::
Ptr
previousDoc
);
QList
<
Change
>
changes
()
const
;
QmlJS
::
Document
::
Ptr
document
()
const
;
QmlJS
::
Document
::
Ptr
previousDocument
()
const
;
private:
void
updateScriptBinding
(
const
QDeclarativeDebugObjectReference
&
objectReference
,
QmlJS
::
AST
::
UiScriptBinding
*
scriptBinding
,
...
...
@@ -51,6 +65,11 @@ private:
bool
compare
(
QmlJS
::
AST
::
UiQualifiedId
*
id
,
QmlJS
::
AST
::
UiQualifiedId
*
other
);
QmlJS
::
AST
::
UiObjectMemberList
*
objectMembers
(
QmlJS
::
AST
::
UiObjectMember
*
object
);
private:
QmlJS
::
Document
::
Ptr
_doc
;
QmlJS
::
Document
::
Ptr
_previousDoc
;
QList
<
Change
>
_changes
;
};
}
// namespace Internal
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment