mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
Ref T301, core ping fix https://swift-project.slack.com/archives/G7GD2UP9C/p1534677752000100
Identifier list was filled and more and more identifiers got checked via DBus - identifier set if only one unique identifer is needed - using set avoids duplicates and fixes the bug - restart time if registered, no need to check again
This commit is contained in:
@@ -163,6 +163,7 @@ namespace BlackCore
|
||||
CIdentifier CContextApplicationProxy::registerApplication(const CIdentifier &application)
|
||||
{
|
||||
m_proxyPingIdentifiers.insert(application);
|
||||
if (m_pingTimer.isActive()) { m_pingTimer.start(); } // restart, no need to ping again
|
||||
return m_dBusInterface->callDBusRet<BlackMisc::CIdentifier>(QLatin1String("registerApplication"), application);
|
||||
}
|
||||
|
||||
@@ -210,7 +211,7 @@ namespace BlackCore
|
||||
{
|
||||
if (!m_dBusInterface) { return; }
|
||||
if (m_proxyPingIdentifiers.isEmpty()) { return; }
|
||||
const CIdentifierList identifiers = m_proxyPingIdentifiers; // copy so member can be modified
|
||||
const CIdentifierSet identifiers = m_proxyPingIdentifiers; // copy so member can be modified
|
||||
for (const CIdentifier &identifier : identifiers)
|
||||
{
|
||||
this->registerApplication(identifier);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include "blackcore/context/contextapplication.h"
|
||||
#include "blackcore/corefacadeconfig.h"
|
||||
#include "blackmisc/identifierlist.h"
|
||||
#include "blackmisc/identifierset.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackmisc/valuecache.h"
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace BlackCore
|
||||
|
||||
private:
|
||||
BlackMisc::CGenericDBusInterface *m_dBusInterface = nullptr; //!< interface
|
||||
BlackMisc::CIdentifierList m_proxyPingIdentifiers; //!< automatically ping the implementing side
|
||||
BlackMisc::CIdentifierSet m_proxyPingIdentifiers; //!< automatically ping the implementing side
|
||||
QTimer m_pingTimer;
|
||||
|
||||
//! Relay connection signals to local signals
|
||||
|
||||
Reference in New Issue
Block a user