From 8c40ed4fb049b66c4769eca01f185573a7f9adba Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 26 Jan 2017 22:57:32 +0200 Subject: [PATCH] fix #88,protect launchers from adding icon info --- plasmoid/contents/ui/ContextMenu.qml | 2 +- plasmoid/contents/ui/main.qml | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plasmoid/contents/ui/ContextMenu.qml b/plasmoid/contents/ui/ContextMenu.qml index 1a229ef29..a41943e5e 100644 --- a/plasmoid/contents/ui/ContextMenu.qml +++ b/plasmoid/contents/ui/ContextMenu.qml @@ -567,7 +567,7 @@ PlasmaComponents.ContextMenu { if (tasksModel.launcherPosition(visualParent.m.LauncherUrlWithoutIcon) != -1) { tasksModel.requestRemoveLauncher(visualParent.m.LauncherUrlWithoutIcon); } else { - tasksModel.requestAddLauncher(visualParent.m.LauncherUrl); + tasksModel.requestAddLauncher(visualParent.m.LauncherUrlWithoutIcon); } } } diff --git a/plasmoid/contents/ui/main.qml b/plasmoid/contents/ui/main.qml index 784ec3833..4135a0edc 100644 --- a/plasmoid/contents/ui/main.qml +++ b/plasmoid/contents/ui/main.qml @@ -349,7 +349,6 @@ Item { onAddLauncher: { tasksModel.requestAddLauncher(url); - // tasksModel.move(pos, newDroppedPosition); } } @@ -957,6 +956,13 @@ Item { } function addLauncher(url) { + //workaround to protect in case the launcher contains the iconData + var pos = url.indexOf("?iconData="); + + if (pos>0) { + url = url.substring( 0, url.indexOf("?iconData=" ) ); + } + tasksModel.requestAddLauncher(url); }