fixed update interactivity in own identities and circles

This commit is contained in:
csoler 2021-03-03 22:38:05 +01:00
parent 15dd72ec7a
commit 66941ecb21
2 changed files with 5 additions and 7 deletions

View File

@ -408,9 +408,7 @@ IdDialog::IdDialog(QWidget *parent)
connect(ui->autoBanIdentities_CB, SIGNAL(toggled(bool)), this, SLOT(toggleAutoBanIdentities(bool))); connect(ui->autoBanIdentities_CB, SIGNAL(toggled(bool)), this, SLOT(toggleAutoBanIdentities(bool)));
updateIdTimer.setSingleShot(true); updateIdTimer.setSingleShot(true);
updateCircleTimer.setSingleShot(true);
connect(&updateIdTimer, SIGNAL(timeout()), this, SLOT(updateIdList())); connect(&updateIdTimer, SIGNAL(timeout()), this, SLOT(updateIdList()));
connect(&updateCircleTimer, SIGNAL(timeout()), this, SLOT(updateCircles()));
} }
void IdDialog::handleEvent_main_thread(std::shared_ptr<const RsEvent> event) void IdDialog::handleEvent_main_thread(std::shared_ptr<const RsEvent> event)
@ -429,7 +427,10 @@ void IdDialog::handleEvent_main_thread(std::shared_ptr<const RsEvent> event)
case RsGxsIdentityEventCode::UPDATED_IDENTITY: case RsGxsIdentityEventCode::UPDATED_IDENTITY:
if (isVisible()) if (isVisible())
{ {
updateIdTimer.start(5000); if(rsIdentity->isOwnId(RsGxsId(e->mIdentityId)))
updateIdList();
else
updateIdTimer.start(3000); // use a timer for events not generated by local changes
} }
else else
needUpdateIdsOnNextShow = true; needUpdateIdsOnNextShow = true;
@ -460,9 +461,7 @@ void IdDialog::handleEvent_main_thread(std::shared_ptr<const RsEvent> event)
case RsGxsCircleEventCode::CACHE_DATA_UPDATED: case RsGxsCircleEventCode::CACHE_DATA_UPDATED:
if (isVisible()) if (isVisible())
{ updateCircles();
updateCircleTimer.start(5000);
}
else else
needUpdateCirclesOnNextShow = true; needUpdateCirclesOnNextShow = true;
default: default:

View File

@ -154,7 +154,6 @@ private:
RsEventsHandlerId_t mEventHandlerId_circles; RsEventsHandlerId_t mEventHandlerId_circles;
QTimer updateIdTimer; QTimer updateIdTimer;
QTimer updateCircleTimer;
bool needUpdateIdsOnNextShow; bool needUpdateIdsOnNextShow;
bool needUpdateCirclesOnNextShow; bool needUpdateCirclesOnNextShow;