[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [plasma-desktop/Plasma/5.6] applets/taskmanager/plugin: [taskmanager] Stop parsing executables as .d
From:       Kai Uwe Broulik <kde () privat ! broulik ! de>
Date:       2016-04-30 16:21:24
Message-ID: E1awXe0-0004Bh-Et () scm ! kde ! org
[Download RAW message or body]

Git commit 71055e2b725fbb65e16055588f86a57c373d8b47 by Kai Uwe Broulik, on behalf of \
Rob Wu. Committed on 30/04/2016 at 16:20.
Pushed by broulik into branch 'Plasma/5.6'.

[taskmanager] Stop parsing executables as .desktop files

When a binary is launched via an absolute path, then launcherUrl is not
empty because of [1], even though it is not a .desktop file.
Consequently, when a user right-clicks on the task item, plasmashell
attempts to parse the executable as a .desktop configuration file.
Since this file is obviously not a .desktop file, parsing it as such
will fail, and KConfig floods ~/.xsession-errors with lots of errors.
This can quickly add hundreds of megabytes per right-click...

This patch resolves the problem by not constructing a KDesktopFile if
the launcherUrl is not a .desktop file.

An alternative (and more general) way to get rid of the symptoms is to
modify KDesktopFile / KConfig to stop parsing on the first error and
write the launcherUrl to the error log (or at the very least limit the
number of displayed errors). However, it can be argued that you should
not pass a non-.desktop file to KDesktopFile.

[1] https://quickgit.kde.org/?p=kde-workspace.git&a=commit&h=3a4b9c85fc21d14838ceac04bb0a70656ee7c701


REVIEW: 127571

M  +1    -1    applets/taskmanager/plugin/backend.cpp

http://commits.kde.org/plasma-desktop/71055e2b725fbb65e16055588f86a57c373d8b47

diff --git a/applets/taskmanager/plugin/backend.cpp \
b/applets/taskmanager/plugin/backend.cpp index 88c1b3d..0e69e21 100644
--- a/applets/taskmanager/plugin/backend.cpp
+++ b/applets/taskmanager/plugin/backend.cpp
@@ -365,7 +365,7 @@ void Backend::itemContextMenu(QQuickItem *item, QObject \
*configAction)  
 void Backend::addJumpListActions(const QUrl &launcherUrl, TaskManager::BasicMenu \
*menu) const  {
-    if (!menu || !launcherUrl.isValid() || !launcherUrl.isLocalFile()) {
+    if (!menu || !launcherUrl.isValid() || !launcherUrl.isLocalFile() || \
!KDesktopFile::isDesktopFile(launcherUrl.toLocalFile())) {  return;
     }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic