mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 06:01:12 +00:00
Make StreamingPreferences a proper singleton
This removes the need for several hacks in SettingsView to force updates and improves performance by not reloading preferences all over the place.
This commit is contained in:
@@ -9,8 +9,7 @@ class StreamingPreferences : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
StreamingPreferences(QObject *parent = nullptr);
|
||||
StreamingPreferences(QQmlEngine *qmlEngine, QObject *parent = nullptr);
|
||||
static StreamingPreferences* get(QQmlEngine *qmlEngine = nullptr);
|
||||
|
||||
Q_INVOKABLE static int
|
||||
getDefaultBitrate(int width, int height, int fps);
|
||||
@@ -206,6 +205,8 @@ signals:
|
||||
void languageChanged();
|
||||
|
||||
private:
|
||||
explicit StreamingPreferences(QQmlEngine *qmlEngine);
|
||||
|
||||
QString getSuffixFromLanguage(Language lang);
|
||||
|
||||
QQmlEngine* m_QmlEngine;
|
||||
|
||||
Reference in New Issue
Block a user