Review Request: TaskManager: Improve matching of task to launcher (.desktop file)

Aaron J. Seigo aseigo at kde.org
Tue Nov 1 16:29:08 UTC 2011



> On Nov. 1, 2011, 2:31 p.m., Aaron J. Seigo wrote:
> > libs/taskmanager/taskmanagerrulesrc, line 13
> > <http://git.reviewboard.kde.org/r/103005/diff/1/?file=39929#file39929line13>
> >
> >     perhaps an entry for kcmshell4 as well?
> 
> Craig Drummond wrote:
>     Currently kcmshell4 *cannot* be matched to a launcher. I agree this should to be fixed.
> 
> Aaron J. Seigo wrote:
>     i believe i described how it could be matched on the mailing list? :)
> 
> Craig Drummond wrote:
>     Ok, but that would be for another patch...

agreed ... this one is already big and featureful enough to deal with :)


> On Nov. 1, 2011, 2:31 p.m., Aaron J. Seigo wrote:
> > libs/taskmanager/taskitem.cpp, line 416
> > <http://git.reviewboard.kde.org/r/103005/diff/1/?file=39928#file39928line416>
> >
> >     if isStartupItem, d->task should be null as well ...
> 
> Craig Drummond wrote:
>     Sorry, not sure what you are trying to say here...
>     
>     The "if" is checking , that if we are not a task and not a startup then return an empty url - otherwise attempt to determine the launcherUrl
> 
> Aaron J. Seigo wrote:
>     ah, you want to run it when it IS a startup .. in which case i'd just remove this check altogether.. the code checks for d->task and isStartupItem() in the body, so this is just a (somewhat confusing) short-circuit check with the version in your patch. +1 for removing the if()
>     
>     and in that case i'd probably also do a d->launcherUrl.clear() in TaskItem::setTaskPointer
> 
> Craig Drummond wrote:
>     Not really, as if its not a task and not startup I dont want to set the 'checkedForLauncher' flag.
>     
>     As to clearing the launcherUrl in setTaskPointer - why? If I get a launcherUrl from the start-up info, this is going to be accurate, no? Why re-check?

because:

* there is no API guarantee that the task pointer relates to the StartupTask
* if the task pointer is cleared, so should the launcher url (internal consistency)

so what might work is this:

if (!d->statupTask && d->task.data() != task.data()) {
     // if we aren't moving from startup -> task and the task pointer is changing on us
     // let's clear the launcher url
     d->launcherUrl->clear();
}

so in the actual code this could become sth like:

    const bool differentTask = d->task.data() != task.data();

    if (d->startupTask) {
        disconnect(d->startupTask.data(), 0, this, 0);
        d->startupTask = 0;
    } else if (differentTask) {
         // if we aren't moving from startup -> task and the task pointer is changing on us
         // let's clear the launcher url
        d->lancherUrl->clear();
    }

    if (differentTask) {
      .....


- Aaron J.


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/103005/#review7797
-----------------------------------------------------------


On Oct. 31, 2011, 8:41 p.m., Craig Drummond wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103005/
> -----------------------------------------------------------
> 
> (Updated Oct. 31, 2011, 8:41 p.m.)
> 
> 
> Review request for Plasma.
> 
> 
> Description
> -------
> 
> Add more KTrader queries when attempting to match a task to a launcher.
> 
> (Part of IconTasks' taskmanager changes)
> 
> 
> Diffs
> -----
> 
>   libs/taskmanager/CMakeLists.txt 57f5f73 
>   libs/taskmanager/startup.h 997eb7e 
>   libs/taskmanager/startup.cpp e4df7c7 
>   libs/taskmanager/task.h 45acd5a 
>   libs/taskmanager/task_win.cpp ea03004 
>   libs/taskmanager/task_x11.cpp 04af0c7 
>   libs/taskmanager/taskitem.h 5de8478 
>   libs/taskmanager/taskitem.cpp 0a768e5 
>   libs/taskmanager/taskmanagerrulesrc PRE-CREATION 
> 
> Diff: http://git.reviewboard.kde.org/r/103005/diff/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Craig Drummond
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20111101/fb7d9469/attachment.html>


More information about the Plasma-devel mailing list