void DiscoverabilityManager::setDiscoverabilityMode(Discoverability::Mode discoverabilityMode) { if (static_cast<Discoverability::Mode>(_mode.get()) != discoverabilityMode) { // update the setting to the new value _mode.set(static_cast<int>(discoverabilityMode)); updateLocation(); // update right away emit discoverabilityModeChanged(discoverabilityMode); } }
void DiscoverabilityManager::setDiscoverabilityMode(Discoverability::Mode discoverabilityMode) { if (static_cast<Discoverability::Mode>(_mode.get()) != discoverabilityMode) { // update the setting to the new value _mode.set(static_cast<int>(discoverabilityMode)); if (static_cast<int>(_mode.get()) == Discoverability::None) { // if we just got set to no discoverability, make sure that we delete our location in DB removeLocation(); } else { // we have a discoverability mode that says we should send a location, do that right away updateLocation(); } emit discoverabilityModeChanged(discoverabilityMode); } }