Changeset View
Changeset View
Standalone View
Standalone View
applets/kicker/plugin/actionlist.cpp
Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Line(s) | 142 | { | |||
---|---|---|---|---|---|
144 | if (!service) { | 144 | if (!service) { | ||
145 | return actionList; | 145 | return actionList; | ||
146 | } | 146 | } | ||
147 | 147 | | |||
148 | if (ContainmentInterface::mayAddLauncher(appletInterface, ContainmentInterface::Desktop)) { | 148 | if (ContainmentInterface::mayAddLauncher(appletInterface, ContainmentInterface::Desktop)) { | ||
149 | actionList << Kicker::createActionItem(i18n("Add to Desktop"), "addToDesktop"); | 149 | actionList << Kicker::createActionItem(i18n("Add to Desktop"), "addToDesktop"); | ||
150 | } | 150 | } | ||
151 | 151 | | |||
152 | if (ContainmentInterface::mayAddLauncher(appletInterface, ContainmentInterface::Panel)) { | 152 | // to avoid confusing users, only show "Pin to Task Manager" if there's a Task Manager (see Bug 390817) | ||
153 | actionList << Kicker::createActionItem(i18n("Add to Panel (Widget)"), "addToPanel"); | 153 | // If there's no Task Manager and the panel is unlocked, show "Add to Panel (Widget)" instead | ||
154 | } | | |||
155 | | ||||
156 | if (service && ContainmentInterface::mayAddLauncher(appletInterface, ContainmentInterface::TaskManager, service->entryPath())) { | 154 | if (service && ContainmentInterface::mayAddLauncher(appletInterface, ContainmentInterface::TaskManager, service->entryPath())) { | ||
157 | actionList << Kicker::createActionItem(i18n("Pin to Task Manager"), "addToTaskManager"); | 155 | actionList << Kicker::createActionItem(i18n("Pin to Task Manager"), "addToTaskManager"); | ||
156 | } else if (ContainmentInterface::mayAddLauncher(appletInterface, ContainmentInterface::Panel)) { | ||||
davidedmundson: I assume you have a second patch in p-f for this?
(which means this is Plasma 5.14 material) | |||||
This patch worked just for me all by itself, so I wasn't aware this required a plasma-framework change (I just moved the conditional around a bit, basically). Did I miss something? ngraham: This patch worked just for me all by itself, so I wasn't aware this required a plasma-framework… | |||||
My bad. Kicker had a class ContainmentInterface which was different from the containmentinterface is p-f. I knew the one in p-f didn't have the method, and got confused. davidedmundson: My bad.
Kicker had a class ContainmentInterface which was different from the… | |||||
157 | actionList << Kicker::createActionItem(i18n("Add to Panel (Widget)"), "addToPanel"); | ||||
158 | } | 158 | } | ||
159 | 159 | | |||
160 | return actionList; | 160 | return actionList; | ||
161 | } | 161 | } | ||
162 | 162 | | |||
163 | bool handleAddLauncherAction(const QString &actionId, QObject *appletInterface, const KService::Ptr &service) | 163 | bool handleAddLauncherAction(const QString &actionId, QObject *appletInterface, const KService::Ptr &service) | ||
164 | { | 164 | { | ||
165 | if (!service) { | 165 | if (!service) { | ||
▲ Show 20 Lines • Show All 235 Lines • Show Last 20 Lines |
I assume you have a second patch in p-f for this?
(which means this is Plasma 5.14 material)