Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
System
Dolphin
Commits
c2a7bde3
Commit
c2a7bde3
authored
Nov 30, 2020
by
Méven Car
Browse files
Re-allow to paste files via context menu
BUG: 429762
parent
81c9422d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/dolphincontextmenu.cpp
View file @
c2a7bde3
...
...
@@ -433,23 +433,23 @@ QAction* DolphinContextMenu::createPasteAction()
{
QAction
*
action
=
nullptr
;
KFileItem
destItem
;
if
(
!
m_fileInfo
.
isNull
())
{
if
(
!
m_fileInfo
.
isNull
()
&&
m_selectedItems
.
count
()
<=
1
)
{
destItem
=
m_fileInfo
;
}
else
{
destItem
=
baseFileItem
();
}
if
(
!
destItem
.
isNull
()
&&
destItem
.
isDir
())
{
if
(
m_selectedItems
.
count
()
<=
1
)
{
const
QMimeData
*
mimeData
=
QApplication
::
clipboard
()
->
mimeData
();
bool
canPaste
;
const
QString
text
=
KIO
::
pasteActionText
(
mimeData
,
&
canPaste
,
destItem
);
action
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-paste"
)),
text
,
this
);
if
(
canPaste
)
{
const
QMimeData
*
mimeData
=
QApplication
::
clipboard
()
->
mimeData
();
bool
canPaste
;
const
QString
text
=
KIO
::
pasteActionText
(
mimeData
,
&
canPaste
,
destItem
);
if
(
canPaste
)
{
if
(
destItem
==
m_fileInfo
)
{
// if paste destination is a selected folder
action
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-paste"
)),
text
,
this
);
connect
(
action
,
&
QAction
::
triggered
,
m_mainWindow
,
&
DolphinMainWindow
::
pasteIntoFolder
);
}
else
{
// don't add the unavailable action
action
=
nullptr
;
action
=
m_mainWindow
->
actionCollection
()
->
action
(
KStandardAction
::
name
(
KStandardAction
::
Paste
));
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment