[Gnucash-changes] r12195 - gnucash/trunk - Better fix for compiling cleanly on a glib 2.9/2.10 system without

David Hampton hampton at cvs.gnucash.org
Wed Dec 28 22:16:58 EST 2005


Author: hampton
Date: 2005-12-28 22:16:57 -0500 (Wed, 28 Dec 2005)
New Revision: 12195
Trac: http://svn.gnucash.org/trac/changeset/12195

Added:
   gnucash/trunk/src/glib-compat.h
Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/app-utils/gnc-accounting-period.c
   gnucash/trunk/src/app-utils/gnc-accounting-period.h
   gnucash/trunk/src/engine/FreqSpec.c
   gnucash/trunk/src/engine/Recurrence.c
   gnucash/trunk/src/gnome-utils/dialog-utils.c
   gnucash/trunk/src/gnome-utils/gnc-dense-cal.c
   gnucash/trunk/src/gnome-utils/gnc-frequency.c
   gnucash/trunk/src/gnome-utils/gnc-period-select.c
   gnucash/trunk/src/gnome-utils/gnc-recurrence.c
   gnucash/trunk/src/gnome/dialog-scheduledxaction.c
   gnucash/trunk/src/gnome/dialog-sx-from-trans.c
   gnucash/trunk/src/gnome/dialog-sxsincelast.c
   gnucash/trunk/src/gnome/druid-acct-period.c
   gnucash/trunk/src/gnome/druid-loan.c
Log:
Better fix for compiling cleanly on a glib 2.9/2.10 system without
using deprecated functions.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2005-12-28 22:13:22 UTC (rev 12194)
+++ gnucash/trunk/ChangeLog	2005-12-29 03:16:57 UTC (rev 12195)
@@ -1,3 +1,22 @@
+2005-12-28  David Hampton  <hampton at employees.org>
+
+	* src/glib-compat.h:
+	* src/gnome-utils/gnc-recurrence.c:
+	* src/gnome-utils/gnc-period-select.c:
+	* src/gnome-utils/gnc-dense-cal.c:
+	* src/gnome-utils/dialog-utils.c:
+	* src/gnome-utils/gnc-frequency.c:
+	* src/engine/FreqSpec.c:
+	* src/engine/Recurrence.c:
+	* src/gnome/druid-loan.c:
+	* src/gnome/druid-acct-period.c:
+	* src/gnome/dialog-sx-from-trans.c:
+	* src/gnome/dialog-scheduledxaction.c:
+	* src/gnome/dialog-sxsincelast.c:
+	* src/app-utils/gnc-accounting-period.[ch]: Better fix for
+	compiling cleanly on a glib 2.9/2.10 system without using
+	deprecated functions.
+
 2005-12-28  Christian Stimming  <stimming at tuhh.de>
 
 	* src/gnome-utils/dialog-options.c: Improve tooltip display for

