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
1ec6cbd9
Commit
1ec6cbd9
authored
Jan 29, 2010
by
Christian Kamm
Browse files
Fix for renamed directory imports in the QML code model.
parent
a2d44959
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/libs/qmljs/qmljslink.cpp
View file @
1ec6cbd9
...
...
@@ -60,6 +60,8 @@ void LinkImports::linkImports(Bind *bind, const QList<Bind *> &binds)
path
+=
it
->
import
->
fileName
->
asString
();
path
=
QDir
::
cleanPath
(
path
);
ObjectValue
*
importNamespace
=
0
;
foreach
(
Bind
*
otherBind
,
binds
)
{
Document
::
Ptr
otherDoc
=
otherBind
->
_doc
;
QFileInfo
otherFileInfo
(
otherDoc
->
fileName
());
...
...
@@ -70,11 +72,9 @@ void LinkImports::linkImports(Bind *bind, const QList<Bind *> &binds)
if
(
!
directoryImport
&&
!
fileImport
)
continue
;
ObjectValue
*
importInto
=
bind
->
_typeEnvironment
;
if
(
directoryImport
&&
it
->
import
->
importId
)
{
ObjectValue
*
namespaceObject
=
bind
->
_interp
->
newObject
(
/*prototype =*/
0
);
importInto
->
setProperty
(
it
->
import
->
importId
->
asString
(),
namespaceObject
);
importInto
=
namespaceObject
;
if
(
directoryImport
&&
it
->
import
->
importId
&&
!
importNamespace
)
{
importNamespace
=
bind
->
_interp
->
newObject
(
/*prototype =*/
0
);
bind
->
_typeEnvironment
->
setProperty
(
it
->
import
->
importId
->
asString
(),
importNamespace
);
}
QString
targetName
;
...
...
@@ -84,6 +84,10 @@ void LinkImports::linkImports(Bind *bind, const QList<Bind *> &binds)
targetName
=
componentName
(
otherFileInfo
.
fileName
());
}
ObjectValue
*
importInto
=
bind
->
_typeEnvironment
;
if
(
importNamespace
)
importInto
=
importNamespace
;
importInto
->
setProperty
(
targetName
,
otherBind
->
_rootObjectValue
);
}
}
...
...
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