From kde-commits Sun May 31 22:28:25 2015 From: =?utf-8?b?SXZhbiDEjHVracSH?= Date: Sun, 31 May 2015 22:28:25 +0000 To: kde-commits Subject: [kactivities] src/lib/stats: When the current activity is changed, resetting the model is more optim Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=143311131602195 Git commit 7b383a09841cc38495818442aee7e20fe3a07b1c by Ivan =C4=8Cuki=C4=87. Committed on 30/05/2015 at 11:36. Pushed by ivan into branch 'master'. When the current activity is changed, resetting the model is more optimal M +6 -1 src/lib/stats/resultmodel.cpp http://commits.kde.org/kactivities/7b383a09841cc38495818442aee7e20fe3a07b1c diff --git a/src/lib/stats/resultmodel.cpp b/src/lib/stats/resultmodel.cpp index d8bc6f8..66b5e9e 100644 --- a/src/lib/stats/resultmodel.cpp +++ b/src/lib/stats/resultmodel.cpp @@ -529,7 +529,12 @@ public: void onCurrentActivityChanged(const QString &activity) { Q_UNUSED(activity); - reload(); + // If the current activity has changed, and + // the query lists items for the ':current' one, + // reset the model (not a simple refresh this time) + if (query.activities().contains(CURRENT_ACTIVITY_TAG)) { + fetch(FetchReset); + } } = private: