diff options
author | Michael Schuster <michael@schuster.ms> | 2019-12-18 05:01:27 +0300 |
---|---|---|
committer | Michael Schuster <michael@schuster.ms> | 2019-12-18 05:31:32 +0300 |
commit | de8a7aa6809c83966a4eb2b64bfe9053eb55d3b8 (patch) | |
tree | c7d1a281c40fec71afcf5c2069bcfc9b55399091 | |
parent | 03b11693a39c519d93febbd2dc3db204b5344cf0 (diff) |
Fix Activity List: Add check to avoid first empty entry2.6.2-buildtest1
Add checks to ActivityListModel::combineActivityLists in order to avoid adding
empty Activity entries to the _finalList.
The previous implementation always added an empty entry to the top of the list because
_notificationIgnoredFiles was appended without checking (_listOfIgnoredFiles.size() > 0).
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit cc21d175f17ed158cbc5a667f03da9ff27015f24)
Signed-off-by: Michael Schuster <michael@schuster.ms>
-rw-r--r-- | src/gui/activitylistmodel.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/gui/activitylistmodel.cpp b/src/gui/activitylistmodel.cpp index eab049af7..f64290abc 100644 --- a/src/gui/activitylistmodel.cpp +++ b/src/gui/activitylistmodel.cpp @@ -294,18 +294,27 @@ void ActivityListModel::combineActivityLists() { ActivityList resultList; - std::sort(_notificationErrorsLists.begin(), _notificationErrorsLists.end()); - resultList.append(_notificationErrorsLists); - resultList.append(_notificationIgnoredFiles); + if(_notificationErrorsLists.count() > 0) { + std::sort(_notificationErrorsLists.begin(), _notificationErrorsLists.end()); + resultList.append(_notificationErrorsLists); + } + if(_listOfIgnoredFiles.size() > 0) + resultList.append(_notificationIgnoredFiles); - std::sort(_notificationLists.begin(), _notificationLists.end()); - resultList.append(_notificationLists); + if(_notificationLists.count() > 0) { + std::sort(_notificationLists.begin(), _notificationLists.end()); + resultList.append(_notificationLists); + } - std::sort(_syncFileItemLists.begin(), _syncFileItemLists.end()); - resultList.append(_syncFileItemLists); + if(_syncFileItemLists.count() > 0) { + std::sort(_syncFileItemLists.begin(), _syncFileItemLists.end()); + resultList.append(_syncFileItemLists); + } - std::sort(_activityLists.begin(), _activityLists.end()); - resultList.append(_activityLists); + if(_activityLists.count() > 0) { + std::sort(_activityLists.begin(), _activityLists.end()); + resultList.append(_activityLists); + } beginResetModel(); _finalList.clear(); |