@@ -357,6 +357,7 @@ void StateManager::DoStateReset(Side side)
357357 adv.reset ();
358358 }
359359}
360+ } // namespace Details
360361
361362//
362363// Manager
@@ -395,12 +396,6 @@ void Manager::StopScanner()
395396 }
396397}
397398
398- QString Manager::GetDisplayName ()
399- {
400- std::lock_guard<std::mutex> lock{_mutex};
401- return _displayName;
402- }
403-
404399void Manager::OnRssiMinChanged (int16_t rssiMin)
405400{
406401 std::lock_guard<std::mutex> lock{_mutex};
@@ -451,11 +446,6 @@ void Manager::OnBoundDeviceAddressChanged(uint64_t address)
451446 OnBoundDeviceConnectionStateChanged (currentState);
452447}
453448
454- void Manager::OnQuit ()
455- {
456- StopScanner ();
457- }
458-
459449void Manager::OnBoundDeviceConnectionStateChanged (Bluetooth::DeviceState state)
460450{
461451 bool newDeviceConnected = state == Bluetooth::DeviceState::Connected;
@@ -472,10 +462,12 @@ void Manager::OnBoundDeviceConnectionStateChanged(Bluetooth::DeviceState state)
472462 GlobalMedia::OnLimitedDeviceStateChanged ((_displayName + " Stereo" ).toStdString ());
473463}
474464
475- void Manager::OnStateChanged (StateManager::UpdateEvent updateEvent)
465+ void Manager::OnStateChanged (Details:: StateManager::UpdateEvent updateEvent)
476466{
477467 const auto &oldState = updateEvent.oldState ;
478- const auto &newState = updateEvent.newState ;
468+ auto &newState = updateEvent.newState ;
469+
470+ newState.displayName = _displayName;
479471
480472 ApdApp->GetMainWindow ()->UpdateStateSafety (newState);
481473
@@ -533,7 +525,7 @@ void Manager::OnBothInEar(bool isBothInEar)
533525
534526bool Manager::OnAdvertisementReceived (const Bluetooth::AdvertisementWatcher::ReceivedData &data)
535527{
536- if (!Advertisement::IsDesiredAdv (data)) {
528+ if (!Details:: Advertisement::IsDesiredAdv (data)) {
537529 return false ;
538530 }
539531
@@ -542,12 +534,12 @@ bool Manager::OnAdvertisementReceived(const Bluetooth::AdvertisementWatcher::Rec
542534 return false ;
543535 }
544536
545- Advertisement adv{data};
537+ Details:: Advertisement adv{data};
546538
547539 LOG (Trace, " AirPods advertisement received. Data: {}, Address Hash: {}, RSSI: {}" ,
548540 Helper::ToString (adv.GetDesensitizedData ()), Helper::Hash (data.address ), data.rssi );
549541
550- auto optUpdateEvent = _stateMgr.OnAdvReceived (Advertisement{data});
542+ auto optUpdateEvent = _stateMgr.OnAdvReceived (Details:: Advertisement{data});
551543 if (optUpdateEvent.has_value ()) {
552544 OnStateChanged (std::move (optUpdateEvent.value ()));
553545 }
@@ -573,8 +565,6 @@ void Manager::OnAdvWatcherStateChanged(
573565 }
574566}
575567
576- } // namespace Details
577-
578568std::vector<Bluetooth::Device> GetDevices ()
579569{
580570 std::vector<Bluetooth::Device> devices =
0 commit comments