Move the Volume quick setting with its provider

So not to rely on global identifiers
This commit is contained in:
Aleix Pol 2021-07-14 02:47:59 +02:00 committed by Aleix Pol Gonzalez
parent 3b212d7a55
commit 0d7f10abbc
2 changed files with 11 additions and 9 deletions

View file

@ -147,6 +147,17 @@ Item {
}
IndicatorProviders.VolumeProvider {
id: volumeProvider
readonly property var soundQuickSetting: QuickSetting {
text: i18n("Sound")
icon: "audio-speakers-symbolic"
enabled: false
settingsCommand: "plasma-settings -m kcm_pulseaudio"
function toggle() {
volumeProvider.showVolumeOverlay()
}
Component.onCompleted: quickSettings.quickSettingsModel.model.push(volumeProvider.soundQuickSetting)
}
}
IndicatorProviders.WifiProvider {
id: wifiProvider

View file

@ -76,15 +76,6 @@ Item {
enabled: false
settingsCommand: "plasma-settings -m kcm_mobile_power"
},
QuickSetting {
text: i18n("Sound")
icon: "audio-speakers-symbolic"
enabled: false
settingsCommand: "plasma-settings -m kcm_pulseaudio"
function toggle() {
volumeProvider.showVolumeOverlay()
}
},
QuickSetting {
text: i18n("Flashlight")
icon: "flashlight-on"