Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
flatpak-qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marco Bubke
flatpak-qt-creator
Commits
d8d46ed1
Commit
d8d46ed1
authored
14 years ago
by
Olivier Goffart
Browse files
Options
Downloads
Patches
Plain Diff
qmljsinspector: small code cleanup
parent
0fe26e80
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/qmljsinspector/qmljsclientproxy.cpp
+8
-9
8 additions, 9 deletions
src/plugins/qmljsinspector/qmljsclientproxy.cpp
src/plugins/qmljsinspector/qmljsclientproxy.h
+3
-3
3 additions, 3 deletions
src/plugins/qmljsinspector/qmljsclientproxy.h
with
11 additions
and
12 deletions
src/plugins/qmljsinspector/qmljsclientproxy.cpp
+
8
−
9
View file @
d8d46ed1
...
@@ -43,7 +43,6 @@
...
@@ -43,7 +43,6 @@
#include
<QUrl>
#include
<QUrl>
#include
<QAbstractSocket>
#include
<QAbstractSocket>
#include
<QDebug>
#include
<QDebug>
#include
<QFileInfo>
using
namespace
QmlJSInspector
::
Internal
;
using
namespace
QmlJSInspector
::
Internal
;
...
@@ -199,24 +198,22 @@ QDeclarativeDebugObjectReference ClientProxy::objectReferenceForId(int debugId,
...
@@ -199,24 +198,22 @@ QDeclarativeDebugObjectReference ClientProxy::objectReferenceForId(int debugId,
return
QDeclarativeDebugObjectReference
();
return
QDeclarativeDebugObjectReference
();
}
}
QList
<
QDeclarativeDebugObjectReference
>
ClientProxy
::
objectReferences
(
const
QUrl
&
url
)
const
QList
<
QDeclarativeDebugObjectReference
>
ClientProxy
::
objectReferences
()
const
{
{
QList
<
QDeclarativeDebugObjectReference
>
result
;
QList
<
QDeclarativeDebugObjectReference
>
result
;
foreach
(
const
QDeclarativeDebugObjectReference
&
it
,
m_rootObjects
)
{
foreach
(
const
QDeclarativeDebugObjectReference
&
it
,
m_rootObjects
)
{
result
.
append
(
objectReferences
(
url
,
it
));
result
.
append
(
objectReferences
(
it
));
}
}
return
result
;
return
result
;
}
}
QList
<
QDeclarativeDebugObjectReference
>
ClientProxy
::
objectReferences
(
const
QUrl
&
url
,
QList
<
QDeclarativeDebugObjectReference
>
ClientProxy
::
objectReferences
(
const
QDeclarativeDebugObjectReference
&
objectRef
)
const
const
QDeclarativeDebugObjectReference
&
objectRef
)
const
{
{
QList
<
QDeclarativeDebugObjectReference
>
result
;
QList
<
QDeclarativeDebugObjectReference
>
result
;
if
(
objectRef
.
source
().
url
()
==
url
||
url
.
isEmpty
())
result
.
append
(
objectRef
);
result
.
append
(
objectRef
);
foreach
(
const
QDeclarativeDebugObjectReference
&
child
,
objectRef
.
children
())
{
foreach
(
const
QDeclarativeDebugObjectReference
&
child
,
objectRef
.
children
())
{
result
.
append
(
objectReferences
(
url
,
child
));
result
.
append
(
objectReferences
(
child
));
}
}
return
result
;
return
result
;
...
@@ -353,6 +350,8 @@ void ClientProxy::buildDebugIdHashRecursive(const QDeclarativeDebugObjectReferen
...
@@ -353,6 +350,8 @@ void ClientProxy::buildDebugIdHashRecursive(const QDeclarativeDebugObjectReferen
int
lineNum
=
ref
.
source
().
lineNumber
();
int
lineNum
=
ref
.
source
().
lineNumber
();
int
colNum
=
ref
.
source
().
columnNumber
();
int
colNum
=
ref
.
source
().
columnNumber
();
int
rev
=
0
;
int
rev
=
0
;
// handle the case where the url contains the revision number encoded. (for object created by the debugger)
static
QRegExp
rx
(
"^(.*)_(
\\
d+):(
\\
d+)$"
);
static
QRegExp
rx
(
"^(.*)_(
\\
d+):(
\\
d+)$"
);
if
(
rx
.
exactMatch
(
filename
))
{
if
(
rx
.
exactMatch
(
filename
))
{
filename
=
rx
.
cap
(
1
);
filename
=
rx
.
cap
(
1
);
...
@@ -365,13 +364,13 @@ void ClientProxy::buildDebugIdHashRecursive(const QDeclarativeDebugObjectReferen
...
@@ -365,13 +364,13 @@ void ClientProxy::buildDebugIdHashRecursive(const QDeclarativeDebugObjectReferen
if
(
isShadowBuild
&&
rev
==
0
)
{
if
(
isShadowBuild
&&
rev
==
0
)
{
QString
shadowBuildDir
=
InspectorUi
::
instance
()
->
debugProjectBuildDirectory
();
QString
shadowBuildDir
=
InspectorUi
::
instance
()
->
debugProjectBuildDirectory
();
//QFileInfo objectFileInfo(filename);
if
(
filename
.
startsWith
(
shadowBuildDir
))
{
if
(
filename
.
startsWith
(
shadowBuildDir
))
{
ProjectExplorer
::
Project
*
debugProject
=
InspectorUi
::
instance
()
->
debugProject
();
ProjectExplorer
::
Project
*
debugProject
=
InspectorUi
::
instance
()
->
debugProject
();
filename
=
debugProject
->
projectDirectory
()
+
filename
.
mid
(
shadowBuildDir
.
length
());
filename
=
debugProject
->
projectDirectory
()
+
filename
.
mid
(
shadowBuildDir
.
length
());
}
}
}
}
// append the debug ids in the hash
m_debugIdHash
[
qMakePair
<
QString
,
int
>
(
filename
,
rev
)][
qMakePair
<
int
,
int
>
(
lineNum
,
colNum
)].
append
(
ref
.
debugId
());
m_debugIdHash
[
qMakePair
<
QString
,
int
>
(
filename
,
rev
)][
qMakePair
<
int
,
int
>
(
lineNum
,
colNum
)].
append
(
ref
.
debugId
());
foreach
(
const
QDeclarativeDebugObjectReference
&
it
,
ref
.
children
())
foreach
(
const
QDeclarativeDebugObjectReference
&
it
,
ref
.
children
())
...
...
This diff is collapsed.
Click to expand it.
src/plugins/qmljsinspector/qmljsclientproxy.h
+
3
−
3
View file @
d8d46ed1
...
@@ -67,8 +67,8 @@ public:
...
@@ -67,8 +67,8 @@ public:
bool
resetBindingForObject
(
int
objectDebugId
,
const
QString
&
propertyName
);
bool
resetBindingForObject
(
int
objectDebugId
,
const
QString
&
propertyName
);
void
clearComponentCache
();
void
clearComponentCache
();
// returns the object references
for the given url.
// returns the object references
QList
<
QDeclarativeDebugObjectReference
>
objectReferences
(
const
QUrl
&
url
=
QUrl
()
)
const
;
QList
<
QDeclarativeDebugObjectReference
>
objectReferences
()
const
;
QDeclarativeDebugObjectReference
objectReferenceForId
(
int
debugId
)
const
;
QDeclarativeDebugObjectReference
objectReferenceForId
(
int
debugId
)
const
;
QList
<
QDeclarativeDebugObjectReference
>
rootObjectReference
()
const
;
QList
<
QDeclarativeDebugObjectReference
>
rootObjectReference
()
const
;
DebugIdHash
debugIdHash
()
const
{
return
m_debugIdHash
;
};
DebugIdHash
debugIdHash
()
const
{
return
m_debugIdHash
;
};
...
@@ -137,7 +137,7 @@ private:
...
@@ -137,7 +137,7 @@ private:
bool
isDesignClientConnected
()
const
;
bool
isDesignClientConnected
()
const
;
void
reloadEngines
();
void
reloadEngines
();
QList
<
QDeclarativeDebugObjectReference
>
objectReferences
(
const
QUrl
&
url
,
const
QDeclarativeDebugObjectReference
&
objectRef
)
const
;
QList
<
QDeclarativeDebugObjectReference
>
objectReferences
(
const
QDeclarativeDebugObjectReference
&
objectRef
)
const
;
QDeclarativeDebugObjectReference
objectReferenceForId
(
int
debugId
,
const
QDeclarativeDebugObjectReference
&
ref
)
const
;
QDeclarativeDebugObjectReference
objectReferenceForId
(
int
debugId
,
const
QDeclarativeDebugObjectReference
&
ref
)
const
;
private
:
private
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment