[kde-doc-english] [trojita] src/Gui: GUI: try to detect Xfce and then use the Gnome font preferences

Caspar Schutijser caspar at schutijser.com
Thu May 9 15:33:34 UTC 2013


Git commit 2be0e57aee2fa6bcd08a336dadb9c55ff9b6f130 by Caspar Schutijser.
Committed on 09/05/2013 at 14:44.
Pushed by jkt into branch 'master'.

GUI: try to detect Xfce and then use the Gnome font preferences

M  +7    -2    src/Gui/Util.cpp

http://commits.kde.org/trojita/2be0e57aee2fa6bcd08a336dadb9c55ff9b6f130

diff --git a/src/Gui/Util.cpp b/src/Gui/Util.cpp
index d9879cc..dabdd7b 100644
--- a/src/Gui/Util.cpp
+++ b/src/Gui/Util.cpp
@@ -44,6 +44,11 @@ bool isRunningGnome()
     return qgetenv("DESKTOP_SESSION") == "gnome";
 }
 
+bool isRunningXfce()
+{
+    return qgetenv("DESKTOP_SESSION") == "xfce";
+}
+
 /** @short Return full path to the $KDEHOME
 
 Shamelessly stolen from Qt4's src/gui/kernel/qkde.cpp (it's a private class) and adopted to check $KDE_SESSION_VERSION
@@ -152,8 +157,8 @@ QFont systemMonospaceFont()
             if (fontDescription.isEmpty())
                 fontDescription = kdeSettings.value(confKey).toString();
             initialized = !fontDescription.isEmpty() && font.fromString(fontDescription);
-        } else if (isRunningGnome()) {
-            // Under Gnome, we can read the preferred font in yet another format via gconftool-2
+        } else if (isRunningGnome() || isRunningXfce()) {
+            // Under Gnome and Xfce, we can read the preferred font in yet another format via gconftool-2
             QByteArray fontDescription;
             do {
                 QProcess gconf;


More information about the kde-doc-english mailing list