File indexing completed on 2024-05-12 05:36:15

0001 // SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
0002 // SPDX-License-Identifier: GPL-2.0-or-later
0003 
0004 #pragma once
0005 
0006 #include <utility>
0007 
0008 #include <QMap>
0009 #include <QString>
0010 #include <QVariant>
0011 
0012 #include <KConfigGroup>
0013 #include <KSharedConfig>
0014 
0015 // applications-blacklistrc
0016 // NOTE: we only write these entries if they are not already defined in the config
0017 const QMap<QString, QMap<QString, QVariant>> APPLICATIONS_BLACKLIST_DEFAULT_SETTINGS = {
0018     {"Applications",
0019      {{"blacklist",
0020        "cuttlefish,org.kde.plasma.themeexplorer,org.kde.klipper,ciborium,syncmonitorhelper,org.kde.okular,wordview,assistant,assistant-qt5,designer,designer-"
0021        "qt5,linguist,linguist-qt5,org.kde.perusecreator,UserFeedbackConsole,org.kde.kuserfeedback-console,avahi-discover,bssh,bvnc,ktelnetservice5,qv4l2,"
0022        "qvidcap"}}}};
0023 
0024 // kdeglobals
0025 // NOTE: we only write these entries if they are not already defined in the config
0026 const QMap<QString, QMap<QString, QVariant>> KDEGLOBALS_DEFAULT_SETTINGS = {{"General", {{"BrowserApplication", "angelfish"}}}};
0027 
0028 const QMap<QString, QMap<QString, QVariant>> KDEGLOBALS_SETTINGS = {{"KDE", {{"LookAndFeelPackage", "org.kde.breeze.mobile"}}}};
0029 
0030 // kwinrc
0031 QMap<QString, QMap<QString, QVariant>> getKwinrcSettings(KSharedConfig::Ptr m_mobileConfig)
0032 {
0033     auto group = KConfigGroup{m_mobileConfig, QStringLiteral("General")};
0034     bool convergenceModeEnabled = group.readEntry("convergenceModeEnabled", false);
0035 
0036     return {
0037         {"Plugins", {{"blurEnabled", false}, {"convergentwindowsEnabled", true}}},
0038         {"Wayland", {{"InputMethod", "/usr/share/applications/com.github.maliit.keyboard.desktop"}, {"VirtualKeyboardEnabled", true}}},
0039         {"org.kde.kdecoration2",
0040          {{"ButtonsOnRight", convergenceModeEnabled ? "HIAX" : "H"}, // ButtonsOnRight changes depending on whether the device is in convergence mode
0041           {"NoPlugin", false}}},
0042         {"Input", {{"TabletMode", convergenceModeEnabled ? "off" : "auto"}}} // TabletMode changes depending on whether the device is in convergence mode
0043     };
0044 }