Modified: gnucash/trunk/src/app-utils/gnc-accounting-period.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-accounting-period.c	2005-12-28 22:13:22 UTC (rev 12194)
+++ gnucash/trunk/src/app-utils/gnc-accounting-period.c	2005-12-29 03:16:57 UTC (rev 12195)
@@ -58,11 +58,7 @@
 			  g_date_get_year(contains));
   } else {
     date = g_date_new();
-#ifdef HAVE_GLIB29
     g_date_set_time_t(date, time(NULL));
-#else
-    g_date_set_time(date, time(NULL));
-#endif
   }
 
   switch (which) {
@@ -150,11 +146,7 @@
 			  g_date_get_year(contains));
   } else {
     date = g_date_new();
-#ifdef HAVE_GLIB29
     g_date_set_time_t(date, time(NULL));
-#else
-    g_date_set_time(date, time(NULL));
-#endif
   }
 
   switch (which) {

Modified: gnucash/trunk/src/app-utils/gnc-accounting-period.h
===================================================================
--- gnucash/trunk/src/app-utils/gnc-accounting-period.h	2005-12-28 22:13:22 UTC (rev 12194)
+++ gnucash/trunk/src/app-utils/gnc-accounting-period.h	2005-12-29 03:16:57 UTC (rev 12195)
@@ -45,6 +45,7 @@
 #define GNC_ACCOUNTING_PERIOD_H
 
 #include <glib.h>
+#include "glib-compat.h"
 #include <time.h>
 
 /**

Modified: gnucash/trunk/src/engine/FreqSpec.c
===================================================================
--- gnucash/trunk/src/engine/FreqSpec.c	2005-12-28 22:13:22 UTC (rev 12194)
+++ gnucash/trunk/src/engine/FreqSpec.c	2005-12-29 03:16:57 UTC (rev 12195)
@@ -77,6 +77,7 @@
 
 #include <glib.h>
 #include <glib/gi18n.h>
+#include "glib-compat.h"
 #include <string.h>
 #include <time.h>
 
@@ -1296,11 +1297,7 @@
 	when = g_date_new();
 	type = xaccFreqSpecGetType(fs);
 	start_t = timespecToTime_t(start_date);
-#ifdef HAVE_GLIB29
 	g_date_set_time_t(when, start_t);
-#else
-	g_date_set_time(when, (GTime)start_t);
-#endif
 	/* QOF sets this before a type is assigned. */
 	if(type == INVALID) {
 		fs->type = ONCE;

Modified: gnucash/trunk/src/engine/Recurrence.c
===================================================================
--- gnucash/trunk/src/engine/Recurrence.c	2005-12-28 22:13:22 UTC (rev 12194)
+++ gnucash/trunk/src/engine/Recurrence.c	2005-12-29 03:16:57 UTC (rev 12195)
@@ -21,6 +21,7 @@
 #include "config.h"
 #include <time.h>
 #include <glib.h>
+#include "glib-compat.h"
 #include <string.h>
 #include "Recurrence.h"
 #include "gnc-date.h"
@@ -66,11 +67,7 @@
     if (_start && g_date_valid(_start)) {
         r->start = *_start;
     } else {
-#ifdef HAVE_GLIB29
         g_date_set_time_t(&r->start, time(NULL));
-#else
-        g_date_set_time(&r->start, time(NULL));
-#endif
     }
 
     /* Some of the unusual period types also specify phase.  For those

Added: gnucash/trunk/src/glib-compat.h
===================================================================
--- gnucash/trunk/src/glib-compat.h	2005-12-28 22:13:22 UTC (rev 12194)
+++ gnucash/trunk/src/glib-compat.h	2005-12-29 03:16:57 UTC (rev 12195)
@@ -0,0 +1,23 @@
+/*
+ * glib-compat.h - GLib version compatability mappings
+ * Copyright (C) 2005, David Hampton <hampton at employees.org>
+ *
+ * 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 the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#ifndef HAVE_GLIB29
+#define g_date_set_time_t  g_date_set_time
+#endif

Modified: gnucash/trunk/src/gnome/dialog-scheduledxaction.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-scheduledxaction.c	2005-12-28 22:13:22 UTC (rev 12194)
+++ gnucash/trunk/src/gnome/dialog-scheduledxaction.c	2005-12-29 03:16:57 UTC (rev 12195)
@@ -25,6 +25,7 @@
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
+#include "glib-compat.h"
 #include <locale.h>
 #include <time.h>
 
@@ -471,15 +472,9 @@
                                 return TRUE;
                         }
                         sxEndDate = *xaccSchedXactionGetEndDate( sxed->sx );
-#ifdef HAVE_GLIB29
                         g_date_set_time_t( &dlgEndDate,
 					   gnc_date_edit_get_date( sxed->
 								   endDateEntry ) );
-#else
-                        g_date_set_time( &dlgEndDate,
-                                         gnc_date_edit_get_date( sxed->
-                                                                 endDateEntry ) );
-#endif
 
                         if ( g_date_compare( &sxEndDate, &dlgEndDate ) != 0 ) {
                                 return TRUE;
@@ -976,15 +971,9 @@
 
                 g_date_clear( &endDate, 1 );
                 if ( gtk_toggle_button_get_active(sxed->optEndDate) ) {
-#ifdef HAVE_GLIB29
                         g_date_set_time_t( &endDate,
 					   gnc_date_edit_get_date( sxed->
 								   endDateEntry ) );
-#else
-                        g_date_set_time( &endDate,
-                                         gnc_date_edit_get_date( sxed->
-                                                                 endDateEntry ) );
-#endif
                 }
 
                 /* Now, see if the user is attempting to create a SX that can't exist
@@ -1039,15 +1028,9 @@
 
                 if ( gtk_toggle_button_get_active(sxed->optEndDate) ) {
                         /* get the end date data */
-#ifdef HAVE_GLIB29
                         g_date_set_time_t( &gdate,
 					   gnc_date_edit_get_date(
                                                  sxed->endDateEntry ) );
-#else
-                        g_date_set_time( &gdate,
-                                         gnc_date_edit_get_date(
-                                                 sxed->endDateEntry ) );
-#endif
                         xaccSchedXactionSetEndDate( sxed->sx, &gdate );
                         /* set the num occurances data */
                         xaccSchedXactionSetNumOccur( sxed->sx, 0 );
@@ -1773,11 +1756,7 @@
         /* Give decent initial FreqSpec for SX */
         fs = xaccSchedXactionGetFreqSpec( tmpSX );
         gd = g_date_new();
-#ifdef HAVE_GLIB29
         g_date_set_time_t( gd, time(NULL) );
-#else
-        g_date_set_time( gd, time(NULL) );
-#endif
         xaccFreqSpecSetMonthly( fs, gd, 1 );
         xaccFreqSpecSetUIType ( fs, UIFREQ_MONTHLY );
         g_date_free( gd );

Modified: gnucash/trunk/src/gnome/dialog-sx-from-trans.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-sx-from-trans.c	2005-12-28 22:13:22 UTC (rev 12194)
+++ gnucash/trunk/src/gnome/dialog-sx-from-trans.c	2005-12-29 03:16:57 UTC (rev 12195)
@@ -26,6 +26,7 @@
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
+#include "glib-compat.h"
 
 #include "gnc-engine.h"
 #include "SX-book.h"
@@ -185,11 +186,7 @@
     retval.type = END_ON_DATE;
     g_date_clear( &(retval.end_date), 1 );
     end_tt = gnc_date_edit_get_date(sxfti->endDateGDE);
-#ifdef HAVE_GLIB29
     g_date_set_time_t( &(retval.end_date), end_tt);
-#else
-    g_date_set_time( &(retval.end_date), end_tt);
-#endif
     return retval;
   }
     
@@ -425,11 +422,7 @@
   /* Setup the initial start date for user display/confirmation */
   /* compute good initial date. */
   start_tt = xaccTransGetDate( sxfti->trans );
-#ifdef HAVE_GLIB29
   g_date_set_time_t( &date, start_tt );
-#else
-  g_date_set_time( &date, start_tt );
-#endif
   fs = xaccFreqSpecMalloc( gnc_get_current_book() );
   sxftd_update_fs( sxfti, &date, fs );
   xaccFreqSpecGetNextInstance( fs, &date, &nextDate );
@@ -482,11 +475,7 @@
   xaccSchedXactionSetName(sx, name);
   g_free(name);
 
-#ifdef HAVE_GLIB29
   g_date_set_time_t( &date, gnc_date_edit_get_date( sxfti->startDateGDE ) );
-#else
-  g_date_set_time( &date, gnc_date_edit_get_date( sxfti->startDateGDE ) );
-#endif
  
   fs = xaccFreqSpecMalloc(gnc_get_current_book ());
   sxftd_update_fs( sxfti, &date, fs );
@@ -608,11 +597,7 @@
   FreqSpec *fs;
 
   tmp_tt = xaccTransGetDate( sxfti->trans );
-#ifdef HAVE_GLIB29
   g_date_set_time_t( &date, tmp_tt );
-#else
-  g_date_set_time( &date, tmp_tt );
-#endif
   
   fs = xaccFreqSpecMalloc( gnc_get_current_book() );
   sxftd_update_fs( sxfti, &date, fs );

Modified: gnucash/trunk/src/gnome/dialog-sxsincelast.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-sxsincelast.c	2005-12-28 22:13:22 UTC (rev 12194)
+++ gnucash/trunk/src/gnome/dialog-sxsincelast.c	2005-12-29 03:16:57 UTC (rev 12195)
@@ -51,6 +51,7 @@
 
 #include <gnome.h>
 #include <glib/gi18n.h>
+#include "glib-compat.h"
 #include <limits.h>
 
 #include "Account.h"
@@ -2131,11 +2132,7 @@
                         sx_state = NULL;
                 }
 
