mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Activity: Some documentation and better varialbe names
This commit is contained in:
parent
45c32ec0b1
commit
f7f412007e
@ -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);
|
||||
}
|
||||
|
||||
@ -90,7 +90,10 @@ private:
|
||||
QMap<int, NotificationWidget*> _widgetForNotifId;
|
||||
QElapsedTimer _guiLogTimer;
|
||||
QSet<int> _guiLoggedNotifications;
|
||||
int _notificationRequests;
|
||||
|
||||
// number of currently running notification requests. If non zero,
|
||||
// no query for notifications is started.
|
||||
int _notificationRequestsRunning;
|
||||
|
||||
ActivityListModel *_model;
|
||||
QVBoxLayout *_notificationsLayout;
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user