Kaydet (Commit) 151c1f3d authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Turn sd::BluetoothServer::Impl into scoped enum

...to avoid -Werror,-Wshadow from Clang trunk with
<https://reviews.llvm.org/D52400> "Improve -Wshadow warnings with enumerators",
warning about shadowing of UNKNOWN in anonymous enum in
sd/source/ui/remotecontrol/BluetoothServer.hxx

Change-Id: Ie0e6794da82c79ae2f8fd848c3c015c873fd60aa
Reviewed-on: https://gerrit.libreoffice.org/61878
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 99fa8d59
......@@ -90,14 +90,14 @@ struct sd::BluetoothServer::Impl {
GMainContext *mpContext;
DBusConnection *mpConnection;
DBusObject *mpService;
enum BluezVersion { BLUEZ4, BLUEZ5, UNKNOWN };
enum class BluezVersion { BLUEZ4, BLUEZ5, UNKNOWN };
BluezVersion maBluezVersion;
Impl()
: mpContext( g_main_context_new() )
, mpConnection( nullptr )
, mpService( nullptr )
, maBluezVersion( UNKNOWN )
, maBluezVersion( BluezVersion::UNKNOWN )
{ }
std::unique_ptr<DBusObject> getAdapter()
......@@ -106,7 +106,7 @@ struct sd::BluetoothServer::Impl {
{
return mpService->cloneForInterface( "org.bluez.Adapter" );
}
else if (spServer->mpImpl->maBluezVersion == BLUEZ5)
else if (spServer->mpImpl->maBluezVersion == BluezVersion::BLUEZ5)
{
return getBluez5Adapter(mpConnection);
}
......@@ -1181,7 +1181,7 @@ void SAL_CALL BluetoothServer::run()
SAL_INFO("sdremote.bluetooth", "Using Bluez 5");
registerBluez5Profile(pConnection, mpCommunicators);
mpImpl->mpConnection = pConnection;
mpImpl->maBluezVersion = Impl::BLUEZ5;
mpImpl->maBluezVersion = Impl::BluezVersion::BLUEZ5;
// We don't need to listen to adapter changes anymore -- profile
// registration is done globally for the entirety of bluez, so we only
......@@ -1212,7 +1212,7 @@ void SAL_CALL BluetoothServer::run()
}
// Otherwise we could be on Bluez 4 and continue as usual.
mpImpl->maBluezVersion = Impl::BLUEZ4;
mpImpl->maBluezVersion = Impl::BluezVersion::BLUEZ4;
// Try to setup the default adapter, otherwise wait for add/remove signal
mpImpl->mpService = registerWithDefaultAdapter( pConnection );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment