From e0d9ef46423191893712a829d4961ad514a63b163bb0767f050c75247c4e70e3 Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Sun, 14 Jan 2018 17:50:45 +0000 Subject: [PATCH] Accepting request 563997 from home:wolfi323:branches:KDE:Extra - Add Panel-fixed-actions-in-PanelContextMenu-ignored.patch to fix the "Create New" context menu not working when the '..' entry is selected (boo#1075690, kde#383544) OBS-URL: https://build.opensuse.org/request/show/563997 OBS-URL: https://build.opensuse.org/package/show/KDE:Extra/krusader?expand=0&rev=27 --- ...-actions-in-PanelContextMenu-ignored.patch | 115 ++++++++++++++++++ krusader.changes | 7 ++ krusader.spec | 3 + 3 files changed, 125 insertions(+) create mode 100644 Panel-fixed-actions-in-PanelContextMenu-ignored.patch diff --git a/Panel-fixed-actions-in-PanelContextMenu-ignored.patch b/Panel-fixed-actions-in-PanelContextMenu-ignored.patch new file mode 100644 index 0000000..ec295be --- /dev/null +++ b/Panel-fixed-actions-in-PanelContextMenu-ignored.patch @@ -0,0 +1,115 @@ +From 3ec61a42eaf842a4ceec11aed5cf6c6154f7cd07 Mon Sep 17 00:00:00 2001 +From: Alexander Bikadorov +Date: Sun, 20 Aug 2017 21:20:28 +0200 +Subject: Panel: fixed actions in PanelContextMenu ignored if ".." is current + +FIXED: [ 383544 ] Unable to create new folder/file if '..' item is selected in current folder +BUG: 383544 +--- + krusader/Panel/krpopupmenu.cpp | 38 +++++++++++++++++-------------------- + 1 file changed, 17 insertions(+), 21 deletions(-) + +diff --git a/krusader/Panel/panelcontextmenu.cpp b/krusader/Panel/panelcontextmenu.cpp +index 22f05bb..241d996 100644 +--- a/krusader/Panel/krpopupmenu.cpp ++++ b/krusader/Panel/krpopupmenu.cpp +@@ -320,24 +320,21 @@ void KrPopupMenu::addCreateNewMenu() + + void KrPopupMenu::performAction(int id) + { +- if (_items.isEmpty()) +- return; // sanity check, empty file list +- +- KFileItem *item = &_items.first(); ++ const QUrl singleURL = _items.isEmpty() ? QUrl() : _items.first().url(); + + switch (id) { + case - 1 : // the user clicked outside of the menu + return ; + case OPEN_TAB_ID : + // assuming only 1 file is selected (otherwise we won't get here) +- panel->manager()->newTab(item->url(), panel); ++ panel->manager()->newTab(singleURL, panel); + break; + case OPEN_ID : + foreach(const KFileItem &fi, _items) + panel->func->execute(fi.name()); + break; + case BROWSE_ID : +- panel->func->goInside(item->url().fileName()); ++ panel->func->goInside(singleURL.fileName()); + break; + case COPY_ID : + panel->func->copyFiles(); +@@ -355,7 +352,7 @@ void KrPopupMenu::performAction(int id) + panel->func->deleteFiles(false); + break; + case EJECT_ID : +- krMtMan.eject(item->url().adjusted(QUrl::StripTrailingSlash).path()); ++ krMtMan.eject(singleURL.adjusted(QUrl::StripTrailingSlash).path()); + break; + /* case SHRED_ID : + if ( KMessageBox::warningContinueCancel( krApp, +@@ -364,13 +361,13 @@ void PanelContextMenu::performAction(int id) + KShred::shred( panel->func->files() ->getFile( item->name() ).adjusted(QUrl::RemoveTrailingSlash).path() ); + break;*/ + case OPEN_KONQ_ID : +- KToolInvocation::startServiceByDesktopName("konqueror", item->url().toDisplayString(QUrl::PreferLocalFile)); ++ KToolInvocation::startServiceByDesktopName("konqueror", singleURL.toDisplayString(QUrl::PreferLocalFile)); + break; + case CHOOSE_ID : // open-with dialog + panel->func->displayOpenWithDialog(_items.urlList()); + break; + case MOUNT_ID : +- krMtMan.mount(item->url().adjusted(QUrl::StripTrailingSlash).path()); ++ krMtMan.mount(singleURL.adjusted(QUrl::StripTrailingSlash).path()); + break; + case NEW_LINK_ID : + panel->func->krlink(false); +@@ -388,7 +385,7 @@ void PanelContextMenu::performAction(int id) + KrTrashHandler::restoreTrashedFiles(_items.urlList()); + break; + case UNMOUNT_ID : +- krMtMan.unmount(item->url().adjusted(QUrl::StripTrailingSlash).path()); ++ krMtMan.unmount(singleURL.adjusted(QUrl::StripTrailingSlash).path()); + break; + case COPY_CLIP_ID : + panel->func->copyToClipboard(); +@@ -412,16 +409,15 @@ void KrPopupMenu::performAction(int id) + #ifdef SYNCHRONIZER_ENABLED + case SYNC_SELECTED_ID : { + QStringList selectedNames; +- foreach(const KFileItem &item, _items) +- selectedNames << item.name(); +- if (panel->otherPanel()->view->numSelected()) { +- KrViewItemList otherItems; +- panel->otherPanel()->view->getSelectedKrViewItems(&otherItems); +- +- for (KrViewItemList::Iterator it2 = otherItems.begin(); it2 != otherItems.end(); ++it2) { +- QString name = (*it2) ->name(); +- if (!selectedNames.contains(name)) +- selectedNames.append(name); ++ for (const KFileItem item : _items) { ++ selectedNames.append(item.name()); ++ } ++ KrViewItemList otherItems; ++ panel->otherPanel()->view->getSelectedKrViewItems(&otherItems); ++ for (KrViewItem *otherItem : otherItems) { ++ const QString name = otherItem->name(); ++ if (!selectedNames.contains(name)) { ++ selectedNames.append(name); + } + } + SLOTS->slotSynchronizeDirs(selectedNames); +@@ -429,7 +425,7 @@ void KrPopupMenu::performAction(int id) + break; + #endif + case OPEN_TERM_ID : +- SLOTS->runTerminal(item->url().path()); ++ SLOTS->runTerminal(singleURL.path()); + break; + } + +-- +cgit v0.11.2 + diff --git a/krusader.changes b/krusader.changes index 063071e..41188f0 100644 --- a/krusader.changes +++ b/krusader.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Jan 12 18:30:27 UTC 2018 - wbauer@tmo.at + +- Add Panel-fixed-actions-in-PanelContextMenu-ignored.patch to fix + the "Create New" context menu not working when the '..' entry is + selected (boo#1075690, kde#383544) + ------------------------------------------------------------------- Mon May 15 19:54:35 UTC 2017 - wbauer@tmo.at diff --git a/krusader.spec b/krusader.spec index 00e8c5f..24fb753 100644 --- a/krusader.spec +++ b/krusader.spec @@ -28,6 +28,8 @@ Source1: krusader_browse_iso.desktop Source2: org.kde.krusader.root-mode.desktop # PATCH-FIX-UPSTREAM Patch: fix-build-with-gcc48.patch +# PATCH-FIX-UPSTREAM +Patch1: Panel-fixed-actions-in-PanelContextMenu-ignored.patch BuildRequires: extra-cmake-modules >= 1.7.0 BuildRequires: fdupes BuildRequires: libacl-devel @@ -87,6 +89,7 @@ An advanced twin panel (commander style) file manager for KDE. %prep %setup -q -n %{name}-%{version} %patch -p1 +%patch1 -p1 %build export RPM_OPT_FLAGS="%{optflags} -fpermissive"