Commit graph

221 commits

Author SHA1 Message Date
David Hallas f186124f0e Fixes small memory leak in DolphinContextMenu
Summary: When DolphinContextMenu::baseFileItem is called a KFileItem is allocated and stored in DolphinContextMenu::m_baseFileItem, which is of type KFileItem*, but the destructor failed to delete this.

Test Plan: This leak was found using Address Sanitizer

Reviewers: broulik, elvisangelaccio

Reviewed By: broulik, elvisangelaccio

Subscribers: ngraham, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D14178
2018-07-18 16:48:07 -06:00
Nerdopolis Turfwalker 97801e2cdb Add 'Sort By' and 'View Mode' into Dolphin file context menus
Summary: This adds the 'Sort By' and 'View Mode'  options into the context menu of Dolphin within the file browser. I keep looking for these option (especially sort by) in the Context Menu, and keep forgetting to go to the menu. It also makes the order of "View Mode" and "Sort By" options consistent in the control menu

Test Plan: Made sure that the options appeared when right clicking on an empty space.

Reviewers: #dolphin, ngraham, elvisangelaccio

Reviewed By: #dolphin, ngraham, elvisangelaccio

Subscribers: question, markg, elvisangelaccio, mmustac, rkflx, ngraham, kfm-devel, #dolphin

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D12911
2018-06-02 16:39:42 +02:00
Elvis Angelaccio eb116a741e Bring back 'New Window' action in viewport context menu
This fixes a regression introduced by ec12391a1b.

We don't use anymore the custom `new_window` action, but we use the
standard `file_new` action instead.
2018-05-20 23:24:43 +02:00
Nathaniel Graham 56e8e77e68 Re-add "Open With" items to context menu for files in search view 2018-05-14 16:51:11 -06:00
Nathaniel Graham b9143a55a7 Move "Open" actions to the top of the context menu for files
Summary:
This patch moves the "Open", "Open With", and "Open in" items to the top of the context menu to reap the following benefits:
- Move the "Open" and "Open With" items closer to the top since they're commonly used items, and right now they're buried in the middle of the menu
- Group related functionality
- Consistency with other common platforms (macOS Finder and Windows Explorer both have these items at the top of the context menu)

For folders, the "Open With" entries are moved higher, but not all the way to the top, since the "open in New tab/folder" entries are more useful.

Test Plan:
Tested all menu items in the context menu for files, folders, and links; all still work.

Context menu for single file:
{F5806809}

Context menu for multiple files:
{F5806810}

Context menu for single folder:
{F5806811}

Context menu for multiple folders:
{F5806812}

Context menu for symlink to folder:
{F5806815}

Reviewers: #dolphin, #vdg, elvisangelaccio, abetts

Reviewed By: #dolphin, #vdg, elvisangelaccio, abetts

Subscribers: markg, abetts, elvisangelaccio

Differential Revision: https://phabricator.kde.org/D11884
2018-04-22 09:40:50 -06:00
Nathaniel Graham 49e0315584 Merge branch 'Applications/18.04' 2018-03-22 06:52:46 -06:00
Nathaniel Graham f728d72864 Fix missing entries in context menu for links
Summary: https://cgit.kde.org/dolphin.git/commit/?id=86f4fcb8cd574f6d886627fc5e01c9edfc84e977 introduced a regression: the context menu for links no longer shows various items that were gated behind being a directory. However, a link can be both a link and a directory, from KIO's perspective. This patch resolves the issue.

Test Plan:
- Context menus for files, folders, and file links are unchanged.
- The missing context menu items for folder links have returned: {F5761809}

I should have tested that patch better, and for that I apologize and offer to fix this regression here. I will endeavor to up my reviewing game.

Reviewers: rominf, michaelh, #dolphin, rkflx

Reviewed By: rominf, rkflx

Subscribers: rkflx

Differential Revision: https://phabricator.kde.org/D11562
2018-03-22 06:52:11 -06:00
Kai Uwe Broulik b2ff54be3b [DolphinContextMenu] Fix excluding ourself from Open With menu
The desktop file name changed to org.kde.dolphin a long time ago. To avoid this breaking again, just use qApp->desktopFileName()

