From cc9020490ac5e0fba580f73ca8b9948a1b4b54bf Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Wed, 18 Jul 2012 16:04:05 +0100 Subject: 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 --- src/corelib/plugin/qlibrary_unix.cpp | 14 +++++++------- 1 file 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 #include "qlibrary_p.h" -#include #include +#include #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 -- cgit v0.12