Improve performance of QLibrary::load()

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>
This commit is contained in:
Sean Harmer 2012-07-18 09:14:41 +01:00 committed by Qt by Nokia
parent 33292ab1ae
commit fa3cc59868

View 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