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
8d70ab27
Commit
8d70ab27
authored
Apr 01, 2010
by
Christian Kamm
Browse files
QmlJS: Clean paths in the Snapshot.
To solve import resolution issues on windows. Reviewed-by: Roberto Raggi
parent
80fa3216
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/libs/qmljs/qmljsdocument.cpp
View file @
8d70ab27
...
...
@@ -47,10 +47,10 @@ Document::Document(const QString &fileName)
,
_isQmlDocument
(
false
)
,
_documentRevision
(
0
)
,
_parsedCorrectly
(
false
)
,
_fileName
(
fileName
)
,
_fileName
(
QDir
::
cleanPath
(
fileName
)
)
{
QFileInfo
fileInfo
(
fileName
);
_path
=
fileInfo
.
absolutePath
();
_path
=
QDir
::
cleanPath
(
fileInfo
.
absolutePath
()
)
;
// ### Should use mime type
if
(
fileInfo
.
suffix
()
==
QLatin1String
(
"qml"
)
...
...
@@ -258,7 +258,7 @@ void Snapshot::insert(const Document::Ptr &document)
void
Snapshot
::
insertLibraryInfo
(
const
QString
&
path
,
const
LibraryInfo
&
info
)
{
_libraries
.
insert
(
path
,
info
);
_libraries
.
insert
(
QDir
::
cleanPath
(
path
)
,
info
);
}
Document
::
Ptr
Snapshot
::
documentFromSource
(
const
QString
&
code
,
...
...
@@ -314,3 +314,18 @@ QMap<QString, Document::Ptr> Snapshot::componentsDefinedByImportedDocuments(cons
return
result
;
}
Document
::
Ptr
Snapshot
::
document
(
const
QString
&
fileName
)
const
{
return
_documents
.
value
(
QDir
::
cleanPath
(
fileName
));
}
QList
<
Document
::
Ptr
>
Snapshot
::
documentsInDirectory
(
const
QString
&
path
)
const
{
return
_documentsByPath
.
values
(
QDir
::
cleanPath
(
path
));
}
LibraryInfo
Snapshot
::
libraryInfo
(
const
QString
&
path
)
const
{
return
_libraries
.
value
(
QDir
::
cleanPath
(
path
));
}
src/libs/qmljs/qmljsdocument.h
View file @
8d70ab27
...
...
@@ -149,14 +149,9 @@ public:
void
insert
(
const
Document
::
Ptr
&
document
);
void
insertLibraryInfo
(
const
QString
&
path
,
const
LibraryInfo
&
info
);
Document
::
Ptr
document
(
const
QString
&
fileName
)
const
{
return
_documents
.
value
(
fileName
);
}
QList
<
Document
::
Ptr
>
documentsInDirectory
(
const
QString
&
path
)
const
{
return
_documentsByPath
.
values
(
path
);
}
LibraryInfo
libraryInfo
(
const
QString
&
path
)
const
{
return
_libraries
.
value
(
path
);
}
Document
::
Ptr
document
(
const
QString
&
fileName
)
const
;
QList
<
Document
::
Ptr
>
documentsInDirectory
(
const
QString
&
path
)
const
;
LibraryInfo
libraryInfo
(
const
QString
&
path
)
const
;
Document
::
Ptr
documentFromSource
(
const
QString
&
code
,
const
QString
&
fileName
)
const
;
...
...
Write
Preview
Markdown
is supported
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