summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2017-08-21 19:21:22 +0200
committerElvis Angelaccio <[email protected]>2017-08-21 19:21:22 +0200
commitbcc1ca6c94b48c6855dec3310651b3f03ef51be4 (patch)
treefdcc203b9b17da690c0ac14d887f804bb031e780
parent678c95e2b7193e20c66e3515857aacc6b338e219 (diff)
Port to KStandardAction::Find
Less code, no need to use the custom `find_in_archive` action name.
-rw-r--r--part/ark_part.rc6
-rw-r--r--part/part.cpp7
2 files changed, 4 insertions, 9 deletions
diff --git a/part/ark_part.rc b/part/ark_part.rc
index d051ef4..d161302 100644
--- a/part/ark_part.rc
+++ b/part/ark_part.rc
@@ -1,5 +1,5 @@
<!DOCTYPE gui SYSTEM "kpartgui.dtd">
-<gui name="ark_part" version="22" translationDomain="ark">
+<gui name="ark_part" version="23" translationDomain="ark">
<MenuBar>
<Menu name="archive">
<text>&amp;Archive</text>
@@ -7,7 +7,7 @@
<Action name="add" group="archive_edit"/>
<Action name="edit_comment" group="archive_edit"/>
<Action name="extract_all" group="archive_extract"/>
- <Action name="find_in_archive" group="archive_props"/>
+ <Action name="edit_find" group="archive_props"/>
<Action name="test_archive" group="archive_props"/>
<Action name="properties" group="archive_props"/>
</Menu>
@@ -35,7 +35,7 @@
<Action name="extract"/>
<Action name="preview"/>
<Action name="openfile"/>
- <Action name="find_in_archive"/>
+ <Action name="edit_find"/>
<Separator/>
<Action name="add"/>
<Action name="deletefile"/>
diff --git a/part/part.cpp b/part/part.cpp
index d6875ed..f8ae9c0 100644
--- a/part/part.cpp
+++ b/part/part.cpp
@@ -436,12 +436,7 @@ void Part::setupActions()
m_testArchiveAction->setToolTip(i18nc("@info:tooltip", "Click to test the archive for integrity"));
connect(m_testArchiveAction, &QAction::triggered, this, &Part::slotTestArchive);
- m_searchAction = actionCollection()->addAction(QStringLiteral("find_in_archive"));
- m_searchAction->setIcon(QIcon::fromTheme(QStringLiteral("search")));
- m_searchAction->setText(i18nc("@action:inmenu", "&Find Files"));
- actionCollection()->setDefaultShortcut(m_searchAction, Qt::CTRL + Qt::Key_F);
- m_searchAction->setToolTip(i18nc("@info:tooltip", "Click to search in archive"));
- connect(m_searchAction, &QAction::triggered, this, &Part::slotShowFind);
+ m_searchAction = KStandardAction::find(this, &Part::slotShowFind, actionCollection());
connect(m_signalMapper, QOverload<int>::of(&QSignalMapper::mapped),
this, &Part::slotOpenEntry);