summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorikause <qt-info@nokia.com>2009-06-05 13:23:01 (GMT)
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2009-06-08 07:00:02 (GMT)
commit768cab51239a45f00d5ee3857efecd3d2cdcb99b (patch)
tree115c23175bd8547457c4e0b44d20aa7dfb7f1e63 /src/corelib
parent7087433fb6f77746678963b1a97fc18daab831fa (diff)
downloadQt-768cab51239a45f00d5ee3857efecd3d2cdcb99b.zip
Qt-768cab51239a45f00d5ee3857efecd3d2cdcb99b.tar.gz
Qt-768cab51239a45f00d5ee3857efecd3d2cdcb99b.tar.bz2
Bug fix for 251870
A correction to this defect: 251870 QPluginLoader will only look for stubs from single drive, though plugins themselves can be located on any drive. Now the implementation goes through all the available drives if given path does not find corresponding stub-file in QPluginLoader::setFileName(). Since this is Symbian specific functionality, all the changes are behind Q_OS_SYMBIAN-flags. Note: Updated tests now need memory card being installed to device under test. Otherwise the test will be skipped. In case needed, drive is easy to change to tests. D-drive could also be a good option. modified: src/corelib/plugin/qpluginloader.cpp modified: tests/auto/qpluginloader/tst_qpluginloader.cpp Reviewed-By: Miikka Heikkinen
Diffstat (limited to 'src/corelib')
-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