From bd0b03eafba274f33ba6a06350d62637ab32a820 Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Fri, 16 Jun 2023 20:05:44 +0200 Subject: [PATCH] Make this more readable --- src/org/kde/kdeconnect/KdeConnect.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/org/kde/kdeconnect/KdeConnect.java b/src/org/kde/kdeconnect/KdeConnect.java index 6a8de5e2..c6dee61f 100644 --- a/src/org/kde/kdeconnect/KdeConnect.java +++ b/src/org/kde/kdeconnect/KdeConnect.java @@ -169,21 +169,22 @@ public class KdeConnect extends Application { @Override public void onConnectionLost(BaseLink link) { - Device d = devices.get(link.getDeviceId()); + Device device = devices.get(link.getDeviceId()); Log.i("KDE/onConnectionLost", "removeLink, deviceId: " + link.getDeviceId()); - if (d != null) { - d.removeLink(link); - if (!d.isReachable() && !d.isPaired()) { + if (device != null) { + device.removeLink(link); + if (!device.isReachable() && !device.isPaired()) { //Log.e("onConnectionLost","Removing connection device because it was not paired"); devices.remove(link.getDeviceId()); - d.removePairingCallback(devicePairingCallback); + device.removePairingCallback(devicePairingCallback); } } else { - //Log.d("KDE/onConnectionLost","Removing connection to unknown device"); + Log.d("KDE/onConnectionLost","Removing connection to unknown device"); } onDeviceListChanged(); } }; + public BaseLinkProvider.ConnectionReceiver getConnectionListener() { return connectionListener; }