Import next-gen libtaskmanager.
ClosedPublic

Authored by hein on May 31 2016, 8:44 AM.

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
There are a very large number of changes, so older changes are hidden. Show Older Changes
hein added inline comments.Jun 1 2016, 6:10 AM
libtaskmanager/abstracttasksmodel.h
64

I improved the comment.

76

Changed.

88

Done.

91

Done.

libtaskmanager/activityinfo.cpp
56

Done, also in TasksModel.

70

Implemented.

libtaskmanager/launchertasksmodel.cpp
127

Changed it ...

libtaskmanager/launchertasksmodel.h
62

Done.

libtaskmanager/startuptasksmodel.cpp
65

Done.

147

Done.

183

Done.

197

Done.

239

Done.

243

Done.

libtaskmanager/taskfilterproxymodel.h
125

Superceded by David's review, fixed.

libtaskmanager/xwindowtasksmodel.cpp
96

Done.

hein marked 18 inline comments as done.Jun 1 2016, 6:20 AM
hein added inline comments.
libtaskmanager/launchertasksmodel.cpp
126

I don't understand this. You're complaining about the white space or ...? I changed it assuming that was it.

libtaskmanager/taskgroupingproxymodel.cpp
338

Done, first should have been PrettyDecoded.

372

Changed in a number of places.

hein updated this revision to Diff 4121.Jun 1 2016, 6:21 AM
hein marked 2 inline comments as done.

Fix build (mixed up dirs); more requested changes.

hein updated this revision to Diff 4122.Jun 1 2016, 6:24 AM

Fix connect to private slot.

hein marked an inline comment as done.Jun 1 2016, 6:39 AM
hein added inline comments.
libtaskmanager/xwindowtasksmodel.cpp
435

Done.

hein updated this revision to Diff 4123.Jun 1 2016, 6:48 AM

Don't open taskmanagerrulesrc every time, keep KConfig around and call
reparseConfiguration when a KDirWatch calls for it.

hein updated this revision to Diff 4128.Jun 1 2016, 9:03 AM

Make QByteArray snippet shorter.

hein marked an inline comment as done.Jun 1 2016, 9:05 AM
hein added inline comments.
libtaskmanager/xwindowtasksmodel.cpp
757

Done now.

hein updated this revision to Diff 4177.Jun 3 2016, 5:28 AM

Add a property for whether any task demands attention.

This will be used by the applet to update the applet status, which
factors into e.g. auto-hide. This used to be done with a mix of JS
in the applet and in the applet C++ backend, but it can be done more
efficiently and correctly in the lib.

hein updated this revision to Diff 4179.Jun 3 2016, 5:52 AM

Consider app id equivalence when matching up launchers and windows as well.

Helps with .desktop files that move in the XDG hierarchy, e.g. on menu edits.

hein updated this revision to Diff 4180.Jun 3 2016, 6:21 AM

Wipe app data caches on KSycoca changes and emit data changes.

This means e.g. launcher and window buttons will get new icons when
the icon is changed via kmenuedit. This is probably the first time
ever this has worked in KDE/Plasma.

graesslin requested changes to this revision.Jun 3 2016, 8:35 AM
graesslin added a reviewer: graesslin.
graesslin added inline comments.
libtaskmanager/waylandtasksmodel.cpp
116–120

at the point of adding a window you can be quite sure that the appId is not yet pushed. Maybe we should introduce a dedicated event in the protocol to signal that the initial known data is pushed to the client. That's e.g. how Output does it.

Which could be nice to ensure that the task model doesn't start adding any elements before it knows what to do with it. Also for the case that the window is already unmapped.

234

shouldn't you check whether the index is valid?

245–247

WaylandTasksModel::~WaylandTasksModel() = default;

257

any specific reason why you use an if-else structure instead of a switch?

360

there is no global timestamp like on X11 on Wayland. Timestamps are only used for frame rendered callbacks and on input events. Both are defined to have an undefined base and there is nowhere specified that they have the same base.

491

why don't you use the namespace more globally?

libtaskmanager/xwindowtasksmodel.cpp
116

why not KSharedConfig::openConfig?

119

coding style nitpick: missing space between foreach and (

169
199

coding style nitpick: missing whitespace

420

I don't understand this valid check. Why are you inserting non valid KWindowInfo into the cache in the first place?

This revision now requires changes to proceed.Jun 3 2016, 8:35 AM
hein marked 11 inline comments as done.Jun 3 2016, 9:11 AM
hein added inline comments.
libtaskmanager/waylandtasksmodel.cpp
116–120

I've added a FIXME until we figure that out.

234

If this check were necessary, something else would be broken somewhere. dataChanged() is called with window instances which are in the list, so indexOf will return something sensible. index() then can't fail because hasIndex() just does a bounds check against rowCount() (which operates on the same list) before calling createIndex() (which doesn't really do anything with data). So the index could only be invalid if dataChanged() were called with a window that's not in Private::windows, which makes no sense.

245–247

Ok.

257

Not really.

360

Removed FIXME.

491

No particular reason. Might change as the code evolves.

libtaskmanager/xwindowtasksmodel.cpp
116

Changed.

119

Ok.

169

Changed.

199

Ok.

420

Paranoia. I'm not inserting invalid ones into the cache, but I figured if there's a valid() it would be a good idea to call it before using it, so that block checked valid() and evicted if false. I've removed the block now.

hein updated this revision to Diff 4182.Jun 3 2016, 9:11 AM
hein edited edge metadata.
hein marked 11 inline comments as done.

Addressed Martin's comments.

lbeltrame added a subscriber: lbeltrame.EditedJun 3 2016, 12:39 PM

Doesn't build here (posted to D1721 by mistake):

/home/abuild/rpmbuild/BUILD/plasma-workspace-5.6.90git~20160602T115930~0d0c4f4/libtaskmanager/taskgroupingproxymodel.cpp:40:19: error: field 'blacklistedAppIds' has incomplete type 'QSet<QString>'

davidedmundson accepted this revision.Jun 3 2016, 12:47 PM
davidedmundson added a reviewer: davidedmundson.

I think this is good to go.

lbeltrame requested changes to this revision.Jun 3 2016, 12:49 PM
lbeltrame added a reviewer: lbeltrame.
--- libtaskmanager/taskgroupingproxymodel.cpp.orig      2016-06-03 14:45:46.798676712 +0200
+++ libtaskmanager/taskgroupingproxymodel.cpp   2016-06-03 14:46:00.378760824 +0200
@@ -22,6 +22,8 @@
 #include "abstracttasksmodel.h"
 #include "tasktools.h"
 
+#include <QSet>
+
 namespace TaskManager
 {

This fixes it for me. Feel free to make more appropriate changes.

This revision now requires changes to proceed.Jun 3 2016, 12:49 PM
hein updated this revision to Diff 4225.Jun 6 2016, 6:53 AM
hein edited edge metadata.

Add QSet include to fix Luca's build.

hein updated this revision to Diff 4226.Jun 6 2016, 7:11 AM
hein edited edge metadata.

Evict window info cache on WMGeometry changes.

This fixes stale data being returned for AbstractTasksModel::Screen.

Should fix Luca's bug mentioned in D1724.

davidedmundson accepted this revision.Jun 6 2016, 7:38 AM
davidedmundson edited edge metadata.
lbeltrame accepted this revision.Jun 6 2016, 7:40 AM
lbeltrame edited edge metadata.
graesslin accepted this revision.Jun 6 2016, 7:41 AM
graesslin edited edge metadata.
This revision is now accepted and ready to land.Jun 6 2016, 7:41 AM
This revision was automatically updated to reflect the committed changes.
shumski added a subscriber: shumski.Jun 6 2016, 8:06 AM

Plasma addons don't build against this change:
/home/abuild/rpmbuild/BUILD/kdeplasma-addons-5.6.90git~20160524T120553~7d85a2c/applets/activitypager/plugin/activitypager.cpp:53:30: fatal error: taskmanager/task.h: No such file or directory

hein added a comment.Jun 6 2016, 8:17 AM

Plasma addons don't build against this change:

/home/abuild/rpmbuild/BUILD/kdeplasma-addons-5.6.90git~20160524T120553~7d85a2c/applets/activitypager/plugin/activitypager.cpp:53:30: fatal error: taskmanager/task.h: No such file or directory

Thanks for catching this. kdeplasma-addons 8a93bf570a38 should fix this build issue.