[Gnucash-changes] r12185 - gnucash/trunk - Update to compile cleanly on a glib 2.9 system without using

David Hampton hampton at cvs.gnucash.org
Tue Dec 27 12:20:21 EST 2005


Author: hampton
Date: 2005-12-27 12:20:19 -0500 (Tue, 27 Dec 2005)
New Revision: 12185
Trac: http://svn.gnucash.org/trac/changeset/12185

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/configure.in
   gnucash/trunk/lib/libqof/qof/guid.c
   gnucash/trunk/src/app-utils/gnc-accounting-period.c
   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-plugin-manager.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:
Update to compile cleanly on a glib 2.9 system without using
deprecated functions.  Change the default so that glib deprecated
functions are not allowed with glib <= 2.10.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2005-12-27 15:41:07 UTC (rev 12184)
+++ gnucash/trunk/ChangeLog	2005-12-27 17:20:19 UTC (rev 12185)
@@ -1,3 +1,27 @@
+2005-12-27  David Hampton  <hampton at employees.org>
+
+	* 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/gnome-utils/gnc-plugin-manager.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.c:
+	* lib/libqof/qof/guid.c: Update to compile cleanly on a glib
+	2.9/2.10 system without using deprecated functions.
+
+	* configure.in: Detect a glib 2.9 system and set appropriate
+	flags.  Change the default so that glib deprecated functions are
+	not allowed with glib <= 2.10.  Add arguments to allow disabling
+	deprecated gdk functions.
+
 2005-12-27  Derek Atkins  <derek at ihtfp.com>
 
 	* lib/goffice-0.0.4/plugins/plot_radar/gog-radar.c:

Modified: gnucash/trunk/configure.in
===================================================================
--- gnucash/trunk/configure.in	2005-12-27 15:41:07 UTC (rev 12184)
+++ gnucash/trunk/configure.in	2005-12-27 17:20:19 UTC (rev 12185)
@@ -136,6 +136,24 @@
 fi
 AM_CONDITIONAL(HAVE_GLIB26, test "x$HAVE_GLIB26" = "xyes" )
 
+AC_MSG_CHECKING(for GLIB - version >= 2.9.0)
+if $PKG_CONFIG 'glib-2.0 >= 2.9.0'
+then
+  AC_MSG_RESULT(yes)
+  AC_DEFINE(HAVE_GLIB29,1,[System has glib 2.9.0 or better])
+  HAVE_GLIB29=yes
+else
+  AC_MSG_RESULT(no)
+fi
+AC_MSG_CHECKING([for untested GLIB versions (glib >= 2.11.0)])
+if $PKG_CONFIG 'glib-2.0 >= 2.11.0'
+then
+  AC_MSG_RESULT(yes)
+  HAVE_UNTESTED_GLIB=yes
+else
+  AC_MSG_RESULT(no)
+fi
+
 AC_CHECK_HEADERS(dlfcn.h dl.h utmp.h locale.h mcheck.h unistd.h wctype.h)
 
 DL_LIB=
@@ -1257,32 +1275,6 @@
 ### --------------------------------------------------------------------------
 ### Variables
 ### Set up all the initial variable values...