-#ifdef HAVE_GLIB29
 		g_date_set_time_t( &end, time(NULL) );
-#else
-		g_date_set_time( &end, time(NULL) );
-#endif
                 daysInAdvance = xaccSchedXactionGetAdvanceCreation( sx );
                 g_date_add_days( &end, daysInAdvance );
                 

Modified: gnucash/trunk/src/gnome/druid-acct-period.c
===================================================================
--- gnucash/trunk/src/gnome/druid-acct-period.c	2005-12-28 22:13:22 UTC (rev 12194)
+++ gnucash/trunk/src/gnome/druid-acct-period.c	2005-12-29 03:16:57 UTC (rev 12195)
@@ -26,6 +26,7 @@
 
 #include <gnome.h>
 #include <glib/gi18n.h>
+#include "glib-compat.h"
 
 #include "FreqSpec.h"
 #include "Group.h"
@@ -223,11 +224,7 @@
   g_date_clear (&date_now, 1);
   nperiods = 0;
   period_end = info->closing_date;
-#ifdef HAVE_GLIB29
   g_date_set_time_t (&date_now, time(NULL));
-#else
-  g_date_set_time (&date_now, time(NULL));
-#endif
 
   while (0 > g_date_compare(&period_end, &date_now ))
   {
@@ -364,11 +361,7 @@
   }
 
   g_date_clear (&date_now, 1);
-#ifdef HAVE_GLIB29
   g_date_set_time_t (&date_now, time(NULL));
-#else
-  g_date_set_time (&date_now, time(NULL));
-#endif
   if (0 < g_date_compare(&info->closing_date, &date_now))
   {
     const char *msg = _("You must select closing date "
@@ -538,11 +531,7 @@
                   info->earliest, ctime (&info->earliest));
 
   g_date_clear (&info->closing_date, 1);
-#ifdef HAVE_GLIB29
   g_date_set_time_t (&info->closing_date, info->earliest);
-#else
-  g_date_set_time (&info->closing_date, info->earliest);
-#endif
   g_date_clear (&info->prev_closing_date, 1);
   info->prev_closing_date = info->closing_date;
   g_date_add_years (&info->closing_date, 1);

Modified: gnucash/trunk/src/gnome/druid-loan.c
===================================================================
--- gnucash/trunk/src/gnome/druid-loan.c	2005-12-28 22:13:22 UTC (rev 12194)
+++ gnucash/trunk/src/gnome/druid-loan.c	2005-12-29 03:16:57 UTC (rev 12195)
@@ -25,6 +25,7 @@
 
 #include <gnome.h>
 #include <glib/gi18n.h>
+#include "glib-compat.h"
 #include <string.h>
 #include <glade/glade.h>
 #include <math.h>
@@ -810,11 +811,7 @@
         ldd->ld.principal = gnc_numeric_zero();
         ldd->ld.startDate = g_date_new();
         ldd->ld.varStartDate = g_date_new();
-#ifdef HAVE_GLIB29
         g_date_set_time_t( ldd->ld.startDate, time(NULL) );
-#else
-        g_date_set_time( ldd->ld.startDate, time(NULL) );
-#endif
         ldd->ld.loanFreq  = xaccFreqSpecMalloc( gnc_get_current_book() );
         ldd->ld.repFreq   = xaccFreqSpecMalloc( gnc_get_current_book() );
         xaccFreqSpecSetMonthly( ldd->ld.repFreq, ldd->ld.startDate, 1 );
@@ -2488,13 +2485,8 @@
 
         g_date_clear( &start, 1 );
         g_date_clear( &now, 1 );
-#ifdef HAVE_GLIB29
         g_date_set_time_t( &start, gnc_date_edit_get_date( ldd->prmStartDateGDE ) );
         g_date_set_time_t( &now, time(NULL) );
-#else
-        g_date_set_time( &start, gnc_date_edit_get_date( ldd->prmStartDateGDE ) );
-        g_date_set_time( &now, time(NULL) );
-#endif
         for ( i=0; g_date_compare( &start, &now ) < 0; i++ ) {
                 g_date_add_months( &start, 1 );
         }
@@ -2562,11 +2554,7 @@
         monthsTotal = ( (ldd->ld.numPer - 1)
                         * ( ldd->ld.perSize == MONTHS ? 1 : 12 ) );
         endDateMath->tm_mon += monthsTotal;
-#ifdef HAVE_GLIB29
         g_date_set_time_t( end, mktime( endDateMath ) );
-#else
-        g_date_set_time( end, mktime( endDateMath ) );
-#endif
         g_free( endDateMath );
 }
 
@@ -2577,20 +2565,12 @@
         int range = gnc_option_menu_get_active( GTK_WIDGET(ldd->revRangeOpt) );
         switch ( range ) {
         case CURRENT_YEAR:
-#ifdef HAVE_GLIB29
                 g_date_set_time_t( start, time(NULL) );
-#else
-                g_date_set_time( start, time(NULL) );
-#endif
                 g_date_set_dmy( start, 1, G_DATE_JANUARY, g_date_get_year( start ) );
                 g_date_set_dmy( end, 31, G_DATE_DECEMBER, g_date_get_year( start ) );
                 break;
         case NOW_PLUS_ONE:
-#ifdef HAVE_GLIB29
                 g_date_set_time_t( start, time(NULL) );
-#else
-                g_date_set_time( start, time(NULL) );
-#endif
                 *end = *start;
                 g_date_add_years( end, 1 );
                 break;
@@ -2598,17 +2578,10 @@
                 ld_get_loan_range( ldd, start, end );
                 break;
         case CUSTOM:
-#ifdef HAVE_GLIB29
                 g_date_set_time_t( start,
 				   gnc_date_edit_get_date( ldd->revStartDate ) );
                 g_date_set_time_t( end,
 				   gnc_date_edit_get_date( ldd->revEndDate ) );
-#else
-                g_date_set_time( start,
-                                 gnc_date_edit_get_date( ldd->revStartDate ) );
-                g_date_set_time( end,
-                                 gnc_date_edit_get_date( ldd->revEndDate ) );
-#endif
                 break;
         default:
                 PERR( "Unknown review date range option %d", range );

Modified: gnucash/trunk/src/gnome-utils/dialog-utils.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-utils.c	2005-12-28 22:13:22 UTC (rev 12194)
+++ gnucash/trunk/src/gnome-utils/dialog-utils.c	2005-12-29 03:16:57 UTC (rev 12195)
@@ -28,6 +28,7 @@
 #include "config.h"
 
 #include <gnome.h>
+#include "glib-compat.h"
 #include <glade/glade.h>
 #include <gmodule.h>
 #include <dlfcn.h>
@@ -596,11 +597,7 @@
         GTime gtime;
 
         gtime = time (NULL);
-#ifdef HAVE_GLIB29
         g_date_set_time_t (&gdate, gtime);
-#else
-        g_date_set_time (&gdate, gtime);
-#endif
         break;
       }
 

