mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
ActivityListModel: Add method to refresh one Account (WIP)
This commit is contained in:
parent
71849c4372
commit
b600ac882a
@ -145,6 +145,7 @@ void ActivityListModel::slotActivitiesReceived(const QVariantMap& json)
|
||||
_activityLists[ai] = list;
|
||||
|
||||
// if all activity lists were received, assemble the whole list
|
||||
// otherwise wait until the others are finished
|
||||
bool allAreHere = true;
|
||||
foreach( ActivityList list, _activityLists.values() ) {
|
||||
if( list.count() == 0 ) {
|
||||
@ -152,6 +153,8 @@ void ActivityListModel::slotActivitiesReceived(const QVariantMap& json)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: Be more efficient,
|
||||
if( allAreHere ) {
|
||||
combineActivityLists();
|
||||
}
|
||||
@ -190,6 +193,14 @@ void ActivityListModel::fetchMore(const QModelIndex &)
|
||||
}
|
||||
}
|
||||
|
||||
void ActivityListModel::slotRefreshActivity(AccountStatePtr ast)
|
||||
{
|
||||
if(ast && _activityLists.contains(ast)) {
|
||||
_activityLists[ast].clear();
|
||||
}
|
||||
startFetchJob(ast);
|
||||
}
|
||||
|
||||
/* ==================================================================== */
|
||||
|
||||
ActivityWidget::ActivityWidget(QWidget *parent) :
|
||||
|
||||
@ -88,6 +88,9 @@ public:
|
||||
bool canFetchMore(const QModelIndex& ) const;
|
||||
void fetchMore(const QModelIndex&);
|
||||
|
||||
public slots:
|
||||
void slotRefreshActivity(AccountStatePtr ast);
|
||||
|
||||
private slots:
|
||||
void slotActivitiesReceived(const QVariantMap& json);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user