Improve performance of QLibrary::load()
authorSean Harmer <sean.harmer@kdab.com>
Wed, 18 Jul 2012 08:14:41 +0000 (09:14 +0100)
committerQt by Nokia <qt-info@nokia.com>
Sat, 21 Jul 2012 09:26:30 +0000 (11:26 +0200)
There is no need to create a QFileInfo object to split the path and
filename.

Change-Id: I54ebb4b62ebdd93a257bce0b337ac0012f0d5a56
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
src/corelib/plugin/qlibrary_unix.cpp

index 7062a37..abfbeb2 100644 (file)
@@ -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,10 +84,10 @@ bool QLibraryPrivate::load_sys()
 {
     QString attempt;
 #if !defined(QT_NO_DYNAMIC_LIBRARY)
-    QFileInfo fi(fileName);
+    QFileSystemEntry fsEntry(fileName);
 
-    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