From f2d8143511a4a86bf7bc6f1e5f7159128ef6a5b1 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 18 Nov 2015 15:25:29 +0100 Subject: [PATCH] Activity View: Update only if visible and when becoming visible #4083 --- src/gui/activitywidget.cpp | 13 ++++++++++++- src/gui/activitywidget.h | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/gui/activitywidget.cpp b/src/gui/activitywidget.cpp index 34a7b79a0fe..91af0aa957c 100644 --- a/src/gui/activitywidget.cpp +++ b/src/gui/activitywidget.cpp @@ -418,12 +418,23 @@ void ActivitySettings::slotRemoveAccount( AccountState *ptr ) void ActivitySettings::slotRefresh( AccountState* ptr ) { - if( ptr && ptr->isConnected() ) { + if( ptr && ptr->isConnected() && isVisible()) { _progressIndicator->startAnimation(); _activityWidget->slotRefresh(ptr); } } +bool ActivitySettings::event(QEvent* e) +{ + if (e->type() == QEvent::Show) { + AccountManager *am = AccountManager::instance(); + foreach (AccountStatePtr a, am->accounts()) { + slotRefresh(a.data()); + } + } + return QWidget::event(e); +} + ActivitySettings::~ActivitySettings() { diff --git a/src/gui/activitywidget.h b/src/gui/activitywidget.h index 8fcae675769..6b51f09f37a 100644 --- a/src/gui/activitywidget.h +++ b/src/gui/activitywidget.h @@ -182,6 +182,8 @@ public slots: void guiLog(const QString&, const QString&); private: + bool event(QEvent* e) Q_DECL_OVERRIDE; + QTabWidget *_tab; ActivityWidget *_activityWidget; ProtocolWidget *_protocolWidget;