2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-04 00:15:42 +00:00

Rework DE detection

Variables can point to a mixed environment, make DE detection non-exclusive.
Remove unused methods.
This commit is contained in:
Ilya Fedin
2022-01-06 23:24:21 +04:00
committed by John Preston
parent ba6c3eaf73
commit 726aa3316d
3 changed files with 76 additions and 123 deletions

View File

@@ -816,17 +816,20 @@ bool OpenSystemSettings(SystemSettingsType type) {
}
options.push_back(std::move(command));
};
if (DesktopEnvironment::IsUnity()) {
add("unity-control-center", "sound");
} else if (DesktopEnvironment::IsKDE()) {
add("kcmshell5", "kcm_pulseaudio");
add("kcmshell4", "phonon");
} else if (DesktopEnvironment::IsGnome()) {
add("gnome-control-center", "sound");
} else if (DesktopEnvironment::IsCinnamon()) {
add("cinnamon-settings", "sound");
} else if (DesktopEnvironment::IsMATE()) {
add("mate-volume-control");
for (const auto &type : DesktopEnvironment::Get()) {
using DesktopEnvironment::Type;
if (type == Type::Unity) {
add("unity-control-center", "sound");
} else if (type == Type::KDE) {
add("kcmshell5", "kcm_pulseaudio");
add("kcmshell4", "phonon");
} else if (type == Type::Gnome) {
add("gnome-control-center", "sound");
} else if (type == Type::Cinnamon) {
add("cinnamon-settings", "sound");
} else if (type == Type::MATE) {
add("mate-volume-control");
}
}
#ifdef __HAIKU__
add("Media");