Changeset View
Changeset View
Standalone View
Standalone View
applets/taskmanager/plugin/backend.cpp
Show First 20 Lines • Show All 136 Lines • ▼ Show 20 Line(s) | 122 | foreach (const QString &actionName, jumpListActions) { | |||
---|---|---|---|---|---|
137 | } | 137 | } | ||
138 | 138 | | |||
139 | const QString &name = actionGroup.readEntry(QStringLiteral("Name")); | 139 | const QString &name = actionGroup.readEntry(QStringLiteral("Name")); | ||
140 | const QString &exec = actionGroup.readEntry(QStringLiteral("Exec")); | 140 | const QString &exec = actionGroup.readEntry(QStringLiteral("Exec")); | ||
141 | if (name.isEmpty() || exec.isEmpty()) { | 141 | if (name.isEmpty() || exec.isEmpty()) { | ||
142 | continue; | 142 | continue; | ||
143 | } | 143 | } | ||
144 | 144 | | |||
145 | QAction *action = new QAction(this); | 145 | QAction *action = new QAction(parent); | ||
146 | action->setText(name); | 146 | action->setText(name); | ||
147 | action->setIcon(QIcon::fromTheme(actionGroup.readEntry("Icon"))); | 147 | action->setIcon(QIcon::fromTheme(actionGroup.readEntry("Icon"))); | ||
148 | action->setProperty("exec", exec); | 148 | action->setProperty("exec", exec); | ||
149 | // so we can show the proper application name and icon when it launches | 149 | // so we can show the proper application name and icon when it launches | ||
150 | action->setProperty("applicationName", desktopFile.readName()); | 150 | action->setProperty("applicationName", desktopFile.readName()); | ||
151 | action->setProperty("applicationIcon", desktopFile.readIcon()); | 151 | action->setProperty("applicationIcon", desktopFile.readIcon()); | ||
152 | connect(action, &QAction::triggered, this, &Backend::handleJumpListAction); | 152 | connect(action, &QAction::triggered, this, &Backend::handleJumpListAction); | ||
153 | 153 | | |||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 193 | while (actionCount < 5 && resultIt != results.end()) { | |||
199 | } | 199 | } | ||
200 | 200 | | |||
201 | const KFileItem fileItem(url); | 201 | const KFileItem fileItem(url); | ||
202 | 202 | | |||
203 | if (!fileItem.isFile()) { | 203 | if (!fileItem.isFile()) { | ||
204 | continue; | 204 | continue; | ||
205 | } | 205 | } | ||
206 | 206 | | |||
207 | QAction *action = new QAction(this); | 207 | QAction *action = new QAction(parent); | ||
208 | action->setText(url.fileName()); | 208 | action->setText(url.fileName()); | ||
209 | action->setIcon(QIcon::fromTheme(fileItem.iconName(), QIcon::fromTheme("unknown"))); | 209 | action->setIcon(QIcon::fromTheme(fileItem.iconName(), QIcon::fromTheme("unknown"))); | ||
210 | action->setProperty("agent", storageId); | 210 | action->setProperty("agent", storageId); | ||
211 | action->setProperty("entryPath", launcherUrl); | 211 | action->setProperty("entryPath", launcherUrl); | ||
212 | action->setData(resource); | 212 | action->setData(resource); | ||
213 | connect(action, &QAction::triggered, this, &Backend::handleRecentDocumentAction); | 213 | connect(action, &QAction::triggered, this, &Backend::handleRecentDocumentAction); | ||
214 | 214 | | |||
215 | actions << QVariant::fromValue<QAction *>(action); | 215 | actions << QVariant::fromValue<QAction *>(action); | ||
216 | 216 | | |||
217 | ++resultIt; | 217 | ++resultIt; | ||
218 | ++actionCount; | 218 | ++actionCount; | ||
219 | } | 219 | } | ||
220 | 220 | | |||
221 | if (actionCount > 0) { | 221 | if (actionCount > 0) { | ||
222 | QAction *action = new QAction(this); | 222 | QAction *action = new QAction(parent); | ||
223 | action->setText(i18n("Forget Recent Documents")); | 223 | action->setText(i18n("Forget Recent Documents")); | ||
224 | action->setProperty("agent", storageId); | 224 | action->setProperty("agent", storageId); | ||
225 | connect(action, &QAction::triggered, this, &Backend::handleRecentDocumentAction); | 225 | connect(action, &QAction::triggered, this, &Backend::handleRecentDocumentAction); | ||
226 | 226 | | |||
227 | actions << QVariant::fromValue<QAction *>(action); | 227 | actions << QVariant::fromValue<QAction *>(action); | ||
228 | } | 228 | } | ||
229 | 229 | | |||
230 | return actions; | 230 | return actions; | ||
▲ Show 20 Lines • Show All 201 Lines • Show Last 20 Lines |