diff --git a/src/xdg-desktop-portal-kde.cpp b/src/xdg-desktop-portal-kde.cpp index 9d82d15..f6e87ce 100644 --- a/src/xdg-desktop-portal-kde.cpp +++ b/src/xdg-desktop-portal-kde.cpp @@ -1,49 +1,50 @@ /* * Copyright © 2016 Red Hat, Inc * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . * * Authors: * Jan Grulich */ #include #include #include #include "desktopportal.h" Q_LOGGING_CATEGORY(XdgDesktopPortalKde, "xdp-kde") int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QApplication a(argc, argv); a.setQuitOnLastWindowClosed(false); QDBusConnection sessionBus = QDBusConnection::sessionBus(); if (sessionBus.registerService(QStringLiteral("org.freedesktop.impl.portal.desktop.kde"))) { DesktopPortal *desktopPortal = new DesktopPortal(&a); if (sessionBus.registerObject(QStringLiteral("/org/freedesktop/portal/desktop"), desktopPortal, QDBusConnection::ExportAdaptors)) { qCDebug(XdgDesktopPortalKde) << "Desktop portal registered successfully"; } else { qCDebug(XdgDesktopPortalKde) << "Failed to register desktop portal"; } } else { qCDebug(XdgDesktopPortalKde) << "Failed to register org.freedesktop.impl.portal.desktop.kde service"; + return 1; } return a.exec(); }