diff options
author | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-06-28 14:45:09 +0200 |
---|---|---|
committer | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-06-30 07:45:23 +0200 |
commit | 580b1890d8985d4248b1d5d783ad379d64e82259 (patch) | |
tree | 1f816a0c9b11b70159508942a76d2e9825cf1648 /sd/source | |
parent | d61468314bbfd2a79929b48e62d7e5ed354ab79b (diff) |
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
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/remotecontrol/Server.cxx | 18 |
1 files changed, 8 insertions, 10 deletions
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... |