Changeset View
Changeset View
Standalone View
Standalone View
src/dolphinpart.cpp
Show First 20 Lines • Show All 248 Lines • ▼ Show 20 Line(s) | 247 | { | |||
---|---|---|---|---|---|
249 | emit m_extension->openUrlRequest(QUrl(url)); | 249 | emit m_extension->openUrlRequest(QUrl(url)); | ||
250 | } | 250 | } | ||
251 | 251 | | |||
252 | void DolphinPart::slotSelectionChanged(const KFileItemList& selection) | 252 | void DolphinPart::slotSelectionChanged(const KFileItemList& selection) | ||
253 | { | 253 | { | ||
254 | const bool hasSelection = !selection.isEmpty(); | 254 | const bool hasSelection = !selection.isEmpty(); | ||
255 | 255 | | |||
256 | QAction* renameAction = actionCollection()->action(QStringLiteral("rename")); | 256 | QAction* renameAction = actionCollection()->action(QStringLiteral("rename")); | ||
257 | QAction* moveToTrashAction = actionCollection()->action(QStringLiteral("move_to_trash")); | 257 | QAction* moveToTrashAction = actionCollection()->action(KStandardAction::name(KStandardAction::MoveToTrash)); | ||
258 | QAction* deleteAction = actionCollection()->action(KStandardAction::name(KStandardAction::DeleteFile)); | 258 | QAction* deleteAction = actionCollection()->action(KStandardAction::name(KStandardAction::DeleteFile)); | ||
259 | QAction* editMimeTypeAction = actionCollection()->action(QStringLiteral("editMimeType")); | 259 | QAction* editMimeTypeAction = actionCollection()->action(QStringLiteral("editMimeType")); | ||
260 | QAction* propertiesAction = actionCollection()->action(QStringLiteral("properties")); | 260 | QAction* propertiesAction = actionCollection()->action(QStringLiteral("properties")); | ||
261 | QAction* deleteWithTrashShortcut = actionCollection()->action(QStringLiteral("delete_shortcut")); // see DolphinViewActionHandler | 261 | QAction* deleteWithTrashShortcut = actionCollection()->action(QStringLiteral("delete_shortcut")); // see DolphinViewActionHandler | ||
262 | 262 | | |||
263 | if (!hasSelection) { | 263 | if (!hasSelection) { | ||
264 | stateChanged(QStringLiteral("has_no_selection")); | 264 | stateChanged(QStringLiteral("has_no_selection")); | ||
265 | 265 | | |||
▲ Show 20 Lines • Show All 161 Lines • ▼ Show 20 Line(s) | 424 | if (!_item.isNull()) { // only for context menu on one or more items | |||
427 | if (capabilities.supportsDeleting()) { | 427 | if (capabilities.supportsDeleting()) { | ||
428 | const bool showDeleteAction = (KSharedConfig::openConfig()->group("KDE").readEntry("ShowDeleteCommand", false) || | 428 | const bool showDeleteAction = (KSharedConfig::openConfig()->group("KDE").readEntry("ShowDeleteCommand", false) || | ||
429 | !item.isLocalFile()); | 429 | !item.isLocalFile()); | ||
430 | const bool showMoveToTrashAction = capabilities.isLocal() && supportsMoving; | 430 | const bool showMoveToTrashAction = capabilities.isLocal() && supportsMoving; | ||
431 | 431 | | |||
432 | if (showDeleteAction && showMoveToTrashAction) { | 432 | if (showDeleteAction && showMoveToTrashAction) { | ||
433 | delete m_removeAction; | 433 | delete m_removeAction; | ||
434 | m_removeAction = 0; | 434 | m_removeAction = 0; | ||
435 | editActions.append(actionCollection()->action(QStringLiteral("move_to_trash"))); | 435 | editActions.append(actionCollection()->action(KStandardAction::name(KStandardAction::MoveToTrash))); | ||
436 | editActions.append(actionCollection()->action(KStandardAction::name(KStandardAction::DeleteFile))); | 436 | editActions.append(actionCollection()->action(KStandardAction::name(KStandardAction::DeleteFile))); | ||
437 | } else if (showDeleteAction && !showMoveToTrashAction) { | 437 | } else if (showDeleteAction && !showMoveToTrashAction) { | ||
438 | editActions.append(actionCollection()->action(KStandardAction::name(KStandardAction::DeleteFile))); | 438 | editActions.append(actionCollection()->action(KStandardAction::name(KStandardAction::DeleteFile))); | ||
439 | } else { | 439 | } else { | ||
440 | if (!m_removeAction) | 440 | if (!m_removeAction) | ||
441 | m_removeAction = new DolphinRemoveAction(this, actionCollection()); | 441 | m_removeAction = new DolphinRemoveAction(this, actionCollection()); | ||
442 | editActions.append(m_removeAction); | 442 | editActions.append(m_removeAction); | ||
443 | m_removeAction->update(); | 443 | m_removeAction->update(); | ||
▲ Show 20 Lines • Show All 172 Lines • Show Last 20 Lines |