Changeset View
Changeset View
Standalone View
Standalone View
liblegacytaskmanager/strategies/activitysortingstrategy.cpp
- This file was moved from libtaskmanager/strategies/activitysortingstrategy.cpp.
Show All 16 Lines | |||||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * | ||
18 | ***************************************************************************/ | 18 | ***************************************************************************/ | ||
19 | 19 | | |||
20 | 20 | | |||
21 | #include <strategies/activitysortingstrategy.h> | 21 | #include <strategies/activitysortingstrategy.h> | ||
22 | #include <taskitem.h> | 22 | #include <taskitem.h> | ||
23 | #include <taskgroup.h> | 23 | #include <taskgroup.h> | ||
24 | 24 | | |||
25 | namespace TaskManager | 25 | namespace LegacyTaskManager | ||
26 | { | 26 | { | ||
27 | 27 | | |||
28 | ActivitySortingStrategy::ActivitySortingStrategy(QObject *parent) | 28 | ActivitySortingStrategy::ActivitySortingStrategy(QObject *parent) | ||
29 | :AbstractSortingStrategy(parent) | 29 | :AbstractSortingStrategy(parent) | ||
30 | { | 30 | { | ||
31 | setType(GroupManager::ActivitySorting); | 31 | setType(GroupManager::ActivitySorting); | ||
32 | } | 32 | } | ||
33 | 33 | | |||
▲ Show 20 Lines • Show All 105 Lines • ▼ Show 20 Line(s) | 135 | { | |||
139 | 139 | | |||
140 | Comparator comparator(&m_activitiesOrder, qobject_cast<GroupManager *>(parent())); | 140 | Comparator comparator(&m_activitiesOrder, qobject_cast<GroupManager *>(parent())); | ||
141 | 141 | | |||
142 | qStableSort(items.begin(), items.end(), comparator); | 142 | qStableSort(items.begin(), items.end(), comparator); | ||
143 | } | 143 | } | ||
144 | 144 | | |||
145 | void ActivitySortingStrategy::handleItem(AbstractGroupableItem* item) | 145 | void ActivitySortingStrategy::handleItem(AbstractGroupableItem* item) | ||
146 | { | 146 | { | ||
147 | connect(item, SIGNAL(changed(::TaskManager::TaskChanges)), this, SLOT(checkChanges(::TaskManager::TaskChanges))); | 147 | connect(item, SIGNAL(changed(::LegacyTaskManager::TaskChanges)), this, SLOT(checkChanges(::LegacyTaskManager::TaskChanges))); | ||
148 | AbstractSortingStrategy::handleItem(item); | 148 | AbstractSortingStrategy::handleItem(item); | ||
149 | checkChanges(ActivitiesChanged, item); | 149 | checkChanges(ActivitiesChanged, item); | ||
150 | } | 150 | } | ||
151 | 151 | | |||
152 | bool ActivitySortingStrategy::lessThanActivityData(QPair< QString, int >& d1, QPair< QString, int >& d2) | 152 | bool ActivitySortingStrategy::lessThanActivityData(QPair< QString, int >& d1, QPair< QString, int >& d2) | ||
153 | { | 153 | { | ||
154 | if (d1.second == d2.second) { | 154 | if (d1.second == d2.second) { | ||
155 | return d1.first < d2.first; | 155 | return d1.first < d2.first; | ||
▲ Show 20 Lines • Show All 93 Lines • Show Last 20 Lines |