Dominique Leuenberger 2018-01-16 08:42:47 +00:00 committed by Git OBS Bridge
commit b0e31c0591
3 changed files with 125 additions and 0 deletions

View File

@ -0,0 +1,115 @@
From 3ec61a42eaf842a4ceec11aed5cf6c6154f7cd07 Mon Sep 17 00:00:00 2001
From: Alexander Bikadorov <alex.bikadorov@kdemail.net>
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

View File

@ -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

View File

@ -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"