File indexing completed on 2024-04-28 05:36:49

0001 /*
0002  * SPDX-FileCopyrightText: 2016 Red Hat Inc
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  *
0006  * SPDX-FileCopyrightText: 2016 Jan Grulich <jgrulich@redhat.com>
0007  */
0008 
0009 #include "desktopportal.h"
0010 #include "desktopportal_debug.h"
0011 
0012 #include "access.h"
0013 #include "account.h"
0014 #include "appchooser.h"
0015 #include "background.h"
0016 #include "dynamiclauncher.h"
0017 #include "email.h"
0018 #include "filechooser.h"
0019 #include "globalshortcuts.h"
0020 #include "inhibit.h"
0021 #include "notification.h"
0022 #include "print.h"
0023 #include "remotedesktop.h"
0024 #include "screencast.h"
0025 #include "screenshot.h"
0026 #include "settings.h"
0027 #include "waylandintegration.h"
0028 
0029 DesktopPortal::DesktopPortal(QObject *parent)
0030     : QObject(parent)
0031     , m_access(new AccessPortal(this))
0032     , m_account(new AccountPortal(this))
0033     , m_appChooser(new AppChooserPortal(this))
0034     , m_email(new EmailPortal(this))
0035     , m_fileChooser(new FileChooserPortal(this))
0036     , m_inhibit(new InhibitPortal(this))
0037     , m_notification(new NotificationPortal(this))
0038     , m_print(new PrintPortal(this))
0039     , m_settings(new SettingsPortal(this))
0040     , m_dynamicLauncher(new DynamicLauncherPortal(this))
0041 {
0042     const QByteArray xdgCurrentDesktop = qgetenv("XDG_CURRENT_DESKTOP");
0043     if (xdgCurrentDesktop.compare("KDE", Qt::CaseInsensitive) == 0) {
0044         new GlobalShortcutsPortal(this);
0045 
0046         m_background = new BackgroundPortal(this, this);
0047         m_screenCast = new ScreenCastPortal(this);
0048         m_remoteDesktop = new RemoteDesktopPortal(this);
0049         m_screenshot = new ScreenshotPortal(this);
0050         WaylandIntegration::init();
0051     }
0052 }