From 569228bb5d7759025f06b1963f3d4a1fc4e05694 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Thu, 29 Sep 2011 14:36:44 +0200 Subject: nano-opts, styling fixes Merge-request: 1344 Reviewed-by: Jan-Arve Saether --- src/corelib/plugin/qsystemlibrary.cpp | 13 ++++++------- src/corelib/plugin/qsystemlibrary_p.h | 9 +++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/corelib/plugin/qsystemlibrary.cpp b/src/corelib/plugin/qsystemlibrary.cpp index c983f38..7296c5b 100644 --- a/src/corelib/plugin/qsystemlibrary.cpp +++ b/src/corelib/plugin/qsystemlibrary.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "qsystemlibrary_p.h" + #include #include #include @@ -91,7 +92,7 @@ HINSTANCE QSystemLibrary::load(const wchar_t *libraryName, bool onlySystemDirect extern QString qAppFileName(); #endif -static QString qSystemDirectory() +static inline QString qSystemDirectory() { QVarLengthArray fullPath; @@ -118,24 +119,22 @@ HINSTANCE QSystemLibrary::load(const wchar_t *libraryName, bool onlySystemDirect const QString PATH = QString::fromWCharArray((const wchar_t *)_wgetenv(L"PATH")); searchOrder << PATH.split(QLatin1Char(';'), QString::SkipEmptyParts); } - QString fileName = QString::fromWCharArray(libraryName); - fileName.append(QLatin1String(".dll")); + const QString fileName = QString::fromWCharArray(libraryName) + QLatin1String(".dll"); // Start looking in the order specified for (int i = 0; i < searchOrder.count(); ++i) { QString fullPathAttempt = searchOrder.at(i); - if (!fullPathAttempt.endsWith(QLatin1Char('\\'))) { + if (!fullPathAttempt.endsWith(QLatin1Char('\\'))) fullPathAttempt.append(QLatin1Char('\\')); - } fullPathAttempt.append(fileName); HINSTANCE inst = ::LoadLibrary((const wchar_t *)fullPathAttempt.utf16()); if (inst != 0) return inst; } - return 0; + return 0; } -#endif //Q_OS_WINCE +#endif // !Q_OS_WINCE QT_END_NAMESPACE diff --git a/src/corelib/plugin/qsystemlibrary_p.h b/src/corelib/plugin/qsystemlibrary_p.h index f20d0b6..88ab82c 100644 --- a/src/corelib/plugin/qsystemlibrary_p.h +++ b/src/corelib/plugin/qsystemlibrary_p.h @@ -85,9 +85,9 @@ public: if (!m_handle) return 0; #ifdef Q_OS_WINCE - return (void*)GetProcAddress(m_handle, (const wchar_t*)QString::fromLatin1(symbol).utf16()); + return (void*)GetProcAddress(m_handle, (const wchar_t*)QString::fromLatin1(symbol).utf16()); #else - return (void*)GetProcAddress(m_handle, symbol); + return (void*)GetProcAddress(m_handle, symbol); #endif } @@ -97,6 +97,7 @@ public: } static Q_CORE_EXPORT HINSTANCE load(const wchar_t *lpFileName, bool onlySystemDirectory = true); + private: HINSTANCE m_handle; QString m_libraryName; @@ -105,6 +106,6 @@ private: QT_END_NAMESPACE -#endif //Q_OS_WIN +#endif // Q_OS_WIN -#endif //QSYSTEMLIBRARY_P_H +#endif // QSYSTEMLIBRARY_P_H -- cgit v0.12