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:
parent
ebe270bec5
commit
d1ccd19fcc
9 changed files with 68 additions and 56 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue