From 943fd58a4fce2a1009060f2f8907e806983721e7 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Mon, 18 Feb 2013 09:24:23 +0000 Subject: improve bluetooth discoverability toggling API. Change-Id: I289d43fcb173b64b01183a41f780bc74d2ba0abe (cherry picked from commit 21979643e47e503a20113b1e8e98814717c71ac5) Signed-off-by: Thorsten Behrens --- sd/source/ui/dlg/RemoteDialog.cxx | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'sd/source/ui/dlg/RemoteDialog.cxx') diff --git a/sd/source/ui/dlg/RemoteDialog.cxx b/sd/source/ui/dlg/RemoteDialog.cxx index fd6089570a98..f9cff1bc9385 100644 --- a/sd/source/ui/dlg/RemoteDialog.cxx +++ b/sd/source/ui/dlg/RemoteDialog.cxx @@ -22,22 +22,12 @@ RemoteDialog::RemoteDialog( Window *pWindow ) : ModalDialog( pWindow, SdResId( DLG_PAIR_REMOTE ) ), mButtonConnect( this, SdResId( BTN_CONNECT ) ), mButtonCancel( this, SdResId( BTN_CANCEL ) ), - mClientBox( this, NULL, SdResId( LB_SERVERS ) ), - mPreviouslyDiscoverable() + mClientBox( this, NULL, SdResId( LB_SERVERS ) ) { - (void) mPreviouslyDiscoverable; // avoid warnings about unused member - FreeResource(); #ifdef ENABLE_SDREMOTE - -#ifdef ENABLE_SDREMOTE_BLUETOOTH - mPreviouslyDiscoverable = RemoteServer::isBluetoothDiscoverable(); - if ( !mPreviouslyDiscoverable ) - RemoteServer::setBluetoothDiscoverable( true ); -#else - RemoteServer::setBluetoothDiscoverable( false ); -#endif + RemoteServer::ensureDiscoverable(); vector aClients( RemoteServer::getClients() ); @@ -80,12 +70,7 @@ IMPL_LINK_NOARG(RemoteDialog, HandleConnectButton) IMPL_LINK_NOARG( RemoteDialog, CloseHdl ) { -#if defined(ENABLE_SDREMOTE) && defined(ENABLE_SDREMOTE_BLUETOOTH) - if ( !mPreviouslyDiscoverable ) - { - RemoteServer::setBluetoothDiscoverable( false ); - } -#endif + RemoteServer::restoreDiscoverable(); Close(); return 0; } -- cgit v1.2.3