Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit bec637a9 authored by Elvis Angelaccio's avatar Elvis Angelaccio

Port to KStandardAction::RenameFile

Less code, no duplicated i18n strings and no need to hardcode the F2
shortcut (ark will use whatever shortcut from System Settings).
parent 3e462841
<!DOCTYPE gui SYSTEM "kpartgui.dtd">
<gui name="ark_part" version="19" translationDomain="ark">
<gui name="ark_part" version="20" translationDomain="ark">
<MenuBar>
<Menu name="archive">
<text>&amp;Archive</text>
......@@ -17,7 +17,7 @@
<Action name="openfile"/>
<Action name="openfilewith"/>
<Separator/>
<Action name="rename"/>
<Action name="renamefile"/>
<Action name="delete"/>
<Action name="extract"/>
<Separator/>
......@@ -45,7 +45,7 @@
<Action name="openfile"/>
<Action name="openfilewith"/>
<Separator/>
<Action name="rename"/>
<Action name="renamefile"/>
<Action name="delete"/>
<Action name="extract"/>
<Separator/>
......
......@@ -406,12 +406,7 @@ void Part::setupActions()
actionCollection()->setDefaultShortcut(m_addFilesAction, Qt::ALT + Qt::Key_A);
connect(m_addFilesAction, &QAction::triggered, this, QOverload<>::of(&Part::slotAddFiles));
m_renameFileAction = actionCollection()->addAction(QStringLiteral("rename"));
m_renameFileAction->setIcon(QIcon::fromTheme(QStringLiteral("edit-rename")));
m_renameFileAction->setText(i18n("&Rename"));
actionCollection()->setDefaultShortcut(m_renameFileAction, Qt::Key_F2);
m_renameFileAction->setToolTip(i18nc("@info:tooltip", "Click to rename the selected file"));
connect(m_renameFileAction, &QAction::triggered, m_view, &ArchiveView::renameSelectedEntry);
m_renameFileAction = KStandardAction::renameFile(m_view, &ArchiveView::renameSelectedEntry, actionCollection());
m_deleteFilesAction = actionCollection()->addAction(QStringLiteral("delete"));
m_deleteFilesAction->setIcon(QIcon::fromTheme(QStringLiteral("archive-remove")));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment