[Pkg-owncloud-commits] [owncloud-client] 349/484: ActivityWidget: Detect new items in the list to refetch the activities.
Sandro Knauß
hefee-guest at moszumanska.debian.org
Wed Dec 16 00:38:03 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 c9ef4d5fa06ecd27e00ffdd66d030b9e622d32d4
Author: Klaas Freitag <freitag at owncloud.com>
Date: Tue Nov 17 14:46:13 2015 +0100
ActivityWidget: Detect new items in the list to refetch the activities.
On refresh, remove the activity list object from the models list.
---
src/gui/activitywidget.cpp | 7 ++++---
src/gui/activitywidget.h | 1 -
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/gui/activitywidget.cpp b/src/gui/activitywidget.cpp
index 03ab131..847e95a 100644
--- a/src/gui/activitywidget.cpp
+++ b/src/gui/activitywidget.cpp
@@ -204,13 +204,14 @@ void ActivityListModel::fetchMore(const QModelIndex &)
QList<AccountStatePtr> accounts = AccountManager::instance()->accounts();
foreach (AccountStatePtr asp, accounts) {
-
+ bool newItem = false;
// if the account is not yet managed, add an empty list.
if( !_activityLists.contains(asp.data()) ) {
_activityLists[asp.data()] = ActivityList();
+ newItem = true;
}
ActivityList activities = _activityLists[asp.data()];
- if( activities.count() == 0 ) {
+ if( newItem ) {
startFetchJob(asp.data());
}
}
@@ -220,7 +221,7 @@ void ActivityListModel::slotRefreshActivity(AccountState *ast)
{
if(ast && _activityLists.contains(ast)) {
qDebug() << "**** Refreshing Activity list for" << ast->account()->displayName();
- _activityLists[ast].clear();
+ _activityLists.remove(ast);
}
startFetchJob(ast);
}
diff --git a/src/gui/activitywidget.h b/src/gui/activitywidget.h
index 441ae31..8fcae67 100644
--- a/src/gui/activitywidget.h
+++ b/src/gui/activitywidget.h
@@ -76,7 +76,6 @@ public:
*/
class ActivityList:public QList<Activity>
{
- // explicit ActivityList();
public:
void setAccountName( const QString& name );
QString accountName() const;
--
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