summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2012-07-18 15:04:05 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-07-27 16:07:01 (GMT)
commitcc9020490ac5e0fba580f73ca8b9948a1b4b54bf (patch)
treeb33fc00953e9aef963f6a007a36f01977bcafd1c
parentc18a93ae40393293c1e2bc9db44e1d2b5bd6f6db (diff)
downloadQt-cc9020490ac5e0fba580f73ca8b9948a1b4b54bf.zip
Qt-cc9020490ac5e0fba580f73ca8b9948a1b4b54bf.tar.gz
Qt-cc9020490ac5e0fba580f73ca8b9948a1b4b54bf.tar.bz2
Improve performance of QLibrary::load()
There is no need to create a QFileInfo object to split the path and filename. Backport of 503fe0a5b763c4c27cde54befe58e4726cd216f2 Change-Id: I0ce0e6e4cc64639dbfabe233d82b57c91b3055ca Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
-rw-r--r--src/corelib/plugin/qlibrary_unix.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp
index 00dc157..1d0f322 100644
--- a/src/corelib/plugin/qlibrary_unix.cpp
+++ b/src/corelib/plugin/qlibrary_unix.cpp
@@ -43,8 +43,8 @@
#include <qfile.h>
#include "qlibrary_p.h"
-#include <qfileinfo.h>
#include <qcoreapplication.h>
+#include <private/qfilesystementry_p.h>
#ifndef QT_NO_LIBRARY
@@ -84,20 +84,20 @@ bool QLibraryPrivate::load_sys()
{
QString attempt;
#if !defined(QT_NO_DYNAMIC_LIBRARY)
- QFileInfo fi(fileName);
+ QFileSystemEntry fsEntry(fileName);
#if defined(Q_OS_SYMBIAN)
QString path; // In Symbian, always resolve with just the filename
QString name;
// Replace possible ".qtplugin" suffix with ".dll"
- if (fi.suffix() == QLatin1String("qtplugin"))
- name = fi.completeBaseName() + QLatin1String(".dll");
+ if (fsEntry.suffix() == QLatin1String("qtplugin"))
+ name = fsEntry.completeBaseName() + QLatin1String(".dll");
else
- name = fi.fileName();
+ name = fsEntry.fileName();
#else
- QString path = fi.path();
- QString name = fi.fileName();
+ QString path = fsEntry.path();
+ QString name = fsEntry.fileName();
if (path == QLatin1String(".") && !fileName.startsWith(path))
path.clear();
else