[gnome-games] aisleriot: Make PySol and KDE card theme paths configurable
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] aisleriot: Make PySol and KDE card theme paths configurable
- Date: Tue, 14 Sep 2010 10:26:27 +0000 (UTC)
commit a8b3708ab7042f1293e3bc44d27de58cd7357c1d
Author: Christian Persch <chpe gnome org>
Date: Tue Sep 14 12:23:25 2010 +0200
aisleriot: Make PySol and KDE card theme paths configurable
They are apparently not the same on all distros, so add configure
options for theme, with some common distro's paths preconfigured.
Bug #629625.
aisleriot/lib/ar-card-theme-kde.c | 8 +------
aisleriot/lib/ar-card-theme-pysol.c | 8 +------
configure.in | 36 +++++++++++++++++++++++++++++++++++
3 files changed, 38 insertions(+), 14 deletions(-)
---
diff --git a/aisleriot/lib/ar-card-theme-kde.c b/aisleriot/lib/ar-card-theme-kde.c
index 9c41bd1..065b9f8 100644
--- a/aisleriot/lib/ar-card-theme-kde.c
+++ b/aisleriot/lib/ar-card-theme-kde.c
@@ -399,13 +399,7 @@ ar_card_theme_kde_class_foreach_theme_dir (ArCardThemeClass *klass,
if (!_ar_card_theme_class_foreach_env (klass, "AR_CARD_THEME_PATH_KDE", callback, data))
return FALSE;
- /* If we're installed in a non-system prefix, also load the card themes
- * from the system prefix.
- */
- if (!games_runtime_is_system_prefix ())
- return callback (klass, "/usr/share/kde4/apps/carddecks", data);
-
- return TRUE;
+ return callback (klass, KDE_CARD_THEME_PATH, data);
}
static void
diff --git a/aisleriot/lib/ar-card-theme-pysol.c b/aisleriot/lib/ar-card-theme-pysol.c
index e4a2501..c771903 100644
--- a/aisleriot/lib/ar-card-theme-pysol.c
+++ b/aisleriot/lib/ar-card-theme-pysol.c
@@ -408,13 +408,7 @@ ar_card_theme_pysol_class_foreach_theme_dir (ArCardThemeClass *klass,
if (!_ar_card_theme_class_foreach_env (klass, "AR_CARD_THEME_PATH_PYSOL", callback, data))
return FALSE;
- /* If we're installed in a non-system prefix, also load the card themes
- * from the system prefix.
- */
- if (!games_runtime_is_system_prefix ())
- return callback (klass, "/usr/share/games/pysol", data);
-
- return TRUE;
+ return callback (klass, PYSOL_CARD_THEME_PATH, data);
}
static void
diff --git a/configure.in b/configure.in
index 80748ab..1dc5822 100644
--- a/configure.in
+++ b/configure.in
@@ -238,6 +238,11 @@ if test "$LSB_RELEASE" != "false"; then
LSB_DISTRIBUTION="$($LSB_RELEASE -s -d | sed 's,^\",,;s,\"$,,')"
fi
+AC_MSG_CHECKING([for LSB distributor])
+AC_MSG_RESULT([$LSB_DISTRIBUTOR])
+AC_MSG_CHECKING([for LSB distribution])
+AC_MSG_RESULT([$LSB_DISTRIBUTION])
+
AC_DEFINE_UNQUOTED([LSB_DISTRIBUTOR],["$LSB_DISTRIBUTOR"],[The distributor ID])
AC_DEFINE_UNQUOTED([LSB_DISTRIBUTION],["$LSB_DISTRIBUTION"],[The full distribution description])
@@ -479,6 +484,37 @@ AM_CONDITIONAL([ENABLE_CARD_THEME_FORMAT_FIXED],[test "$enable_card_theme_format
AM_CONDITIONAL([ENABLE_CARD_THEME_FORMAT_SLICED],[test "$enable_card_theme_format_sliced" = "yes"])
AM_CONDITIONAL([ENABLE_CARD_THEME_FORMAT_PYSOL],[test "$enable_card_theme_format_pysol" = "yes"])
+# Card theme paths
+
+if test "$enable_card_theme_format_kde"; then
+ AC_MSG_CHECKING([for KDE card themes base path])
+ AC_ARG_WITH([kde-card-theme-path],
+ [AS_HELP_STRING([--with-kde-card-theme-path],[The base path to the KDE card themes])],
+ [],[case $LSB_DISTRIBUTION in
+ *Fedora*|*RedHat*) with_kde_card_theme_path="/usr/share/kde4/apps/carddecks" ;;
+ *Ubuntu*) with_kde_card_theme_path="/usr/share/kde4/apps/carddecks" ;;
+ *) AC_MSG_ERROR([When enabling the KDE card theme format, you must specify the KDE card themes base path.]) ;;
+ esac])
+ AC_MSG_RESULT([$with_kde_card_theme_path])
+
+ AC_DEFINE_UNQUOTED([KDE_CARD_THEME_PATH],["$with_kde_card_theme_path"],[The base path to the KDE card themes])
+fi
+
+if test "$enable_card_theme_format_pysol"; then
+ AC_MSG_CHECKING([for PySol card themes base path])
+ AC_ARG_WITH([pysol-card-theme-path],
+ [AS_HELP_STRING([--with-pysol-card-theme-path],[The base path to the PySol card themes])],
+ [],[case $LSB_DISTRIBUTION in
+ *Fedora*|*RedHat*) with_pysol_card_theme_path="/usr/share/PySolFC" ;;
+ *SUSE*) with_pysol_card_theme_path="/usr/share/games/pysol/data" ;;
+ *Ubuntu*) with_pysol_card_theme_path="/usr/share/games/pysol" ;;
+ *) AC_MSG_ERROR([When enabling the PySol card theme format, you must specify the PySol card themes base path.]) ;;
+ esac])
+ AC_MSG_RESULT([$with_pysol_card_theme_path])
+
+ AC_DEFINE_UNQUOTED([PYSOL_CARD_THEME_PATH],["$with_pysol_card_theme_path"],[The base path to the PySol card themes])
+fi
+
# Default card theme
AC_MSG_CHECKING([which card theme to use by default])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]