File Enable-Open-With-action-for-read-only-archives-as-well.patch of Package ark4
From 28d44faf110b236e8bc027abb2a6e79cf0556a47 Mon Sep 17 00:00:00 2001
From: Wolfgang Bauer <wbauer@tmo.at>
Date: Tue, 5 Oct 2021 17:08:42 +0200
Subject: [PATCH] Enable "Open With..." action for read-only archives as well
Like "Preview", this should be possible as well, as it doesn't modify
the archive.
This now uses the same condition as for the "Preview" action,
which also has these consequences:
- it's disabled for directories now, where it doesn't work anyway
- it's also disabled when more than one entry is selected, it only
opened the first one previously
This was actually fixed in commit f1cf10f2 in Ark 15.12, when the
"Open File" action was added.
---
part/part.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/part/part.cpp b/part/part.cpp
index 87afb49b..03eae2bb 100644
--- a/part/part.cpp
+++ b/part/part.cpp
@@ -303,8 +303,8 @@ void Part::updateActions()
m_addDirAction->setEnabled(!isBusy() && isWritable);
m_deleteFilesAction->setEnabled(!isBusy() && (m_view->selectionModel()->selectedRows().count() > 0)
&& isWritable);
- m_previewChooseAppAction->setEnabled(!isBusy() && (m_view->selectionModel()->selectedRows().count() > 0)
- && isWritable);
+ m_previewChooseAppAction->setEnabled(!isBusy() && (m_view->selectionModel()->selectedRows().count() == 1)
+ && isPreviewable(m_view->selectionModel()->currentIndex()));
QMenu *menu = m_extractFilesAction->menu();
if (!menu) {
--
2.31.1