QSystemLibrary: Use in-class initialization

Initialize the member variables in class. It's more modern and
also saves some typing in some constructor functions.

Change-Id: Ib4d942610a57e0af3f22248c00207d7cdb683763
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Yuhang Zhao 2022-08-17 20:02:10 +08:00
parent c2bcba0d3c
commit 00618db5ff

View File

@ -28,15 +28,11 @@ public:
explicit QSystemLibrary(const QString &libraryName)
{
m_libraryName = libraryName;
m_handle = nullptr;
m_didLoad = false;
}
explicit QSystemLibrary(const wchar_t *libraryName)
{
m_libraryName = QString::fromWCharArray(libraryName);
m_handle = nullptr;
m_didLoad = false;
}
bool load(bool onlySystemDirectory = true)
@ -66,10 +62,11 @@ public:
}
static Q_CORE_EXPORT HINSTANCE load(const wchar_t *lpFileName, bool onlySystemDirectory = true);
private:
HINSTANCE m_handle;
QString m_libraryName;
bool m_didLoad;
HINSTANCE m_handle = nullptr;
QString m_libraryName = {};
bool m_didLoad = false;
};
QT_END_NAMESPACE