Fix Clazy non-pod-global-static warnings

This commit is contained in:
Cameron Gutman
2026-01-26 21:42:12 -06:00
parent 4eaf037c75
commit 8c9c799f81
2 changed files with 28 additions and 27 deletions

View File

@@ -55,7 +55,8 @@
#define CURRENT_DEFAULT_VER 2
static StreamingPreferences* s_GlobalPrefs;
static QReadWriteLock s_GlobalPrefsLock;
Q_GLOBAL_STATIC(QReadWriteLock, s_GlobalPrefsLock)
StreamingPreferences::StreamingPreferences(QQmlEngine *qmlEngine)
: m_QmlEngine(qmlEngine)
@@ -66,7 +67,7 @@ StreamingPreferences::StreamingPreferences(QQmlEngine *qmlEngine)
StreamingPreferences* StreamingPreferences::get(QQmlEngine *qmlEngine)
{
{
QReadLocker readGuard(&s_GlobalPrefsLock);
QReadLocker readGuard(s_GlobalPrefsLock);
// If we have a preference object and it's associated with a QML engine or
// if the caller didn't specify a QML engine, return the existing object.
@@ -78,7 +79,7 @@ StreamingPreferences* StreamingPreferences::get(QQmlEngine *qmlEngine)
}
{
QWriteLocker writeGuard(&s_GlobalPrefsLock);
QWriteLocker writeGuard(s_GlobalPrefsLock);
// If we already have an preference object but the QML engine is now available,
// associate the QML engine with the preferences.