summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin/qpluginloader.cpp
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2009-06-08 12:00:05 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2009-06-08 12:00:05 (GMT)
commitd21b8174071c56aaf8625229e4b7f50292619868 (patch)
treeb910c8fb1a87b8e79f9134671af2692342981b81 /src/corelib/plugin/qpluginloader.cpp
parentefc999e95a74eee7e282e8d34e681c5b18cb60ad (diff)
parent23ae8b6badfd688f962590268a6147771d27266c (diff)
downloadQt-d21b8174071c56aaf8625229e4b7f50292619868.zip
Qt-d21b8174071c56aaf8625229e4b7f50292619868.tar.gz
Qt-d21b8174071c56aaf8625229e4b7f50292619868.tar.bz2
Merge branch 'master' of git@scm.dev.troll.no:qt/qt-s60-public
Diffstat (limited to 'src/corelib/plugin/qpluginloader.cpp')
-rw-r--r--src/corelib/plugin/qpluginloader.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
index a911f1d..8d1c0f7 100644
--- a/src/corelib/plugin/qpluginloader.cpp
+++ b/src/corelib/plugin/qpluginloader.cpp
@@ -46,6 +46,7 @@
#include <qfileinfo.h>
#include "qlibrary_p.h"
#include "qdebug.h"
+#include "qdir.h"
#ifndef QT_NO_LIBRARY
@@ -301,6 +302,24 @@ void QPluginLoader::setFileName(const QString &fileName)
}
QString fn = fi.canonicalFilePath();
+ // If not found directly, check also all the available drives
+ if (!fn.length()) {
+ QString stubPath(fi.fileName().length() ? fi.absoluteFilePath() : QString());
+ if (stubPath.length() > 1) {
+ if (stubPath.at(1).toAscii() == ':')
+ stubPath.remove(0,2);
+ QFileInfoList driveList(QDir::drives());
+ foreach(const QFileInfo& drive, driveList) {
+ QString testFilePath(drive.absolutePath() + stubPath);
+ testFilePath = QDir::cleanPath(testFilePath);
+ if (QFile::exists(testFilePath)) {
+ fn = testFilePath;
+ break;
+ }
+ }
+ }
+ }
+
#else
QString fn = QFileInfo(fileName).canonicalFilePath();
#endif