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})
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake )
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)
......
......@@ -44,6 +44,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <QJsonObject>
// KF
#include <kxmlgui_version.h>
#include <KActionCategory>
#include <KActionCollection>
#include <KDirLister>
......@@ -501,6 +502,10 @@ struct MainWindow::Private {
view->addAction(KStandardAction::name(KStandardAction::KeyBindings),
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::ConfigureToolbars, q, SLOT(configureToolbars()));
......@@ -1693,8 +1698,11 @@ void MainWindow::showConfigDialog()
void MainWindow::configureShortcuts()
{
#if KXMLGUI_VERSION >= QT_VERSION_CHECK(5, 84, 0)
guiFactory()->showConfigureShortcutsDialog();
#else
guiFactory()->configureShortcuts();
guiFactory()->refreshActionProperties();
#endif
}
void MainWindow::toggleMenuBar()
......
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