diff --git a/src/gui/activitywidget.cpp b/src/gui/activitywidget.cpp index 86f259ff71..a8be2449ae 100644 --- a/src/gui/activitywidget.cpp +++ b/src/gui/activitywidget.cpp @@ -51,7 +51,7 @@ namespace OCC { ActivityWidget::ActivityWidget(QWidget *parent) : QWidget(parent), _ui(new Ui::ActivityWidget), - _notificationRequests(0) + _notificationRequestsRunning(0) { _ui->setupUi(this); @@ -103,7 +103,7 @@ void ActivityWidget::slotRefresh(AccountState *ptr) // start a server notification handler if no notification requests // are running - if( _notificationRequests == 0 ) { + if( _notificationRequestsRunning == 0 ) { ServerNotificationHandler *snh = new ServerNotificationHandler; connect(snh, SIGNAL(newNotificationList(ActivityList)), this, SLOT(slotBuildNotificationDisplay(ActivityList))); @@ -317,7 +317,7 @@ void ActivityWidget::slotSendNotificationRequest(const QString& accountName, con // count the number of running notification requests. If this member var // is larger than zero, no new fetching of notifications is started - _notificationRequests++; + _notificationRequestsRunning++; } } else { qDebug() << Q_FUNC_INFO << "Notification Links: Invalid verb:" << verb; @@ -326,7 +326,7 @@ void ActivityWidget::slotSendNotificationRequest(const QString& accountName, con void ActivityWidget::endNotificationRequest( NotificationWidget *widget, int replyCode ) { - _notificationRequests--; + _notificationRequestsRunning--; if( widget ) { widget->slotNotificationRequestFinished(replyCode); } diff --git a/src/gui/activitywidget.h b/src/gui/activitywidget.h index a2d5c81168..01c591433d 100644 --- a/src/gui/activitywidget.h +++ b/src/gui/activitywidget.h @@ -90,7 +90,10 @@ private: QMap _widgetForNotifId; QElapsedTimer _guiLogTimer; QSet _guiLoggedNotifications; - int _notificationRequests; + + // number of currently running notification requests. If non zero, + // no query for notifications is started. + int _notificationRequestsRunning; ActivityListModel *_model; QVBoxLayout *_notificationsLayout; diff --git a/src/gui/notificationconfirmjob.h b/src/gui/notificationconfirmjob.h index 3f0e8bb6ba..7ae57bb417 100644 --- a/src/gui/notificationconfirmjob.h +++ b/src/gui/notificationconfirmjob.h @@ -42,19 +42,29 @@ public: explicit NotificationConfirmJob(AccountPtr account); /** - * Set the verb and link for the job + * @brief Set the verb and link for the job * * @param verb currently supported GET PUT POST DELETE */ void setLinkAndVerb(const QUrl& link, const QString &verb); /** - * Start the OCS request + * @brief Start the OCS request */ void start() Q_DECL_OVERRIDE; + /** + * @brief setWidget stores the associated widget to be able to use + * it when the job has finished + * @param widget pointer to the notification widget to store + */ void setWidget( NotificationWidget *widget ); + /** + * @brief widget - get the associated notification widget as stored + * with setWidget method. + * @return widget pointer to the notification widget + */ NotificationWidget *widget(); signals: