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:
Klaus Basan
2018-08-20 18:15:31 +02:00
parent f1312bbb50
commit b610ff1087
5 changed files with 107 additions and 4 deletions

View File

@@ -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);