BUG: 391997

Differential Revision: https://phabricator.kde.org/D11540
2018-03-21 15:53:59 +01:00
Roman Inflianskas 6f05c66cc0 Add "Show Target" into symlink context menu and file menu
Summary:
Add "Show Target" into symlink context menu and file menu

FEATURE: 215069

Reviewers: ngraham, elvisangelaccio

Reviewed By: ngraham, elvisangelaccio

Subscribers: rkflx, ngraham, elvisangelaccio, markg, #dolphin

Differential Revision: https://phabricator.kde.org/D10990
2018-03-18 15:08:36 +03:00
Roman Inflianskas 86f4fcb8cd Add "Open symlink destination folder" into symlink's context menu
Summary:
This is not complete. I'm wondering about "Open symlink destination folder in new tab/window".

Feature wants also "Copy symlink destination". I dislike this, because then it's good to have "Cut symlink destination" and that's too much.

FEATURE: 215069

Reviewers: #dolphin, ngraham

Reviewed By: #dolphin, ngraham

Subscribers: rkflx, ngraham, elvisangelaccio, markg, #dolphin

Differential Revision: https://phabricator.kde.org/D10990
2018-03-14 22:02:30 +03:00
Roman Inflianskas f16fbcba4e Add Trash (empty, isEmpty, emptinessChanged)
Summary: Add `Trash` class to handle all trash operations.

Reviewers: elvisangelaccio, markg, ngraham

Reviewed By: elvisangelaccio, markg, ngraham

Subscribers: ngraham, markg, rkflx, elvisangelaccio, #dolphin

Differential Revision: https://phabricator.kde.org/D11012
2018-03-11 17:32:33 +03:00
Roman Inflianskas 0c9343d614 Fix some compile warnings
Reviewers: markg, elvisangelaccio

Reviewed By: markg, elvisangelaccio

Subscribers: chehrlic, rkflx, elvisangelaccio, #dolphin

Differential Revision: https://phabricator.kde.org/D10995
2018-03-10 18:07:47 +03:00
Elvis Angelaccio 2523442d4d Revert "Fix some compile warnings"
This reverts commit 533f050855.

D10995 has not been approved.
2018-03-05 21:56:15 +01:00
Roman Inflianskas 48b58f830a Remove unused #include
Summary: I used CLion inspection to hunt all unused #include

Reviewers: #dolphin, elvisangelaccio, markg

Reviewed By: #dolphin, elvisangelaccio, markg

Subscribers: bcooksley, markg, elvisangelaccio, #dolphin

Differential Revision: https://phabricator.kde.org/D10985
2018-03-04 21:00:47 +03:00
Roman Inflianskas 533f050855 Fix some compile warnings
Reviewers: #dolphin, markg

Reviewed By: markg

Subscribers: elvisangelaccio, #dolphin

Differential Revision: https://phabricator.kde.org/D10995
2018-03-04 10:27:31 +03:00
Renato Araujo Oliveira Filho da6f8fe086 Use Kio::KPlacesModel as source model for PlacesItemModel
Summary:
Use Kio::KPlacesModel as source model for PlacesItemModel avoiding
duplicated code.

Depends on D8862
Depends on D8332
Depends on D8434
Depends on D8348
Depends on D8630

Test Plan: Unit test created

Reviewers: elvisangelaccio, emmanuelp, mlaurent, mwolff

Reviewed By: elvisangelaccio, mlaurent, mwolff

Subscribers: mwolff, mlaurent, anthonyfieroni, nicolasfella, ngraham, #dolphin

Differential Revision: https://phabricator.kde.org/D8855
2017-12-14 09:40:34 -03:00
Kevin Funk a6db5029ac Modernize: Use nullptr everywhere 2017-11-21 10:53:12 +01:00
Montel Laurent ff3f476ed8 Use nullptr + add explicit keyword
Test Plan: compile

Reviewers: #dolphin, broulik

Reviewed By: broulik

Subscribers: #dolphin

