Commit fc81acff authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

Load source model only on source page but immediately there when needed

Also some cleanup
parent 1d1ff85e
......@@ -193,7 +193,6 @@ void KCMNotifications::configureEvents(const QString &notifyRcName, const QStrin
void KCMNotifications::load()
{
m_settings->load();
m_sourcesModel->load();
}
void KCMNotifications::save()
......
......@@ -98,12 +98,10 @@ ColumnLayout {
onClicked: configColumn.setBehavior(NotificationManager.Settings.ShowPopups, checked)
}
RowLayout {
Item {
width: Kirigami.Units.gridUnit
}
RowLayout { // just for indentation
QtControls.CheckBox {
Layout.leftMargin: mirrored ? 0 : indicator.width
Layout.rightMargin: mirrored ? indicator.width : 0
text: i18n("Show in do not disturb mode")
enabled: showPopupsCheck.checked
checked: configColumn.behavior & NotificationManager.Settings.ShowPopupsInDoNotDisturbMode
......
......@@ -32,21 +32,21 @@ Kirigami.Page {
title: i18n("Application Settings")
Component.onCompleted: {
// TODO the page is push'd in Qt.callLater, why is the model still not loaded when we get here?
Qt.callLater(function() {
if (kcm.initialDesktopEntry) {
appConfiguration.rootIndex = kcm.sourcesModel.persistentIndexForDesktopEntry(kcm.initialDesktopEntry);
} else if (kcm.initialNotifyRcName) {
appConfiguration.rootIndex = kcm.sourcesModel.persistentIndexForNotifyRcName(kcm.initialNotifyRcName);
if (kcm.initialEventId) {
appConfiguration.configureEvents(kcm.initialEventId);
}
}
kcm.sourcesModel.load();
if (kcm.initialDesktopEntry) {
appConfiguration.rootIndex = kcm.sourcesModel.persistentIndexForDesktopEntry(kcm.initialDesktopEntry);
} else if (kcm.initialNotifyRcName) {
appConfiguration.rootIndex = kcm.sourcesModel.persistentIndexForNotifyRcName(kcm.initialNotifyRcName);
}
if (kcm.initialEventId && kcm.initialNotifyRcName) {
appConfiguration.configureEvents(kcm.initialEventId);
}
kcm.initialDesktopEntry = "";
kcm.initialNotifyRcName = "";
kcm.initialEventId = "";
});
kcm.initialDesktopEntry = "";
kcm.initialNotifyRcName = "";
kcm.initialEventId = "";
}
Binding {
......
......@@ -147,7 +147,8 @@ KCM.SimpleKCM {
RowLayout { // just for indentation
QtControls.CheckBox {
Layout.leftMargin: indicator.width
Layout.leftMargin: mirrored ? 0 : indicator.width
Layout.rightMargin: mirrored ? indicator.width : 0
text: i18nc("Keep application job popup open for entire duration of job", "Keep popup open during progress")
enabled: applicationJobsEnabledCheck.checked
checked: kcm.settings.permanentJobPopups
......
......@@ -92,7 +92,7 @@ public:
QHash<int, QByteArray> roleNames() const override;
void load();
Q_INVOKABLE void load();
private:
QVector<SourceData> m_data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment