Commit 68ba2ced authored by Ahmad Samir's avatar Ahmad Samir
Browse files

Port to KXMLGUIFactory::showConfigureShortcutsDialog()

Bump min. required KF version to 5.79, that's where KXMLGUIFactory::shortcutsSaved()
was added.
parent 81bef5e4
...@@ -11,7 +11,7 @@ project(gwenview VERSION ${RELEASE_SERVICE_VERSION}) ...@@ -11,7 +11,7 @@ project(gwenview VERSION ${RELEASE_SERVICE_VERSION})
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake )
set (QT_MIN_VERSION "5.14.0") set (QT_MIN_VERSION "5.14.0")
set (KF5_MIN_VERSION "5.68.0") set (KF5_MIN_VERSION "5.79.0")
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
......
...@@ -44,6 +44,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ...@@ -44,6 +44,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <QJsonObject> #include <QJsonObject>
// KF // KF
#include <kxmlgui_version.h>
#include <KActionCategory> #include <KActionCategory>
#include <KActionCollection> #include <KActionCollection>
#include <KDirLister> #include <KDirLister>
...@@ -501,6 +502,10 @@ struct MainWindow::Private { ...@@ -501,6 +502,10 @@ struct MainWindow::Private {
view->addAction(KStandardAction::name(KStandardAction::KeyBindings), view->addAction(KStandardAction::name(KStandardAction::KeyBindings),
KStandardAction::keyBindings(q, &MainWindow::configureShortcuts, actionCollection)); KStandardAction::keyBindings(q, &MainWindow::configureShortcuts, actionCollection));
connect(q->guiFactory(), &KXMLGUIFactory::shortcutsSaved, q, [this]() {
q->guiFactory()->refreshActionProperties();
});
view->addAction(KStandardAction::Preferences, q, SLOT(showConfigDialog())); view->addAction(KStandardAction::Preferences, q, SLOT(showConfigDialog()));
view->addAction(KStandardAction::ConfigureToolbars, q, SLOT(configureToolbars())); view->addAction(KStandardAction::ConfigureToolbars, q, SLOT(configureToolbars()));
...@@ -1693,8 +1698,11 @@ void MainWindow::showConfigDialog() ...@@ -1693,8 +1698,11 @@ void MainWindow::showConfigDialog()
void MainWindow::configureShortcuts() void MainWindow::configureShortcuts()
{ {
#if KXMLGUI_VERSION >= QT_VERSION_CHECK(5, 84, 0)
guiFactory()->showConfigureShortcutsDialog();
#else
guiFactory()->configureShortcuts(); guiFactory()->configureShortcuts();
guiFactory()->refreshActionProperties(); #endif
} }
void MainWindow::toggleMenuBar() void MainWindow::toggleMenuBar()
......
Supports Markdown
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