X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/f4e6647cdc652a550b61a0b9c075b93e935197d9..3d75a64e6ea4958e896f2dc7d2376bdf96de983f:/src/dolphinview.cpp diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 0cf740cd5..467f4ece4 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -1103,8 +1104,8 @@ void DolphinView::paste() const KUrl::List sourceUrls = KUrl::List::fromMimeData(mimeData); - // per default the pasting is done into the current Url of the view - KUrl destUrl(url()); + // per default the pasting is done into the current URL of the view + KUrl destUrl = url(); // check whether the pasting should be done into a selected directory const KUrl::List selectedUrls = this->selectedUrls(); @@ -1117,6 +1118,17 @@ void DolphinView::paste() // only one item is selected which is a directory, hence paste // into this directory destUrl = selectedUrls.first(); + if (sourceUrls.contains(destUrl)) { + const QString text = i18nc("@info", "The folder %1 is pasted into itself. Is this intended?", fileItem.name()); + int result = KMessageBox::questionYesNo(window(), + text, + i18nc("@title:window", "Paste into Folder"), + KGuiItem(i18nc("@label", "Paste"), "dialog-ok"), + KGuiItem(i18nc("@label", "Cancel"), "dialog-cancel")); + if (result == KMessageBox::No) { + return; + } + } } }