Modified: gnucash/trunk/src/gnome-utils/gnc-dense-cal.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-dense-cal.c	2005-12-28 22:13:22 UTC (rev 12194)
+++ gnucash/trunk/src/gnome-utils/gnc-dense-cal.c	2005-12-29 03:16:57 UTC (rev 12195)
@@ -24,6 +24,7 @@
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
+#include "glib-compat.h"
 #include <math.h>
 
 #include "gnc-dense-cal.h"
@@ -362,11 +363,7 @@
                 GDate *tmpDate;
 
                 tmpDate = g_date_new();
-#ifdef HAVE_GLIB29
                 g_date_set_time_t( tmpDate, time(NULL) );
-#else
-                g_date_set_time( tmpDate, time(NULL) );
-#endif
                 gnc_dense_cal_set_month( dcal, g_date_get_month(tmpDate) );
                 gnc_dense_cal_set_year( dcal, g_date_get_year(tmpDate) );
                 g_date_free( tmpDate );

Modified: gnucash/trunk/src/gnome-utils/gnc-frequency.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-frequency.c	2005-12-28 22:13:22 UTC (rev 12194)
+++ gnucash/trunk/src/gnome-utils/gnc-frequency.c	2005-12-29 03:16:57 UTC (rev 12195)
@@ -25,6 +25,7 @@
 #include "config.h"
 
 #include <gtk/gtk.h>
+#include "glib-compat.h"
 #include <math.h>
 #include <time.h>
 
@@ -644,11 +645,7 @@
         tmpTimeT = gnc_date_edit_get_date( gf->startDate );
         if ( NULL != outDate ) 
         {
-#ifdef HAVE_GLIB29
                 g_date_set_time_t( outDate, tmpTimeT );
-#else
-                g_date_set_time( outDate, tmpTimeT );
-#endif
         }
 
         if (NULL == fs) return;
@@ -661,11 +658,7 @@
         gnc_suspend_gui_refresh();
 
         g_date_clear (&gd, 1);
-#ifdef HAVE_GLIB29
         g_date_set_time_t( &gd, tmpTimeT );
-#else
-        g_date_set_time( &gd, tmpTimeT );
-#endif
 
         /*uift = xaccFreqSpecGetUIType( fs );*/
         uift = PAGES[page].uiFTVal;
@@ -703,11 +696,7 @@
                         /*  month-day += (week-day - current-week-day ) % 7 */
                         /*  week-day <- 0 */
                         stm.tm_mday -= ( stm.tm_wday ) % 7;
-#ifdef HAVE_GLIB29
                         g_date_set_time_t( &gd, mktime(&stm) );
-#else
-                        g_date_set_time( &gd, mktime(&stm) );
-#endif
                 }
 
                 /*  1 == "mon", 5 == "fri" */
@@ -731,11 +720,7 @@
                 /*  for-now hack: normalize to Sunday. */
                 g_date_to_struct_tm( &gd, &stm);
                 stm.tm_mday -= stm.tm_wday % 7;
-#ifdef HAVE_GLIB29
                 g_date_set_time_t( &gd, mktime(&stm) );
-#else
-                g_date_set_time( &gd, mktime(&stm) );
-#endif
 
                 /*  now, go through the check boxes and add composites based on that date. */
                 for ( i=0; CHECKBOX_NAMES[i]!=NULL; i++ ) {
@@ -781,11 +766,7 @@
                 }
                 /* else, this month */
                 stm.tm_mday = day;
-#ifdef HAVE_GLIB29
                 g_date_set_time_t( &gd, mktime( &stm) );
-#else
-                g_date_set_time( &gd, mktime( &stm) );
-#endif
                 xaccFreqSpecSetMonthly( tmpFS, &gd, tmpInt );
                 xaccFreqSpecCompositeAdd( fs, tmpFS );
 
@@ -793,11 +774,7 @@
                 day = gnc_option_menu_get_active( GTK_WIDGET(o) )+1;
                 tmpFS = xaccFreqSpecMalloc(gnc_get_current_book ());
                 tmpTimeT = gnc_date_edit_get_date( gf->startDate );
-#ifdef HAVE_GLIB29
                 g_date_set_time_t( &gd, tmpTimeT );
-#else
-                g_date_set_time( &gd, tmpTimeT );
-#endif
                 g_date_to_struct_tm( &gd, &stm);
                 if ( day >= stm.tm_mday ) {
                         /* next month */
@@ -805,11 +782,7 @@
                 }
                 /* else, this month */
                 stm.tm_mday = day;
-#ifdef HAVE_GLIB29
                 g_date_set_time_t( &gd, mktime( &stm ) );
-#else
-                g_date_set_time( &gd, mktime( &stm ) );
-#endif
                 xaccFreqSpecSetMonthly( tmpFS, &gd, tmpInt );
                 xaccFreqSpecCompositeAdd( fs, tmpFS );
 
@@ -825,11 +798,7 @@
                 o = glade_xml_get_widget( gf->gxml, "monthly_day" );
                 day = gnc_option_menu_get_active( GTK_WIDGET(o) ) + 1;
                 stm.tm_mday = day;
-#ifdef HAVE_GLIB29
                 g_date_set_time_t( &gd, mktime( &stm ) );
-#else
-                g_date_set_time( &gd, mktime( &stm ) );
-#endif
                 xaccFreqSpecSetMonthly( fs, &gd, tmpInt );
                 xaccFreqSpecSetUIType( fs, uift );
                 break;

Modified: gnucash/trunk/src/gnome-utils/gnc-period-select.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-period-select.c	2005-12-28 22:13:22 UTC (rev 12194)
+++ gnucash/trunk/src/gnome-utils/gnc-period-select.c	2005-12-29 03:16:57 UTC (rev 12195)
@@ -33,6 +33,7 @@
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
+#include "glib-compat.h"
 
 #include "gnc-date.h"
 #include "gnc-gconf-utils.h"
@@ -320,11 +321,7 @@
 
   if (show_date) {
     g_date_clear(&date, 1);
-#ifdef HAVE_GLIB29
     g_date_set_time_t(&date, time (NULL));
-#else
-    g_date_set_time(&date, time (NULL));
-#endif
     gnc_period_select_set_date_common(period, &date);
   } else {
     gnc_period_select_set_date_common(period, NULL);

Modified: gnucash/trunk/src/gnome-utils/gnc-recurrence.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-recurrence.c	2005-12-28 22:13:22 UTC (rev 12194)
+++ gnucash/trunk/src/gnome-utils/gnc-recurrence.c	2005-12-29 03:16:57 UTC (rev 12195)
@@ -25,6 +25,7 @@
 #include "config.h"
 
 #include <gnome.h>
+#include "glib-compat.h"
 #include <glade/glade.h>
 
 #include "dialog-utils.h"
@@ -131,11 +132,7 @@
 
     pt = get_pt_ui(gr);
     t = gnome_date_edit_get_time(gr->gde_start);
-#ifdef HAVE_GLIB29
     g_date_set_time_t(&start, t);
-#else
-    g_date_set_time(&start, t);
-#endif
 
     if (pt == GNCR_MONTH)
         g_object_set(G_OBJECT(gr->nth_weekday), "visible", TRUE, NULL);
@@ -243,11 +240,7 @@
 
     mult = (guint) gtk_spin_button_get_value_as_int(gr->gsb_mult);
     t = gnome_date_edit_get_time(gr->gde_start);
-#ifdef HAVE_GLIB29
     g_date_set_time_t(&start, t);
-#else
-    g_date_set_time(&start, t);
-#endif
     period = get_pt_ui(gr);
 
     switch (period) {



More information about the gnucash-changes mailing list