mobile-widgets: replace qmlprefs::theme with qPrefDisplay::theme

Shortcut and use qPrefDisplay::theme() direct

Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
jan Iversen 2018-09-12 13:50:24 +02:00 committed by Dirk Hohndel
parent 51bc41b517
commit c9122283cc
4 changed files with 4 additions and 28 deletions

View file

@ -139,8 +139,7 @@ Kirigami.ScrollablePage {
enabled: subsurfaceTheme.currentTheme !== "Blue" enabled: subsurfaceTheme.currentTheme !== "Blue"
onClicked: { onClicked: {
blueTheme() blueTheme()
prefs.theme = subsurfaceTheme.currentTheme PrefDisplay.theme = subsurfaceTheme.currentTheme
manager.savePreferences()
} }
} }
@ -192,8 +191,7 @@ Kirigami.ScrollablePage {
enabled: subsurfaceTheme.currentTheme !== "Pink" enabled: subsurfaceTheme.currentTheme !== "Pink"
onClicked: { onClicked: {
pinkTheme() pinkTheme()
prefs.theme = subsurfaceTheme.currentTheme PrefDisplay.theme = subsurfaceTheme.currentTheme
manager.savePreferences()
} }
} }
@ -244,8 +242,7 @@ Kirigami.ScrollablePage {
enabled: subsurfaceTheme.currentTheme !== "Dark" enabled: subsurfaceTheme.currentTheme !== "Dark"
onClicked: { onClicked: {
darkTheme() darkTheme()
prefs.theme = subsurfaceTheme.currentTheme PrefDisplay.theme = subsurfaceTheme.currentTheme
manager.savePreferences()
} }
} }
} }

View file

@ -506,7 +506,7 @@ if you have network connectivity and want to sync your data to cloud storage."),
property int columnWidth: Math.round(rootItem.width/(Kirigami.Units.gridUnit*28)) > 0 ? Math.round(rootItem.width / Math.round(rootItem.width/(Kirigami.Units.gridUnit*28))) : rootItem.width property int columnWidth: Math.round(rootItem.width/(Kirigami.Units.gridUnit*28)) > 0 ? Math.round(rootItem.width / Math.round(rootItem.width/(Kirigami.Units.gridUnit*28))) : rootItem.width
Component.onCompleted: { Component.onCompleted: {
// this needs to pick the theme from persistent preference settings // this needs to pick the theme from persistent preference settings
var theme = prefs.theme var theme = PrefDisplay.theme
if (theme == "Blue") if (theme == "Blue")
blueTheme() blueTheme()
else if (theme == "Pink") else if (theme == "Pink")

View file

@ -108,19 +108,6 @@ void QMLPrefs::setShowPin(bool enable)
emit showPinChanged(); emit showPinChanged();
} }
const QString QMLPrefs::theme() const
{
return qPrefDisplay::theme();
}
void QMLPrefs::setTheme(QString theme)
{
qPrefDisplay::set_theme(theme);
emit themeChanged();
}
/*** public slot functions ***/ /*** public slot functions ***/
void QMLPrefs::cancelCredentialsPinSetup() void QMLPrefs::cancelCredentialsPinSetup()
{ {

View file

@ -33,10 +33,6 @@ class QMLPrefs : public QObject {
MEMBER m_oldStatus MEMBER m_oldStatus
WRITE setOldStatus WRITE setOldStatus
NOTIFY oldStatusChanged) NOTIFY oldStatusChanged)
Q_PROPERTY(QString theme
READ theme
WRITE setTheme
NOTIFY themeChanged)
public: public:
QMLPrefs(); QMLPrefs();
~QMLPrefs(); ~QMLPrefs();
@ -61,9 +57,6 @@ public:
bool showPin() const; bool showPin() const;
void setShowPin(bool enable); void setShowPin(bool enable);
const QString theme() const;
void setTheme(QString theme);
public slots: public slots:
void cancelCredentialsPinSetup(); void cancelCredentialsPinSetup();
void clearCredentials(); void clearCredentials();
@ -84,7 +77,6 @@ signals:
void credentialStatusChanged(); void credentialStatusChanged();
void oldStatusChanged(); void oldStatusChanged();
void showPinChanged(); void showPinChanged();
void themeChanged();
}; };
#endif #endif