From ae98b5c71f4d79c7a8009849dded8bee00d3e82f Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Fri, 1 Sep 2023 05:47:18 +0200 Subject: [PATCH] When permissions are granted, reload plugins for all devices --- src/org/kde/kdeconnect/UserInterface/MainActivity.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/kde/kdeconnect/UserInterface/MainActivity.kt b/src/org/kde/kdeconnect/UserInterface/MainActivity.kt index 16b73931..51516dab 100644 --- a/src/org/kde/kdeconnect/UserInterface/MainActivity.kt +++ b/src/org/kde/kdeconnect/UserInterface/MainActivity.kt @@ -329,7 +329,7 @@ class MainActivity : AppCompatActivity(), OnSharedPreferenceChangeListener { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { when { requestCode == RESULT_NEEDS_RELOAD -> { - KdeConnect.getInstance().getDevice(mCurrentDevice)?.reloadPluginsFromSettings() + KdeConnect.getInstance().devices.values.forEach(Device::reloadPluginsFromSettings) } requestCode == STORAGE_LOCATION_CONFIGURED && resultCode == RESULT_OK && data != null -> { val uri = data.data @@ -363,7 +363,7 @@ class MainActivity : AppCompatActivity(), OnSharedPreferenceChangeListener { } //New permission granted, reload plugins - KdeConnect.getInstance().getDevice(mCurrentDevice)?.reloadPluginsFromSettings() + KdeConnect.getInstance().devices.values.forEach(Device::reloadPluginsFromSettings) } }