Differential Revision: https://phabricator.kde.org/D8637
2017-11-03 14:54:06 +01:00
Nathaniel Graham 64cfc43b97 Make Saved Search feature discoverable
Summary:
FEATURE: 269332

Make Dolphin's Saved Search feature discoverable by adding a button inside the search field. The button only becomes enabled when there is a valid search term. When pushed, it saves the search to the Places panel, providing a visible-by-default way to do this to complement the existing implementation that is only visible in the context menu.

Also harmonized the label text so that it's consistent no matter how you create a saved search (button or context menu)

Test Plan:
Tested in KDE Neon. Works great:
{F5449508}

Reviewers: #dolphin, broulik, dfaure, markg, emateli, elvisangelaccio

Reviewed By: #dolphin, markg, emateli, elvisangelaccio

Subscribers: anthonyfieroni, markg, emateli, elvisangelaccio, cfeck, #dolphin

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D8454
2017-11-01 09:00:48 -06:00
Elvis Angelaccio 2fd85facf8 Fix DolphinRemoveAction Shift toggling on Wayland
QGuiApplication::queryKeyboardModifiers() does not work on Wayland [1].
We don't need it in the first place, since we already know (thanks to
the key events) whether Shift has been pressed or released.
So we can just pass this information to DolphinRemoveAction::update().

BUG: 354301

[1]: https://bugreports.qt.io/browse/QTBUG-62786

Differential Revision: https://phabricator.kde.org/D7519
2017-09-07 21:31:42 +02:00
Elvis Angelaccio 5481709016 Port to KStandardAction::RenameFile
It was introduced in kconfig(widgets) 5.25. Using the standard action
results in less code and no need to hardcode the F2 shortcut.

Differential Revision: https://phabricator.kde.org/D6777
2017-08-09 22:59:38 +02:00
Elvis Angelaccio 4b5ea05b67 Port to KStandardAction::MoveToTrash
It was introduced in kconfig(widgets) 5.25. Using the standard action
results in less code and no need to hardcode the Del shortcut.

Test Plan:
- Change shortcut in System Settings -> Shortcuts -> Standard Shortcuts
- Make sure the new shortcut is used by dolphin.

Differential Revision: https://phabricator.kde.org/D6778
2017-07-27 16:15:03 +02:00
Elvis Angelaccio a2f9e005a5 Drop unnecessary method 2017-06-06 19:16:34 +02:00
Elvis Angelaccio 68bb0ec22a Port to KStandardAction::DeleteFile
Summary:
It was introduced in kconfig 5.25 and it properly handles the shift+del
shortcut (together with kxmlgui >= 5.30). This allows us to drop the
custom delete shortcut as well as the shift+del workaround in
DolphinMainWindow.

Test Plan: Shift+Del still deletes files, without the 'ambiguous shortcut' warning dialog.

Reviewers: emmanuelp

Differential Revision: https://phabricator.kde.org/D5010
2017-03-13 19:40:07 +01:00
Elvis Angelaccio 5f484d8ee8 Drop another obsolete version check
We now require Frameworks >= 5.30
2017-02-05 23:39:04 +01:00
Elvis Angelaccio 1be2704214 Port away from deprecated KIO::Job::ui()
It's equivalent to KJob::uiDelegate() from kcoreaddons.
2017-01-18 23:45:39 +01:00
Kai Uwe Broulik 996f8520e7 Explicitly pass iconNameForUrl when creating new places entry
Once KIO::iconNameForUrl returns special icons for standard paths (e.g. Video folder)
this will ensure when adding such a folder to places it will automatically get the proper icon.

Since KIO already depends on KBookmarks it can't depend the other way round, otherwise
this would have been fixed in KBookmarks directly.