-AC_ARG_ENABLE(deprecated-glib,
-  [  --disable-deprecated-glib    don't use deprecated glib functions],
-  [case "${enableval}" in
-        no) AC_DEFINE(G_DISABLE_DEPRECATED,1,
-          [Don't use deprecated glib functions]) ;;
-        yes) ;;
-        *) AC_MSG_ERROR(bad value ${enableval} for --enable-deprecated-glib) ;;
-        esac])
-AC_ARG_ENABLE(deprecated-gtk,
-  [  --disable-deprecated-gtk     don't use deprecated gtk functions],
-  [case "${enableval}" in
-        no) AC_DEFINE(GTK_DISABLE_DEPRECATED,1,
-          [Don't use deprecated gtk functions]) ;;
-        yes) ;;
-        *) AC_MSG_ERROR(bad value ${enableval} for --enable-deprecated-gtk) ;;
-        esac])
-AC_ARG_ENABLE(deprecated-gnome,
-  [  --disable-deprecated-gnome   don't use deprecated gnome functions],
-  [case "${enableval}" in
-        no) AC_DEFINE(GNOME_DISABLE_DEPRECATED,1,
-          [Don't use deprecated gnome functions]) ;;
-        yes) ;;
-        *) AC_MSG_ERROR(bad value ${enableval} for --enable-deprecated-gnome) ;;
-        esac])
-
-
 AC_ARG_ENABLE(opt-style-install,
   [  --enable-opt-style-install   install everything in subdirs of --prefix],
   [case "${enableval}" in
@@ -1759,12 +1751,14 @@
     AS_SCRUB_INCLUDE(GTK_CFLAGS)
     AC_SUBST(GTK_CFLAGS)
     AC_SUBST(GTK_LIBS)
+    HAVE_UNTESTED_GDK=yes
+    HAVE_UNTESTED_GTK=yes
 
     PKG_CHECK_MODULES(GNOME, libgnomeui-2.0 >= 2.4)
     AS_SCRUB_INCLUDE(GNOME_CFLAGS)
-
     AC_SUBST(GNOME_CFLAGS)
     AC_SUBST(GNOME_LIBS)
+    HAVE_UNTESTED_GNOME=yes
 
     PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0)
     AS_SCRUB_INCLUDE(GDK_PIXBUF_CFLAGS)
@@ -1854,6 +1848,85 @@
 fi
 
 ###-------------------------------------------------------------------------
+### Selectively disable deprecated bits of glib/gdk/gtk/gnome
+###-------------------------------------------------------------------------
+if test x${HAVE_UNTESTED_GLIB} = "xyes"
+then
+  allow_deprecated=true
+else
+  allow_deprecated=false
+fi
+AC_ARG_ENABLE(deprecated-glib,
+  [  --disable-deprecated-glib    don't use deprecated glib functions],
+  [case "${enableval}" in
+        no) allow_deprecated=false ;;
+        *)  allow_deprecated=true ;;
+        esac]
+  )
+if test x${allow_deprecated} != "xtrue"
+then
+  AC_DEFINE(G_DISABLE_DEPRECATED,1, [Don't use deprecated glib functions])
+fi
+
+
+if test x${HAVE_UNTESTED_GDK} = "xyes"
+then
+  allow_deprecated=true
+else
+  allow_deprecated=false
+fi
+AC_ARG_ENABLE(deprecated-gdk,
+  [  --disable-deprecated-gdk     don't use deprecated gdk functions],
+  [case "${enableval}" in
+        no) allow_deprecated=false ;;
+        *)  allow_deprecated=true ;;
+        esac]
+  )
+if test x${allow_deprecated} != "xtrue"
+then
+  AC_DEFINE(GDK_DISABLE_DEPRECATED,1, [Don't use deprecated gdk functions])
+  AC_DEFINE(GDK_PIXBUF_DISABLE_DEPRECATED,1, [Don't use deprecated gdk-pixbuf functions])
+fi
+
+
+if test x${HAVE_UNTESTED_GTK} = "xyes"
+then
+  allow_deprecated=true
+else
+  allow_deprecated=false
+fi
+AC_ARG_ENABLE(deprecated-gtk,
+  [  --disable-deprecated-gtk     don't use deprecated gtk functions],
+  [case "${enableval}" in
+        no) allow_deprecated=false ;;
+        *)  allow_deprecated=true ;;
+        esac]
+  )
+if test x${allow_deprecated} != "xtrue"
+then
+  AC_DEFINE(GTK_DISABLE_DEPRECATED,1, [Don't use deprecated gtk functions])
+fi
+
+
+if test x${HAVE_UNTESTED_GNOME} = "xyes"
+then
+  allow_deprecated=true
+else
+  allow_deprecated=false
+fi
+AC_ARG_ENABLE(deprecated-gnome,
+  [  --disable-deprecated-gnome   don't use deprecated gnome functions],
+  [case "${enableval}" in
+        no) allow_deprecated=false ;;
+        *)  allow_deprecated=true ;;
+        esac]
+  )
+if test x${allow_deprecated} != "xtrue"
+then
+  AC_DEFINE(GNOME_DISABLE_DEPRECATED,1, [Don't use deprecated gnome functions])
+fi
+
+###-------------------------------------------------------------------------
 ### Stuff from Mac OS X Port
 ###-------------------------------------------------------------------------
 

Modified: gnucash/trunk/lib/libqof/qof/guid.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/guid.c	2005-12-27 15:41:07 UTC (rev 12184)
+++ gnucash/trunk/lib/libqof/qof/guid.c	2005-12-27 17:20:19 UTC (rev 12185)
@@ -57,12 +57,30 @@
 /** Static global variables *****************************************/
 static gboolean guid_initialized = FALSE;
 static struct md5_ctx guid_context;
+#ifndef HAVE_GLIB29
 static GMemChunk *guid_memchunk = NULL;
+#endif
 
 /* This static indicates the debugging module that this .o belongs to.  */
 static QofLogModule log_module = QOF_MOD_ENGINE;
 
 /** Memory management routines ***************************************/
+#ifdef HAVE_GLIB29
+GUID *
+guid_malloc (void)
+{
+  return g_slice_new(GUID);
+}
+
+void
+guid_free (GUID *guid)
+{
+  if (!guid)
+    return;
+
+  g_slice_free(GUID, guid);
+}
+#else /* !HAVE_GLIB29 */
 static void
 guid_memchunk_init (void)
 {
@@ -95,6 +113,7 @@
 
   g_chunk_free (guid, guid_memchunk);
 }
+#endif
 
 
 const GUID *
@@ -449,7 +468,9 @@
 void 
 guid_shutdown (void)
 {
+#ifndef HAVE_GLIB29
 	guid_memchunk_shutdown();
+#endif
 }
 
 #define GUID_PERIOD 5000

Modified: gnucash/trunk/src/app-utils/gnc-accounting-period.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-accounting-period.c	2005-12-27 15:41:07 UTC (rev 12184)
+++ gnucash/trunk/src/app-utils/gnc-accounting-period.c	2005-12-27 17:20:19 UTC (rev 12185)
@@ -58,7 +58,11 @@
 			  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) {
@@ -146,7 +150,11 @@
 			  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/engine/FreqSpec.c
===================================================================
--- gnucash/trunk/src/engine/FreqSpec.c	2005-12-27 15:41:07 UTC (rev 12184)
+++ gnucash/trunk/src/engine/FreqSpec.c	2005-12-27 17:20:19 UTC (rev 12185)
@@ -1296,7 +1296,11 @@
 	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-27 15:41:07 UTC (rev 12184)
+++ gnucash/trunk/src/engine/Recurrence.c	2005-12-27 17:20:19 UTC (rev 12185)
@@ -63,10 +63,15 @@
     r->ptype = VALID_PERIOD_TYPE(pt) ? pt : PERIOD_MONTH;
     r->mult = (pt == PERIOD_ONCE) ? 0 : (mult > 0 ? mult : 1);
 
-    if (_start && g_date_valid(_start))
+    if (_start && g_date_valid(_start)) {
         r->start = *_start;
-    else
+    } 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
        types, we ensure that the start date agrees with that phase. */

Modified: gnucash/trunk/src/gnome/dialog-scheduledxaction.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-scheduledxaction.c	2005-12-27 15:41:07 UTC (rev 12184)
+++ gnucash/trunk/src/gnome/dialog-scheduledxaction.c	2005-12-27 17:20:19 UTC (rev 12185)
@@ -471,9 +471,15 @@
                                 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;
@@ -970,9 +976,15 @@
 
                 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
@@ -1027,9 +1039,15 @@
 
                 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 );
@@ -1755,7 +1773,11 @@
         /* 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-27 15:41:07 UTC (rev 12184)
+++ gnucash/trunk/src/gnome/dialog-sx-from-trans.c	2005-12-27 17:20:19 UTC (rev 12185)
@@ -185,7 +185,11 @@
     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;
   }
     
@@ -421,7 +425,11 @@
   /* 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 );
@@ -474,7 +482,11 @@
   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 );
@@ -596,7 +608,11 @@
   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-27 15:41:07 UTC (rev 12184)
+++ gnucash/trunk/src/gnome/dialog-sxsincelast.c	2005-12-27 17:20:19 UTC (rev 12185)
@@ -2131,7 +2131,11 @@
                         sx_state = NULL;
                 }
 
-                g_date_set_time( &end, time(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-27 15:41:07 UTC (rev 12184)
+++ gnucash/trunk/src/gnome/druid-acct-period.c	2005-12-27 17:20:19 UTC (rev 12185)
@@ -223,7 +223,11 @@
   g_date_clear (&date_now, 1);
   nperiods = 0;
   period_end = info->closing_date;
-  g_date_set_time (&date_now, time(0));
+#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 ))
   {
@@ -360,7 +364,11 @@
   }
 
   g_date_clear (&date_now, 1);
-  g_date_set_time (&date_now, time(0));
+#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 "
@@ -460,7 +468,7 @@
   xaccFreqSpecGetNextInstance (info->period, &info->prev_closing_date, &info->closing_date);
 
   /* If the next closing date is in the future, then we are done. */
-  if (time(0) < gnc_timet_get_day_end_gdate (&info->closing_date))
+  if (time(NULL) < gnc_timet_get_day_end_gdate (&info->closing_date))
   {
     return FALSE;
   }
@@ -530,7 +538,11 @@
                   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-27 15:41:07 UTC (rev 12184)
+++ gnucash/trunk/src/gnome/druid-loan.c	2005-12-27 17:20:19 UTC (rev 12185)
@@ -810,7 +810,11 @@
         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 );
@@ -2484,8 +2488,13 @@
 
         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 );
         }
@@ -2553,7 +2562,11 @@
         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 );
 }
 
@@ -2564,12 +2577,20 @@
         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;
@@ -2577,10 +2598,17 @@
                 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-27 15:41:07 UTC (rev 12184)
+++ gnucash/trunk/src/gnome-utils/dialog-utils.c	2005-12-27 17:20:19 UTC (rev 12185)
@@ -596,7 +596,11 @@
         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-27 15:41:07 UTC (rev 12184)
+++ gnucash/trunk/src/gnome-utils/gnc-dense-cal.c	2005-12-27 17:20:19 UTC (rev 12185)
@@ -362,7 +362,11 @@
                 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-27 15:41:07 UTC (rev 12184)
+++ gnucash/trunk/src/gnome-utils/gnc-frequency.c	2005-12-27 17:20:19 UTC (rev 12185)
@@ -644,7 +644,11 @@
         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;
@@ -657,7 +661,11 @@
         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;
@@ -695,7 +703,11 @@
                         /*  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" */
@@ -719,7 +731,11 @@
                 /*  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++ ) {
@@ -765,7 +781,11 @@
                 }
                 /* 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 );
 
@@ -773,7 +793,11 @@
                 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 */
@@ -781,7 +805,11 @@
                 }
                 /* 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 );
 
@@ -797,7 +825,11 @@
                 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-27 15:41:07 UTC (rev 12184)
+++ gnucash/trunk/src/gnome-utils/gnc-period-select.c	2005-12-27 17:20:19 UTC (rev 12185)
@@ -320,7 +320,11 @@
 
   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-plugin-manager.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-plugin-manager.c	2005-12-27 15:41:07 UTC (rev 12184)
+++ gnucash/trunk/src/gnome-utils/gnc-plugin-manager.c	2005-12-27 17:20:19 UTC (rev 12185)
@@ -193,7 +193,7 @@
 					      G_SIGNAL_RUN_FIRST,
 					      G_STRUCT_OFFSET (GncPluginManagerClass, plugin_added),
 					      NULL, NULL,
-					      g_cclosure_marshal_VOID__POINTER,
+					      g_cclosure_marshal_VOID__OBJECT,
 					      G_TYPE_NONE,
 					      1,
 					      GNC_TYPE_PLUGIN);
@@ -202,7 +202,7 @@
 						G_SIGNAL_RUN_FIRST,
 						G_STRUCT_OFFSET (GncPluginManagerClass, plugin_removed),
 						NULL, NULL,
-						g_cclosure_marshal_VOID__POINTER,
+						g_cclosure_marshal_VOID__OBJECT,
 						G_TYPE_NONE,
 						1,
 						GNC_TYPE_PLUGIN);

Modified: gnucash/trunk/src/gnome-utils/gnc-recurrence.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-recurrence.c	2005-12-27 15:41:07 UTC (rev 12184)
+++ gnucash/trunk/src/gnome-utils/gnc-recurrence.c	2005-12-27 17:20:19 UTC (rev 12185)
@@ -131,7 +131,11 @@
 
     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);
@@ -239,7 +243,11 @@
 
     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