Review Request: TaskManager: Store launcher order
Craig Drummond
craig at kde.org
Tue Nov 1 15:30:20 UTC 2011
> On Nov. 1, 2011, 2:56 p.m., Aaron J. Seigo wrote:
> > libs/taskmanager/taskitem.cpp, lines 171-189
> > <http://git.reviewboard.kde.org/r/103006/diff/1/?file=39943#file39943line171>
> >
> > have you done any time measurements on how long this method takes? it will be called potentially quite a few times when a launcher is started ...
Nope. Seems to work ok, and I use IconTasks at work and home. In another patch, launcherUrl() is also set from the start-up item. Therefore, the block of this code will only be executed once.
> On Nov. 1, 2011, 2:56 p.m., Aaron J. Seigo wrote:
> > libs/taskmanager/groupmanager.cpp, lines 122-123
> > <http://git.reviewboard.kde.org/r/103006/diff/1/?file=39933#file39933line122>
> >
> > instead of having the launchers in two lists, if ordering matters (and i agree it should), then perhaps turn the QHash of launchers into a QList<LauncherItem *> and keep the ordering there.
> >
> > finding by URL (which happens in two places) then becomes:
> >
> > foreach (const LauncherItem *item, launchers) {
> > if (item->url() == url) {
> > ... found ...
> > }
> > }
> >
> > the # of launchers will remain small so the overhead of this will be negligable and it will save both on allocations and having to keep two collections in sync with each other.
> >
> > this could even be turned into a small helper method in the private class: int indexOfLauncher(const KUrl &url) const;
The reason they were kept separate is to not slow down the lookup of launchers via url. But I agree, it is used so little (and will have few entries), that it does not make sense to keep them separate.
- Craig
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/103006/#review7798
-----------------------------------------------------------
On Oct. 31, 2011, 8:42 p.m., Craig Drummond wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103006/
> -----------------------------------------------------------
>
> (Updated Oct. 31, 2011, 8:42 p.m.)
>
>
> Review request for Plasma.
>
>
> Description
> -------
>
> 1. Store the order in which launchers are created
> 2. Add a new config option, separateLaunchers - so that applet can decide if launchers and tasks should be kept separate.
>
> (Part of IconTasks' taskmanager changes)
>
>
> Diffs
> -----
>
> libs/taskmanager/abstractgroupingstrategy.cpp 4ed424a
> libs/taskmanager/abstractsortingstrategy.cpp 390f6f0
> libs/taskmanager/groupmanager.h acaa142
> libs/taskmanager/groupmanager.cpp 6e7ffa7
> libs/taskmanager/launcheritem.cpp 20f0e7c
> libs/taskmanager/strategies/alphasortingstrategy.cpp 9ec1aca
> libs/taskmanager/strategies/desktopsortingstrategy.cpp 520fead
> libs/taskmanager/strategies/manualsortingstrategy.h 113faab
> libs/taskmanager/strategies/manualsortingstrategy.cpp 4409a6b
> libs/taskmanager/strategies/programgroupingstrategy.cpp 5c43d03
> libs/taskmanager/taskgroup.h 53c2871
> libs/taskmanager/taskgroup.cpp 49140ae
> libs/taskmanager/taskitem.h 5de8478
> libs/taskmanager/taskitem.cpp 0a768e5
>
> Diff: http://git.reviewboard.kde.org/r/103006/diff/diff
>
>
> Testing
> -------
>
>
> Thanks,
>
> Craig Drummond
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20111101/4c95f9ad/attachment-0001.html>
More information about the Plasma-devel
mailing list