Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
0fd0e6a9
Commit
0fd0e6a9
authored
Jun 24, 2010
by
Christian Kamm
Browse files
QmlJS: Make the project always return absolute import paths.
Task-number: QTCREATORBUG-1728 Reviewed-by: Kai Koehne
parent
d2944d22
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.cpp
View file @
0fd0e6a9
...
...
@@ -10,6 +10,7 @@ class QmlProjectItemPrivate : public QObject {
public:
QString
sourceDirectory
;
QStringList
importPaths
;
QStringList
absoluteImportPaths
;
QList
<
QmlFileFilterItem
*>
qmlFileFilters
()
const
;
...
...
@@ -77,23 +78,34 @@ void QmlProjectItem::setSourceDirectory(const QString &directoryPath)
}
}
setImportPaths
(
d
->
importPaths
);
emit
sourceDirectoryChanged
();
}
QStringList
QmlProjectItem
::
importPaths
()
const
{
Q_D
(
const
QmlProjectItem
);
return
d
->
i
mportPaths
;
return
d
->
absoluteI
mportPaths
;
}
void
QmlProjectItem
::
setImportPaths
(
const
QStringList
&
importPaths
)
{
Q_D
(
QmlProjectItem
);
if
(
d
->
importPaths
==
importPaths
)
if
(
d
->
importPaths
!=
importPaths
)
d
->
importPaths
=
importPaths
;
// convert to absolute paths
QStringList
absoluteImportPaths
;
const
QDir
sourceDir
(
sourceDirectory
());
foreach
(
const
QString
&
importPath
,
importPaths
)
absoluteImportPaths
+=
QDir
::
cleanPath
(
sourceDir
.
absoluteFilePath
(
importPath
));
if
(
d
->
absoluteImportPaths
==
absoluteImportPaths
)
return
;
d
->
i
mportPaths
=
i
mportPaths
;
d
->
absoluteI
mportPaths
=
absoluteI
mportPaths
;
emit
importPathsChanged
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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