Differential Revision: https://phabricator.kde.org/D3896
2017-01-03 09:46:43 +01:00
David Faure f54174f9f6 Popupmenu: use KIO 5.27's new addPluginActionsTo method
REVIEW: 129085
2016-10-02 22:28:03 +02:00
Elvis Angelaccio e93e6d4cc5 Don't load twice kfileitemaction plugins with json metadata 2016-09-10 21:59:16 +02:00
Elvis Angelaccio abaf20f114 Fix logic for loading kfileitemaction plugins
Since dolphin is now loading also plugins with json metadata, it is
wrong to return here, as those plugins could be missed.
2016-09-10 21:55:32 +02:00
Elvis Angelaccio 809ba74695 Filter json-only KFileItemAction plugins by mimetype
Commit d48b733 introduced support for kfileitemaction plugins with json
metadata, but forgot to filter them by the commonMimeType (like
KMimeTypeTrader::query() does with old-style plugins).

So we need to load a plugin only when commonMimeType is equal to (or child of) one
of the mimetypes supported by the plugin.
2016-08-23 18:06:40 +02:00
Elvis Angelaccio 6bb62f17b5 Look for kfileitemaction plugins in the expected subfolder
For a rationale, see https://git.reviewboard.kde.org/r/128225/
2016-06-18 17:47:07 +02:00
Elvis Angelaccio d48b733492 Load KFileItemAction plugins with json metadata
REVIEW: 128088
2016-06-08 15:30:52 +02:00
Artur Puzio 5593c252e8 [CLAZY] Fixed all level 1 and level 2 warnings with small exceptions
REVIEW: 126771
2016-03-16 22:17:37 +01:00
Frank Reininghaus d094c8ffe6 DolphinContextMenu: Do not check if the clicked folder is in the Places
This prevents that the setup of the PlacesItemModel queries Solid for
the available devices, which can take some time.

Places can be added multiple times now using the context menu, but this
has always been possible with drag and drop anyway.

See https://forum.kde.org/viewtopic.php?f=223&t=130617 for a dicsussion
on this topic.

REVIEW: 126904
2016-02-10 22:36:01 +01:00
Emmanuel Pescosta fba5dd58a5 Save bookmarks when adding them via the context menu.
CCBUG: 345347
REVIEW: 123080
2015-03-21 17:39:20 +01:00
Emmanuel Pescosta 50c0aa3b07 Port KonqCopyToMenu to KFileCopyToMenu 2015-02-04 08:56:17 +01:00
Emmanuel Pescosta ee879cf353 use addActions instead of doing addAction in a loop 2015-01-28 15:25:09 +01:00
David Faure 2a561317c6 Remove unused libkonq includes 2014-12-25 10:16:12 +01:00
Emmanuel Pescosta 192f00e32f get rid of KFileItemActionPlugin 2014-12-14 18:39:08 +01:00
Emmanuel Pescosta a07d63d419 port away from deprecated KFileItem(mode_t mode, mode_t permissions, const QUrl &url, bool delayedMimeTypes = false); 2014-12-14 17:46:58 +01:00
David Faure 3e14a97a0f Many cleanups in KonqOperations 2014-11-02 17:03:18 +01:00
David Faure 9bf03a3c48 Dolphin: port to KIO::pasteInfoText().
DolphinContextMenu::createPasteAction used to be precise about destination
("Paste To Folder"), while now it's precise about the source (what to paste).
It was decided that this was more useful and consistent anyway.

REVIEW: 120695
2014-10-21 21:59:05 +02:00
Lukáš Tinkl 0ce1c983b5 port away from KMimeType 2014-10-21 21:37:30 +02:00
Lukáš Tinkl 1b4572dac9 port Dolphin from KUrl to QUrl
REVIEW: 120688
2014-10-21 21:19:14 +02:00
Montel Laurent 0a6257bce3 Fix includes 2014-10-18 15:00:17 +02:00
Montel Laurent 31a0c4fbd5 Fix includes 2014-10-18 14:42:41 +02:00
Montel Laurent 6f6b1bbb69 Clean includes + port to QMenu 2014-10-10 23:36:36 +02:00
Montel Laurent 5c1420fec9 kdelibs4support-- 2014-10-07 07:38:16 +02:00
Emmanuel Pescosta 6a09781a3b Ported Dolphin away from KStandardDirs
removed unused mirroredDirectory method

REVIEW: 120194
2014-10-01 12:34:49 +02:00