Commit graph

198 commits

Author SHA1 Message Date
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
Kai Uwe Broulik 42153e55e6 Add "Open Path" context menu action
This adds a third option to the "in new tab" and "in new window" which opens
the parent folder in the same view

BUG: 298704
FIXED-IN: 4.15
REVIEW: 110133
2014-09-09 15:31:55 +02:00
David Faure e44ddfa5ab Remove KonqOperations::emptyTrash() and port to KIO::emptyTrash() instead. 2014-08-21 22:01:23 +02:00
David Faure 5a6ac1b5f7 Port from KonqOperations::restoreTrashedItems to KIO::restoreFromTrash. 2014-08-19 22:31:50 +02:00
David Faure 3e5ff13f92 Port from KonqMimeData to KIO::isClipboardDataCut/setClipboardDataCut 2014-08-13 18:27:09 +02:00
Christophe Giboudeaux a769261131 Remove the automoc noise 2014-06-29 10:36:32 +02:00
Frank Reininghaus 6bccf73e92 Merge remote-tracking branch 'origin/master' into frameworks
Conflicts:
	dolphin/src/dolphincontextmenu.cpp
	dolphin/src/panels/folders/treeviewcontextmenu.cpp
2014-06-12 08:51:50 +02:00
Frank Reininghaus 9dc1513f8b Do not crash if QApplication::clipboard()->mimeData() is a null pointer
This removes the remaining unchecked accesses to the clipboard mime
data after commit 7828b057da. According
to a bug report, it can be a null pointer on Wayland.

BUG: 335053
REVIEW: 118649
2014-06-12 08:37:11 +02:00
Alex Richardson 8611c990f0 KIcon -> QIcon and KMimeType::iconNameForUrl() -> KIO::iconNameForUrl() 2014-05-05 23:05:34 +02:00
Alex Richardson 00ee5d6727 dolphin: convert the remaining code to Qt5 signal/slot syntax
Middle clicking on Forward/Backward/Home/etc. will no longer open a new
tab since the QAction triggered signal no longer tell us which mouse
button was pressed
2014-05-05 23:05:34 +02:00
Alex Richardson 2f045c6010 Allow compiling Dolphin with KF5
This does not work properly yet, there are probably quite a few bad signal/
slot connections due to KUrl -> QUrl. However dolphin starts without
crashing.

Accessibility is not ported since that changed quite a lot from Qt4 -> Qt5
and I have no idea how it is supposed to be used.

This is the first commit for review 117395
2014-05-05 23:05:13 +02:00
Frank Reininghaus 32264f5546 Make the "Create New..." menu in the "item context menu" work again
Since https://git.reviewboard.kde.org/r/111989/, the "Create New..."
menu in the context menu that appears when right-clicking a folder was
not a child of the DolphinMainWindow any more, but of the context menu
itself. This is the reason why the dialog that asks for a file name
when choosing one of the "Create New..." options disappeared
immediately.

This patch makes sure that the main window is the parent of the
"Create New..." menu again.

BUG: 327783
REVIEW: 113930
2013-11-21 00:41:33 +01:00
Emmanuel Pescosta a4ef4bbfde Replaced all KNewFileMenu usages in DolphinPart by DolphinNewFileMenu.
Removed all signal-slot-connections related to DolphinNewFileMenu->errorMessage(QString)
in DolphinMainWindow and DolphinContextMenu and replaced it by a better solution.

Now we make use of the already existing DolphinNewFileMenuObserver singleton class to achieve a better
error handling, because every newly created DolphinContextMenu instance registers himself by DolphinNewFileMenuObserver
and we use this to connect the errorMessage(QString) signal of every DolphinContextMenu instance to the errorMessage(QString)
signal of the DolphinNewFileMenuObserver singleton class.

So we need only one connection from DolphinNewFileMenuObserver to DolphinMainWindow (or to DolphinPart) to
collect all error messages thrown by every DolphinNewFileMenu instance.

REVIEW: 112178
2013-08-28 18:46:45 +02:00
Emmanuel Pescosta 804e83f893 Cut the ropes between DolphinMainWindow and DolphinNewFileMenu. Error handling is now done via signals.
REVIEW: 111989
2013-08-16 20:22:33 +02:00
Dawit Alemayehu d72f5d2db7 Do not show "Move To Trash" action in context menu for remote URLs.
BUG: 261762
REVIEW: 111206
FIXED-IN: 4.11
2013-06-24 22:41:53 -04:00
Sune Vuorela 7a7cfa6add Revert "Hide context menu plugins unless enabled by default or by the user"
This reverts commit b1aebb44d6.

As agreed with Frank on k-c-d.
2013-06-21 10:37:52 +02:00
Emmanuel Pescosta 616294bc80 Bug 196035 - middle clicking on archive files in dolphin does not open them in a new tab
When 'browse through archives' is enabled, open archive files
like folders on middle clicking, context menu -> new tab action
and context menu -> new window action.

BUG: 196035
REVIEW: 110487
2013-06-04 15:27:45 +02:00
Frank Reininghaus ae415dcebd Hide context menu plugins unless enabled by default or by the user
REVIEW: 110685
2013-05-29 07:48:11 +02:00
Emmanuel Pescosta 45c659b440 Added the "Open in new Tabs" action to the Dolphin Context menu.
BUG: 312296
REVIEW: 110371
FIXED-IN: 4.11.0
2013-05-22 21:47:14 +02:00
Dawit Alemayehu 01761798a9 - Factored out the Delete/Move To Trash action into own class.
- Updated both the Dolphin KPart and context menu to use the new
  DolphinRemoveAction class to manage "Delete/Move to Trash" actions.

See also https://git.reviewboard.kde.org/r/107509/.

REVIEW: 108802
2013-05-14 08:37:21 -04:00
David Faure 57e65aab7f Reimplement handling of Shift while showing menu without KModifierKeyInfo
Finding out whether shift is pressed initially can be done
with qApp->keyboardModifiers(), and finding out that the user is pressing
or release shift can be done with keyPressEvent/keyReleaseEvent.

This required to inherit from KMenu rather than having the KMenu
as a member.

KModifierKeyInfo is only implemented on X11, so this makes the code
more portable. If similar solutions can be found for other users of
KModifierKeyInfo, it will be deprecated in KF5.

REVIEW: 110303
2013-05-05 22:42:49 +02:00
Frank Reininghaus d1963d2271 Use the right name when adding a folder to Places with the context menu
Without this patch, the name of the parent folder was used for the entry
in the Places Panel. Will backport to the KDE/4.9 branch when the RC2
freeze is over.

Thanks to Daniel Kreuter for the patch!

CCBUG: 303157
2012-07-10 08:23:14 +02:00
Peter Penz a2674f5184 Provide a default name when adding a search query to the places panel
BUG: 300430
FIXED-IN: 4.9.0
2012-06-02 15:47:17 +02:00
Peter Penz 12215d6f0f Use PlacesItemModel instead of KFilePlacesModel
This allows inserting items to the corresponding group.
2012-06-02 15:03:22 +02:00