[Pkg-owncloud-commits] [owncloud-client] 234/484: ActivityListModel: Add method to refresh one Account (WIP)

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:46 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit b600ac882a7dad0ce7631c46bf292a67ecfdbb2c
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Mon Nov 2 17:52:04 2015 +0100

    ActivityListModel: Add method to refresh one Account (WIP)
---
 src/gui/activitywidget.cpp | 11 +++++++++++
 src/gui/activitywidget.h   |  3 +++
 2 files changed, 14 insertions(+)

diff --git a/src/gui/activitywidget.cpp b/src/gui/activitywidget.cpp
index 3c20a95..ada65d0 100644
--- a/src/gui/activitywidget.cpp
+++ b/src/gui/activitywidget.cpp
@@ -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) :
diff --git a/src/gui/activitywidget.h b/src/gui/activitywidget.h
index 034dc33..266b137 100644
--- a/src/gui/activitywidget.h
+++ b/src/gui/activitywidget.h
@@ -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);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list