[kde-workspace/f18] rework fontconfig patch to ensure $XDG_CONFIG_HOME/fontconfig exists

Rex Dieter rdieter at fedoraproject.org
Fri Oct 26 21:11:37 UTC 2012


commit c67f3969fbdf055b2df8f095dabfb0b02f0d2857
Author: Rex Dieter <rdieter at fedoraproject.org>
Date:   Fri Oct 26 16:11:29 2012 -0500

    rework fontconfig patch to ensure $XDG_CONFIG_HOME/fontconfig exists

 kde-workspace-4.9.0-fontconfigdir.patch |   25 ------------------------
 kde-workspace-4.9.2-fontconfigdir.patch |   32 +++++++++++++++++++++++++++++++
 kde-workspace.spec                      |   11 ++++++---
 3 files changed, 39 insertions(+), 29 deletions(-)
---
diff --git a/kde-workspace-4.9.2-fontconfigdir.patch b/kde-workspace-4.9.2-fontconfigdir.patch
new file mode 100644
index 0000000..07f6e82
--- /dev/null
+++ b/kde-workspace-4.9.2-fontconfigdir.patch
@@ -0,0 +1,32 @@
+diff -up kde-workspace-4.9.2/kcontrol/fonts/kxftconfig.cpp.fontconfigdir kde-workspace-4.9.2/kcontrol/fonts/kxftconfig.cpp
+--- kde-workspace-4.9.2/kcontrol/fonts/kxftconfig.cpp.fontconfigdir	2012-09-27 19:14:48.000000000 -0500
++++ kde-workspace-4.9.2/kcontrol/fonts/kxftconfig.cpp	2012-10-26 16:06:52.812848940 -0500
+@@ -31,6 +31,8 @@
+ #include <QByteArray>
+ #include <klocale.h>
+ #include <kde_file.h>
++#include <KDE/KGlobal>
++#include <KDE/KStandardDirs>
+ #include <QDir>
+ 
+ #include <stdarg.h>
+@@ -143,7 +145,18 @@ QString getConfigFile()
+         return files.front();  // Just return the 1st one...
+     }
+     else // Hmmm... no known files?
+-        return home+"/.fonts.conf";
++    {
++        if(FcGetVersion() >= 21000)
++        {
++            QString targetPath(KGlobal::dirs()->localxdgconfdir()+"fontconfig");
++            QDir target(targetPath);
++            if(!target.exists()) 
++                target.mkpath(targetPath);
++            return targetPath+"/fonts.conf";
++        }
++	else
++            return home+"/.fonts.conf";
++    }
+ }
+ 
+ static QString getEntry(QDomElement element, const char *type, unsigned int numAttributes, ...)
diff --git a/kde-workspace.spec b/kde-workspace.spec
index 8359b06..a12b5b4 100644
--- a/kde-workspace.spec
+++ b/kde-workspace.spec
@@ -11,7 +11,7 @@
 Summary: KDE Workspace
 Name:    kde-workspace
 Version: 4.9.2
-Release: 6%{?dist}
+Release: 7%{?dist}
 
 License: GPLv2
 URL:     https://projects.kde.org/projects/kde/kde-workspace
@@ -114,8 +114,8 @@ Patch58: kde-workspace-4.8.0-systemd-shutdown.patch
 
 # fontconfig-2.10+, support $XDG_CONFIG_HOME/fontconfig/fonts.conf
 # https://bugs.kde.org/show_bug.cgi?id=304317
-# http://svnweb.mageia.org/packages/cauldron/kdebase4-workspace/current/SOURCES/kdebase-workspace-4.9.0-fontconfigdir.patch
-Patch59: kde-workspace-4.9.0-fontconfigdir.patch
+# based-on http://svnweb.mageia.org/packages/cauldron/kdebase4-workspace/current/SOURCES/kdebase-workspace-4.9.0-fontconfigdir.patch
+Patch59: kde-workspace-4.9.2-fontconfigdir.patch
 
 # Support for switching users with systemd - #859347
 Patch60: kde-workspace-4.9.2-systemd-switch-user.patch
@@ -461,7 +461,7 @@ Requires: akonadi
 #patch56 -p1 -b .kwin_llvmpipe_whitelist
 %patch57 -p1 -b .bug796969
 %patch58 -p1 -b .systemd-shutdown
-%patch59 -p1 -b fontconfigdir
+%patch59 -p1 -b .fontconfigdir
 %patch60 -p1 -b .systemd-switch-user
 %patch61 -p1 -b .r106794
 %patch62 -p1 -b .r106794
@@ -1019,6 +1019,9 @@ fi
 
 
 %changelog
+* Fri Oct 26 2012 Rex Dieter <rdieter at fedoraproject.org> 4.9.2-7
+- rework fontconfig patch to ensure $XDG_CONFIG_HOME/fontconfig exists
+
 * Thu Oct 18 2012 Rex Dieter <rdieter at fedoraproject.org> 4.9.2-6
 - monitor sleep settings reset, resulting in monitor turning off (kde#295164)
 


More information about the scm-commits mailing list