From 5e00e727b670bf874ee5ffe84dcea8d5b2a5decf Mon Sep 17 00:00:00 2001 From: reionwong Date: Sun, 29 Aug 2021 20:14:31 +0800 Subject: [PATCH] Modify DBus interface name --- src/main.cpp | 7 +++++-- src/mainwindow.cpp | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 3957b26..1e8576d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -35,8 +35,7 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); if (!QDBusConnection::sessionBus().registerService("org.cutefish.Dock")) { - app.exit(); - return 0; + return -1; } qmlRegisterType("Cutefish.Dock", 1, 0, "DockSettings"); @@ -54,5 +53,9 @@ int main(int argc, char *argv[]) MainWindow w; + if (!QDBusConnection::sessionBus().registerObject("/Dock", &w)) { + return -1; + } + return app.exec(); } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index c6906a1..92f6e8e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -46,7 +46,6 @@ MainWindow::MainWindow(QQuickView *parent) , m_hideTimer(new QTimer(this)) { new DockAdaptor(this); - QDBusConnection::sessionBus().registerObject(QStringLiteral("/Dock"), this); setDefaultAlphaBuffer(false); setColor(Qt::transparent);