From 580b1890d8985d4248b1d5d783ad379d64e82259 Mon Sep 17 00:00:00 2001 From: Andrzej Hunt Date: Sat, 28 Jun 2014 14:45:09 +0200 Subject: Allow removal of remotes even if Server not running. This is purely config manipulation so shouldn't rely on having the Server actually running (e.g. if disabled, and/or if network setup failed). Change-Id: Ifc6e5639ba6842a18eb0be99387a5f8dd871da06 --- sd/source/ui/remotecontrol/Server.cxx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/remotecontrol/Server.cxx b/sd/source/ui/remotecontrol/Server.cxx index 81335374967a..d80b8463abdc 100644 --- a/sd/source/ui/remotecontrol/Server.cxx +++ b/sd/source/ui/remotecontrol/Server.cxx @@ -239,16 +239,16 @@ std::vector< ::boost::shared_ptr< ClientInfo > > RemoteServer::getClients() { SAL_INFO( "sdremote", "RemoteServer::getClients() called" ); std::vector< ::boost::shared_ptr< ClientInfo > > aClients; - if ( !spServer ) + if ( spServer ) { - SAL_INFO( "sdremote", "No remote server instance => no clients" ); - return aClients; + MutexGuard aGuard( sDataMutex ); + aClients.assign( spServer->mAvailableClients.begin(), + spServer->mAvailableClients.end() ); + } + else + { + SAL_INFO( "sdremote", "No remote server instance => no remote clients" ); } - - MutexGuard aGuard( sDataMutex ); - aClients.assign( spServer->mAvailableClients.begin(), - spServer->mAvailableClients.end() ); - // We also need to provide authorised clients (no matter whether or not // they are actually available), so that they can be de-authorised if // necessary. We specifically want these to be at the end of the list @@ -342,8 +342,6 @@ void RemoteServer::deauthoriseClient( ::boost::shared_ptr< ClientInfo > pClient // the UI. SAL_INFO( "sdremote", "RemoteServer::deauthoriseClient called" ); - if ( !spServer ) - return; if ( !pClient->mbIsAlreadyAuthorised ) // We can't remove unauthorised clients from the authorised list... -- cgit