# HG changeset patch # User dadubrow # Date 1266874318 21600 # Node ID 6a876b480ec4279bc05e16a87c5e5fb76911fb90 # Parent 6d1ed1e4a715d75fcd9c3f7439e4c5714cf5e8d9 make multiple reconnect a noop diff -r 6d1ed1e4a715 -r 6a876b480ec4 connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/registry/Registry.java --- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/registry/Registry.java Fri Feb 19 17:02:11 2010 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/registry/Registry.java Mon Feb 22 15:31:58 2010 -0600 @@ -673,24 +673,31 @@ if (!connection.isDynamic()) return false; + if (!connectionToConnectedServices.containsKey(connection)) // connection does not exist + return false; + // if not removed, transition out of disconnected state // return not removed IConnectionStatusChangedListener listener = connectionListenerMap.remove(connection); - if (listener != null) + if (listener != null) { // is disconnected connection.removeStatusChangedListener(listener); - if (connectionToConnectedServices.containsKey(connection)) { - IConnectionStatus status; - if (ConnectionUIUtils.isSomeServiceInUse(connection)) { - status = new ConnectionStatus(EConnectionStatus.IN_USE, - Messages.getString("ConnectionsView.InUseLabel"), //$NON-NLS-1$ - Messages.getString("ConnectionsView.InUseDesc")); //$NON-NLS-1$ + if (connectionToConnectedServices.containsKey(connection)) { + IConnectionStatus status; + if (ConnectionUIUtils.isSomeServiceInUse(connection)) { + status = new ConnectionStatus(EConnectionStatus.IN_USE, + Messages.getString("ConnectionsView.InUseLabel"), //$NON-NLS-1$ + Messages.getString("ConnectionsView.InUseDesc")); //$NON-NLS-1$ + } + else { + status = new ConnectionStatus(EConnectionStatus.NOT_READY, "", ""); //$NON-NLS-1$ //$NON-NLS-2$ + } + connection.setStatus(status); + return true; } - else { - status = new ConnectionStatus(EConnectionStatus.NOT_READY, "", ""); //$NON-NLS-1$ //$NON-NLS-2$ - } - connection.setStatus(status); + } + else // connection is not disconnected return true; - } + return false; } } \ No newline at end of file