Commit 62e4f5d0 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

[kcm/access] Use QApplication::activeWindow to pass parent window

This simplifies the code and also makes it actually work
parent b473fed7
Pipeline #230654 passed with stage
in 3 minutes and 21 seconds
......@@ -10,10 +10,10 @@
#include <math.h>
#include <stdlib.h>
#include <QApplication>
#include <QFileDialog>
#include <QProcess>
#include <QQuickItem>
#include <QQuickRenderControl>
#include <QStandardPaths>
#include <QWindow>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
......@@ -164,13 +164,9 @@ KAccessConfig::~KAccessConfig()
{
}
void KAccessConfig::configureKNotify(QQuickItem *parent)
void KAccessConfig::configureKNotify()
{
auto dialog = KNotifyConfigWidget::configure(nullptr, QStringLiteral("kaccess"));
if (parent && parent->window()) {
dialog->winId();
dialog->windowHandle()->setTransientParent(QQuickRenderControl::renderWindowFor(parent->window()));
}
KNotifyConfigWidget::configure(QApplication::activeWindow(), QStringLiteral("kaccess"));
}
void KAccessConfig::launchOrcaConfiguration()
......
......@@ -42,7 +42,7 @@ public:
void save() override;
Q_INVOKABLE void configureKNotify(QQuickItem *parent);
Q_INVOKABLE void configureKNotify();
Q_INVOKABLE void launchOrcaConfiguration();
Q_INVOKABLE bool orcaInstalled();
......
......@@ -95,6 +95,6 @@ Kirigami.FormLayout {
text: i18n("Configure Notifications…")
icon.name: "preferences-desktop-notification"
onClicked: kcm.configureKNotify(this)
onClicked: kcm.configureKNotify()
}
}
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