rpms/gdm/devel gdm-2.13.0.5-clock-format.patch, NONE, 1.1 gdm.spec, 1.118, 1.119

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Jan 19 04:14:43 UTC 2006


Author: caillon

Update of /cvs/dist/rpms/gdm/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv26662

Modified Files:
	gdm.spec 
Added Files:
	gdm-2.13.0.5-clock-format.patch 
Log Message:
* Wed Jan 18 2006 Christopher Aillon <caillon at redhat.com> - 1:2.13.0.5-6
- Add patch to fix clock to default to 24h in locales that expect it (175453)


gdm-2.13.0.5-clock-format.patch:
 daemon/gdm.h       |    2 +-
 daemon/gdmconfig.c |    4 ++--
 gui/gdmcommon.c    |   15 +++++++++------
 3 files changed, 12 insertions(+), 9 deletions(-)

--- NEW FILE gdm-2.13.0.5-clock-format.patch ---
--- gdm-2.13.0.5/daemon/gdmconfig.c.clock-format	2006-01-05 18:16:08.000000000 -0500
+++ gdm-2.13.0.5/daemon/gdmconfig.c	2006-01-18 22:44:30.705078000 -0500
@@ -242,7 +242,7 @@
 static gboolean GdmShowGnomeFailsafe;
 static gboolean GdmShowXtermFailsafe;
 static gboolean GdmShowLastSession;
-static gboolean GdmUse24Clock;
+static gchar * GdmUse24Clock;
 static gboolean GdmEntryCircles;
 static gboolean GdmEntryInvisible;
 static gboolean GdmGraphicalThemeRand;
@@ -405,7 +405,7 @@
       &GdmShowXtermFailsafe, &bool_type);
    gdm_config_add_hash (GDM_KEY_SHOW_LAST_SESSION,
       &GdmShowLastSession, &bool_type);
-   gdm_config_add_hash (GDM_KEY_USE_24_CLOCK, &GdmUse24Clock, &bool_type);
+   gdm_config_add_hash (GDM_KEY_USE_24_CLOCK, &GdmUse24Clock, &string_type);
    gdm_config_add_hash (GDM_KEY_ENTRY_CIRCLES, &GdmEntryCircles, &bool_type);
    gdm_config_add_hash (GDM_KEY_ENTRY_INVISIBLE, &GdmEntryInvisible, &bool_type);
    gdm_config_add_hash (GDM_KEY_GRAPHICAL_THEME_RAND,
--- gdm-2.13.0.5/daemon/gdm.h.clock-format	2006-01-05 18:16:08.000000000 -0500
+++ gdm-2.13.0.5/daemon/gdm.h	2006-01-18 22:44:30.712071000 -0500
@@ -345,7 +345,7 @@
 #define GDM_KEY_SET_POSITION "greeter/SetPosition=false"
 #define GDM_KEY_POSITION_X "greeter/PositionX=0"
 #define GDM_KEY_POSITION_Y "greeter/PositionY=0"
-#define GDM_KEY_USE_24_CLOCK "greeter/Use24Clock=false"
+#define GDM_KEY_USE_24_CLOCK "greeter/Use24Clock=auto"
 #define GDM_KEY_ENTRY_CIRCLES "greeter/UseCirclesInEntry=false"
 #define GDM_KEY_ENTRY_INVISIBLE "greeter/UseInvisibleInEntry=false"
 #define GDM_KEY_GRAPHICAL_THEME "greeter/GraphicalTheme=circles"
--- gdm-2.13.0.5/gui/gdmcommon.c.clock-format	2006-01-05 18:16:09.000000000 -0500
+++ gdm-2.13.0.5/gui/gdmcommon.c	2006-01-18 23:10:35.161624000 -0500
@@ -28,6 +28,7 @@
 #include <locale.h>
 #include <string.h>
 #include <syslog.h>
+#include <time.h>
 #include <sys/utsname.h>
 
 #include <glib/gi18n.h>
@@ -294,13 +295,15 @@
 	} else {
 		/* Value is "auto" (default), thus select according to
 		   "locale" settings. */
+		char outstr[20];
+		time_t t;
+		struct tm *tmp;
 
-		/* Translators: Translate this to '12-hour', or
-		   '24-hour'. Meaning of the translation is the
-		   default time format in your locale. */
-		return strcmp ("12-hour", _("24-hour")) != 0;
-		/* Logic is that if translator does not understand the
-		   comment, then 24 hour format is selected. */
+		t = time(NULL);
+		tmp = localtime (&t);
+
+		/* if the locale does not have an AM/PM string, use 24h time */
+		return (strftime (outstr, sizeof(outstr), "%p", tmp) == 0);
 	}
 	/* NOTREACHED */
 	return TRUE;


Index: gdm.spec
===================================================================
RCS file: /cvs/dist/rpms/gdm/devel/gdm.spec,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -r1.118 -r1.119
--- gdm.spec	18 Jan 2006 04:35:48 -0000	1.118
+++ gdm.spec	19 Jan 2006 04:14:35 -0000	1.119
@@ -15,7 +15,7 @@
 Summary: The GNOME Display Manager.
 Name: gdm
 Version: 2.13.0.5
-Release: 5
+Release: 6
 Epoch: 1
 License: LGPL/GPL
 Group: User Interface/X
@@ -44,6 +44,7 @@
 Patch19: gdm-2.13.0.4-add-gnome-cflags.patch
 Patch20: gdm-2.13.0.4-add-locale-header.patch
 Patch21: gdm-2.13.0.4-fix-gdm-safe-restart-conf-path.patch
+Patch22: gdm-2.13.0.5-clock-format.patch
 
 BuildRoot: %{_tmppath}/gdm-%{PACKAGE_VERSION}-root
 
@@ -116,6 +117,7 @@
 %patch19 -p1 -b .add-gnome-cflags
 %patch20 -p1 -b .add-locale-header
 %patch21 -p1 -b .fix-gdm-safe-restart-conf-path
+%patch22 -p1 -b .clock-format
 
 # fix the time format for ja
 perl -pi -e "s|^msgstr \"%a %b %d, %H:%M\"|msgstr \"%m/%d \(%a\) %H:%M\"|; s|^msgstr \"%a %b %d, %I:%M %p\"|msgstr \"%m/%d \(%a\) %p %I:%M\"|" po/ja.po
@@ -305,6 +307,9 @@
 %attr(1770, root, gdm) %dir %{_localstatedir}/gdm
 
 %changelog
+* Wed Jan 18 2006 Christopher Aillon <caillon at redhat.com> - 1:2.13.0.5-6
+- Add patch to fix clock to default to 24h in locales that expect it (175453)
+
 * Tue Jan 17 2006 Ray Strode <rstrode at redhat.com> - 1:2.13.0.5-1
 - update to 2.13.0.5 (bug 178099)
 




More information about the fedora-cvs-commits mailing list