D22381: Add previous-/nextActivity methods

2019-10-03 Thread Christian Muehlhaeuser
This revision was automatically updated to reflect the committed changes. muesli marked an inline comment as done. Closed by commit R161:e3a7cb2f1b18: Add previous-/nextActivity methods (authored by muesli). REPOSITORY R161 KActivity Manager Service CHANGES SINCE LAST UPDATE https://phabrica

D22381: Add previous-/nextActivity methods

2019-10-03 Thread Christian Muehlhaeuser
muesli updated this revision to Diff 67276. muesli added a comment. Fix typo in 'nameBasedOrdering' REPOSITORY R161 KActivity Manager Service CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D22381?vs=61590&id=67276 BRANCH prevnext-activity (branched from master) REVISION DETAIL

D22381: Add previous-/nextActivity methods

2019-10-03 Thread Ivan Čukić
ivan added inline comments. INLINE COMMENTS > Activities.cpp:56 > +inline > +bool nameBaseOrdering(const ActivityInfo &info, const ActivityInfo > &other) > +{ Nitpick Base -> Based > Activities.cpp:251 > + > +for (int i = 0; i < a.count(); ++i) { > +if (a[i] == currentA

D22381: Add previous-/nextActivity methods

2019-07-11 Thread Christian Muehlhaeuser
muesli updated this revision to Diff 61590. muesli added a comment. Move nameBaseOrdering to an anonymous namespace and mark it as inline. REPOSITORY R161 KActivity Manager Service CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D22381?vs=61589&id=61590 BRANCH prevnext-activity (

D22381: Add previous-/nextActivity methods

2019-07-11 Thread Christian Muehlhaeuser
muesli updated this revision to Diff 61589. muesli added a comment. Addressed @ivan's change requests Summary: - Renamed sorting method to nameBaseOrdering - Remove activity from sorted cache without re-sorting the entire list - Switch to prev/next running activity, skipping other

D22381: Add previous-/nextActivity methods

2019-07-11 Thread Christian Muehlhaeuser
muesli updated this revision to Diff 61588. muesli added a comment. Use a QVector instead of a QList to store sorted activities. REPOSITORY R161 KActivity Manager Service CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D22381?vs=61579&id=61588 BRANCH prevnext-activity (branched f

D22381: Add previous-/nextActivity methods

2019-07-11 Thread Ivan Čukić
ivan requested changes to this revision. ivan added a comment. This revision now requires changes to proceed. Inserting/Removing/Updating a sorted list does not need to resort every time - removing is easy, adding a new item is std::lower_bound (a binary search), and updating is a combination

D22381: Add previous-/nextActivity methods

2019-07-11 Thread Christian Muehlhaeuser
muesli updated this revision to Diff 61579. muesli added a comment. Keep an alphabetically sorted list of activities Summary: Instead of re-sorting the activity list every time previous-/nextActivity gets called, maintain a sorted list. REPOSITORY R161 KActivity Manager Service CHA

D22381: Add previous-/nextActivity methods

2019-07-10 Thread Ivan Čukić
ivan added a comment. You are right, they are randomized. And, yes, that is what I meant on IRC - that redundancy due to keeping a sorted list will likely lead to future issues, but I see no other way if we want to be consistent regarding listing and switching. As it is required to

D22381: Add previous-/nextActivity methods

2019-07-10 Thread Christian Muehlhaeuser
muesli added inline comments. INLINE COMMENTS > ivan wrote in Activities.cpp:218 > I don't like the fact that it constantly resorts the activities. > > The second problem is that ListActivities returns a list in one order, and > this traverses activities in another order. If this will work by n

D22381: Add previous-/nextActivity methods

2019-07-10 Thread Ivan Čukić
ivan requested changes to this revision. ivan added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > Activities.cpp:218 > +auto a = q->ListActivitiesWithInformation(); > +std::sort(a.begin(), a.end(), &infoLessThan); > + I don't like the fact that it cons

D22381: Add previous-/nextActivity methods

2019-07-10 Thread Christian Muehlhaeuser
muesli created this revision. muesli added a reviewer: ivan. Herald added a project: Plasma. Herald added a subscriber: plasma-devel. muesli requested review of this revision. REVISION SUMMARY These two methods can be used to switch to the previous/next activity in alphabetical order. They are