summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2010-03-11 17:32:04 (GMT)
committermae <qt-info@nokia.com>2010-03-11 17:34:15 (GMT)
commit62c72ed2fd4aa6f5e62a190abf2dde2ba0f5ff0b (patch)
treed002968767e301fb99c533b306cbdfc2f937b16f /src/corelib/io
parent83639a479ef41257c9e06074e81b7c3304a1e982 (diff)
downloadQt-62c72ed2fd4aa6f5e62a190abf2dde2ba0f5ff0b.zip
Qt-62c72ed2fd4aa6f5e62a190abf2dde2ba0f5ff0b.tar.gz
Qt-62c72ed2fd4aa6f5e62a190abf2dde2ba0f5ff0b.tar.bz2
Fix importing qml modules from rcc resources
Done with Roberto. Reviewed-by: Roberto Raggi
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qresource.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index 6d33c8b..8e76e9e 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -1411,8 +1411,12 @@ QString QResourceFileEngine::fileName(FileName file) const
} else if(file == PathName || file == AbsolutePathName) {
const QString path = (file == AbsolutePathName) ? d->resource.absoluteFilePath() : d->resource.fileName();
const int slash = path.lastIndexOf(QLatin1Char('/'));
- if (slash != -1)
- return path.left(slash);
+ if (slash == -1)
+ return QLatin1String(":");
+ else if (slash <= 1)
+ return QLatin1String(":/");
+ return path.left(slash);
+
} else if(file == CanonicalName || file == CanonicalPathName) {
const QString absoluteFilePath = d->resource.absoluteFilePath();
if(file == CanonicalPathName) {