ADD: Determine KDE also by "plasma" session

(cherry picked from commit 137c2af384)
This commit is contained in:
Alexander Koblov 2021-11-03 20:51:20 +03:00
commit 0e3e514db9

View file

@ -3,7 +3,7 @@
-------------------------------------------------------------------------
This unit contains specific UNIX functions.
Copyright (C) 2008-2020 Alexander Koblov (alexx2000@mail.ru)
Copyright (C) 2008-2021 Alexander Koblov (alexx2000@mail.ru)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -276,7 +276,9 @@ var
I: Integer;
DesktopSession: String;
const
EnvVariable: array[0..1] of String = ('XDG_CURRENT_DESKTOP', 'DESKTOP_SESSION');
EnvVariable: array[0..2] of String = ('XDG_CURRENT_DESKTOP',
'XDG_SESSION_DESKTOP',
'DESKTOP_SESSION');
begin
Result:= DE_UNKNOWN;
for I:= Low(EnvVariable) to High(EnvVariable) do
@ -286,6 +288,8 @@ begin
DesktopSession:= LowerCase(DesktopSession);
if Pos('kde', DesktopSession) <> 0 then
Exit(DE_KDE);
if Pos('plasma', DesktopSession) <> 0 then
Exit(DE_KDE);
if Pos('gnome', DesktopSession) <> 0 then
Exit(DE_GNOME);
if Pos('xfce', DesktopSession) <> 0 then
@ -540,7 +544,6 @@ end;
function MountDrive(Drive: PDrive): Boolean;
{$IFDEF LINUX}
var
Index: Integer;
MountPath: String = '';
{$ENDIF}
begin