r22622 - gnucash/trunk/src/business - Convert all time_t to time64:business

John Ralls jralls at code.gnucash.org
Sat Dec 1 17:45:03 EST 2012


Author: jralls
Date: 2012-12-01 17:45:03 -0500 (Sat, 01 Dec 2012)
New Revision: 22622
Trac: http://svn.gnucash.org/trac/changeset/22622

Modified:
   gnucash/trunk/src/business/business-gnome/dialog-invoice.c
   gnucash/trunk/src/business/business-gnome/dialog-order.c
   gnucash/trunk/src/business/business-gnome/gnc-plugin-business.c
   gnucash/trunk/src/business/business-ledger/gncEntryLedgerControl.c
   gnucash/trunk/src/business/business-ledger/gncEntryLedgerModel.c
Log:
Convert all time_t to time64:business

Modified: gnucash/trunk/src/business/business-gnome/dialog-invoice.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/dialog-invoice.c	2012-12-01 22:44:53 UTC (rev 22621)
+++ gnucash/trunk/src/business/business-gnome/dialog-invoice.c	2012-12-01 22:45:03 UTC (rev 22622)
@@ -32,6 +32,7 @@
 
 #include "qof.h"
 
+#include <gnc-gdate-utils.h>
 #include "dialog-utils.h"
 #include "gnc-component-manager.h"
 #include "gnc-ui.h"
@@ -849,7 +850,7 @@
                     gnc_price_begin_edit (convprice);
                     gnc_price_set_commodity (convprice, account_currency);
                     gnc_price_set_currency (convprice, gncInvoiceGetCurrency (invoice));
-                    date.tv_sec = time (NULL);
+                    date.tv_sec = gnc_time (NULL);
                     date.tv_nsec = 0;
                     gnc_price_set_time (convprice, date);
                     gnc_price_set_source (convprice, "user:invoice-post");
@@ -1687,7 +1688,8 @@
         ts = gncInvoiceGetDateOpened (invoice);
         if (timespec_equal (&ts, &ts_zero))
         {
-            gnc_date_edit_set_time (GNC_DATE_EDIT (iw->opened_date), time(NULL));
+            gnc_date_edit_set_time (GNC_DATE_EDIT (iw->opened_date),
+				    gnc_time (NULL));
         }
         else
         {
@@ -2190,12 +2192,12 @@
     }
 
     hbox = GTK_WIDGET (gtk_builder_get_object (builder, "page_date_opened_hbox"));
-    iw->opened_date = gnc_date_edit_new (time(NULL), FALSE, FALSE);
+    iw->opened_date = gnc_date_edit_new (gnc_time (NULL), FALSE, FALSE);
     gtk_widget_show(iw->opened_date);
     gtk_box_pack_start (GTK_BOX(hbox), iw->opened_date, TRUE, TRUE, 0);
 
     iw->posted_date_hbox = GTK_WIDGET (gtk_builder_get_object (builder, "date_posted_hbox"));
-    iw->posted_date = gnc_date_edit_new (time(NULL), FALSE, FALSE);
+    iw->posted_date = gnc_date_edit_new (gnc_time (NULL), FALSE, FALSE);
     gtk_widget_show(iw->posted_date);
     gtk_box_pack_start (GTK_BOX(iw->posted_date_hbox), iw->posted_date,
                         TRUE, TRUE, 0);
@@ -2445,7 +2447,7 @@
     iw->proj_job_box = GTK_WIDGET (gtk_builder_get_object (builder, "dialog_proj_job_hbox"));
 
     hbox = GTK_WIDGET (gtk_builder_get_object (builder, "dialog_date_opened_hbox"));
-    iw->opened_date = gnc_date_edit_new (time(NULL), FALSE, FALSE);
+    iw->opened_date = gnc_date_edit_new (gnc_time (NULL), FALSE, FALSE);
     gtk_widget_show(iw->opened_date);
     gtk_box_pack_start (GTK_BOX(hbox), iw->opened_date, TRUE, TRUE, 0);
 
@@ -2697,7 +2699,7 @@
         gboolean dialog_ok;
 
         // Default date: Today
-        g_date_set_time_t(&dup_user_data.date, time(NULL));
+        gnc_gdate_set_time64(&dup_user_data.date, gnc_time (NULL));
         dialog_ok = gnc_dup_date_dialog (NULL, _("Date of duplicated entries"), &dup_user_data.date);
         if (!dialog_ok)
         {
@@ -3046,7 +3048,7 @@
     QofIdType type = GNC_INVOICE_MODULE_NAME;
     Query *q;
     QofQueryPredData* pred_data;
-    time_t end_date;
+    time64 end_date;
     GList *res;
     gchar *message;
     DialogQueryView *dialog;
@@ -3096,7 +3098,7 @@
     pred_data = qof_query_int32_predicate (QOF_COMPARE_NEQ, GNC_INVOICE_CUST_CREDIT_NOTE);
     qof_query_add_term (q, g_slist_prepend(NULL, INVOICE_TYPE), pred_data, QOF_QUERY_AND);
 
-    end_date = time(NULL);
+    end_date = gnc_time (NULL);
     if (days_in_advance < 0)
         days_in_advance = 0;
     end_date += days_in_advance * 60 * 60 * 24;

Modified: gnucash/trunk/src/business/business-gnome/dialog-order.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/dialog-order.c	2012-12-01 22:44:53 UTC (rev 22621)
+++ gnucash/trunk/src/business/business-gnome/dialog-order.c	2012-12-01 22:45:03 UTC (rev 22622)
@@ -308,7 +308,7 @@
     message = _("Do you really want to close the order?");
     label = _("Close Date");
 
-    timespecFromTime_t (&ts, time(NULL));
+    timespecFromTime64 (&ts, gnc_time (NULL));
     if (!gnc_dialog_date_close_parented (ow->dialog, message, label, TRUE, &ts))
         return;
 
@@ -472,7 +472,8 @@
         ts = gncOrderGetDateOpened (order);
         if (timespec_equal (&ts, &ts_zero))
         {
-            gnc_date_edit_set_time (GNC_DATE_EDIT (ow->opened_date), time(NULL));
+            gnc_date_edit_set_time (GNC_DATE_EDIT (ow->opened_date),
+				    gnc_time (NULL));
         }
         else
         {
@@ -486,7 +487,8 @@
         ts = gncOrderGetDateClosed (order);
         if (timespec_equal (&ts, &ts_zero))
         {
-            gnc_date_edit_set_time (GNC_DATE_EDIT (ow->closed_date), time(NULL));
+            gnc_date_edit_set_time (GNC_DATE_EDIT (ow->closed_date),
+				    gnc_time (NULL));
             hide_cd = TRUE;
         }
         else

Modified: gnucash/trunk/src/business/business-gnome/gnc-plugin-business.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/gnc-plugin-business.c	2012-12-01 22:44:53 UTC (rev 22621)
+++ gnucash/trunk/src/business/business-gnome/gnc-plugin-business.c	2012-12-01 22:45:03 UTC (rev 22622)
@@ -987,7 +987,7 @@
     gncOwnerInitCustomer(owner, customer);
 
     // Create the Invoice
-    timespecFromTime_t(&now, time(NULL));
+    timespecFromTime64(&now, time(NULL));
     gncInvoiceSetID(invoice, "000012");
     gncInvoiceSetOwner(invoice, owner);
     gncInvoiceSetDateOpened(invoice, now);

Modified: gnucash/trunk/src/business/business-ledger/gncEntryLedgerControl.c
===================================================================
--- gnucash/trunk/src/business/business-ledger/gncEntryLedgerControl.c	2012-12-01 22:44:53 UTC (rev 22621)
+++ gnucash/trunk/src/business/business-ledger/gncEntryLedgerControl.c	2012-12-01 22:45:03 UTC (rev 22622)
@@ -89,7 +89,7 @@
     if (entry == blank_entry)
     {
         Timespec ts;
-        ts.tv_sec = time(NULL);
+        ts.tv_sec = gnc_time (NULL);
         ts.tv_nsec = 0;
         gncEntrySetDateEntered (blank_entry, ts);
 

Modified: gnucash/trunk/src/business/business-ledger/gncEntryLedgerModel.c
===================================================================
--- gnucash/trunk/src/business/business-ledger/gncEntryLedgerModel.c	2012-12-01 22:44:53 UTC (rev 22621)
+++ gnucash/trunk/src/business/business-ledger/gncEntryLedgerModel.c	2012-12-01 22:45:03 UTC (rev 22622)
@@ -579,7 +579,7 @@
     char string[1024];
     struct tm *tm;
     Timespec ts;
-    time_t tt;
+    time64 tt;
 
     cell = gnc_table_get_cell (ledger->table, virt_loc);
     if (!cell)
@@ -590,7 +590,7 @@
 
     gnc_date_cell_get_date ((DateCell *) cell, &ts);
     tt = ts.tv_sec;
-    tm = localtime (&tt);
+    tm = gnc_localtime (&tt);
     qof_strftime (string, sizeof(string), "%A %d %B %Y", tm);
 
     return g_strdup (string);



More information about the gnucash-changes mailing list