gnucash master: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Sun May 8 19:58:47 EDT 2016


Updated	 via  https://github.com/Gnucash/gnucash/commit/d7a77a3a (commit)
	 via  https://github.com/Gnucash/gnucash/commit/fab69c29 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/e8149475 (commit)
	from  https://github.com/Gnucash/gnucash/commit/c739f4fa (commit)



commit d7a77a3a5fab98080faf98b80214a7c096e6c4d3
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sat May 7 11:34:25 2016 +0100

    Update Transaction unit test date internal
    
    Update this test to use strftime so the format can be specified as ctime
    was using a space in front of the month number. Also add a '\n' to the
    end of msg2 as the PINFO in Transaction.c line 1940 has one.

diff --git a/src/engine/test/utest-Transaction.cpp b/src/engine/test/utest-Transaction.cpp
index 0b32bbe..dcdac4d 100644
--- a/src/engine/test/utest-Transaction.cpp
+++ b/src/engine/test/utest-Transaction.cpp
@@ -417,9 +417,14 @@ test_gnc_transaction_set_get_property (Fixture *fixture, gconstpointer pData)
                           "GNR", "", 240), *t_curr = NULL;
     Timespec now = timespec_now (), *t_entered = NULL, *t_posted = NULL;
     time_t secs = (time_t)now.tv_sec;
+
+    char buff[80];
+    strftime (buff, 80, "%a %b %d %H:%M:%S %Y", localtime(&secs));
+
     auto msg1 = "g_object_set_valist: object class " _Q "Transaction' has no property named " _Q "bogus'";
-    auto msg2 = g_strdup_printf ("[xaccTransSetDateInternal] addr=%p set date to %" G_GUINT64_FORMAT ".%09ld %s",
-                                   txn, now.tv_sec, now.tv_nsec, ctime (&secs));
+    auto msg2 = g_strdup_printf ("[xaccTransSetDateInternal] addr=%p set date to %" G_GUINT64_FORMAT ".%09ld %s\n",
+                                   txn, now.tv_sec, now.tv_nsec, buff);
+
     auto loglevel1 = static_cast<GLogLevelFlags>(G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL);
     auto loglevel2 =static_cast<GLogLevelFlags>(G_LOG_LEVEL_INFO);
     auto check1 = test_error_struct_new ("GLib-GObject", loglevel1, msg1);
diff --git a/src/libqof/qof/test/test-gnc-date.c b/src/libqof/qof/test/test-gnc-date.c
index 9841d6f..712a8f2 100644
--- a/src/libqof/qof/test/test-gnc-date.c
+++ b/src/libqof/qof/test/test-gnc-date.c
@@ -321,13 +321,15 @@ test_gnc_ctime (void)
     guint ind;
     for (ind = 0; ind < G_N_ELEMENTS (secs); ind++)
     {
-         time_t time;
-         char *datestr;
+	time_t time;
+	char *datestr;
+	char check_str[80];
         if (secs[ind] < INT32_MIN)
             continue;
         time = (time_t)secs[ind];
         datestr = gnc_ctime (&secs[ind]);
-        g_assert_cmpstr (datestr, ==, strtok(ctime(&time), "\n"));
+	strftime (check_str, 80, "%a %b %d %H:%M:%S %Y", localtime(&time));
+        g_assert_cmpstr (datestr, ==, check_str);
         g_free (datestr);
     }
 }

commit fab69c29a88a92d0e7577e044809b6b19f54f63c
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu May 5 16:23:52 2016 +0100

    Date format using strftime under windows.
    
    strftime under windows does not support the %e or %P flags so change
    them to %d and %p respectively.

diff --git a/src/gnome-utils/gnc-main-window.c b/src/gnome-utils/gnc-main-window.c
index 6a60b26..65145df 100644
--- a/src/gnome-utils/gnc-main-window.c
+++ b/src/gnome-utils/gnc-main-window.c
@@ -1646,12 +1646,10 @@ static gchar *generate_statusbar_lastmodified_message()
                     the status bar after opening a file: The date and time of
                     last modification. The string is a format string using
                     boost::date_time's format flags, see the boost docs for an
-                    explanation of the modifiers. First string is for a locale
-                    that has the a.m. or p.m. string in its locale, second
-                    string is for locales that do not have that string. */
+                    explanation of the modifiers. */
                     char *time_string =
 			gnc_print_time64(statbuf.st_mtime,
-					 _("Last modified on %a, %b %e, %Y at %I:%M%P"));
+					 _("Last modified on %a, %b %d, %Y at %I:%M %p"));
                     //g_warning("got time %ld, str=%s\n", mtime, time_string);
                     /* Translators: This message appears in the status bar after opening the file. */
                     message = g_strdup_printf(_("File %s opened. %s"),
diff --git a/src/libqof/qof/gnc-date.cpp b/src/libqof/qof/gnc-date.cpp
index 90b6c9f..4d2691e 100644
--- a/src/libqof/qof/gnc-date.cpp
+++ b/src/libqof/qof/gnc-date.cpp
@@ -231,7 +231,7 @@ gnc_timegm (struct tm* time)
 char*
 gnc_ctime (const time64 *secs)
 {
-    return gnc_print_time64(*secs, "%a %b %e %H:%M:%S %Y");
+    return gnc_print_time64(*secs, "%a %b %d %H:%M:%S %Y");
 }
 
 time64

commit e81494756ec606a10f97229248490b762e104b9c
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu May 5 16:19:11 2016 +0100

    Gnucash on Windows will not start.
    
    in the TimeZoneProvider function load_windows_classic_tz make_pair
    should of used max_year as the first parameter.

diff --git a/src/libqof/qof/gnc-timezone.cpp b/src/libqof/qof/gnc-timezone.cpp
index 676456e..5e72612 100644
--- a/src/libqof/qof/gnc-timezone.cpp
+++ b/src/libqof/qof/gnc-timezone.cpp
@@ -227,7 +227,7 @@ TimeZoneProvider::load_windows_classic_tz (HKEY key, time_zone_names names)
 			      (LPBYTE) &regtzi, &size) == ERROR_SUCCESS)
 	{
 	    zone_vector.push_back(
-		std::make_pair(0, zone_from_regtzi (regtzi, names)));
+		std::make_pair(max_year, zone_from_regtzi (regtzi, names)));
 	}
     }
     catch (std::bad_alloc)



Summary of changes:
 src/engine/test/utest-Transaction.cpp | 9 +++++++--
 src/gnome-utils/gnc-main-window.c     | 6 ++----
 src/libqof/qof/gnc-date.cpp           | 2 +-
 src/libqof/qof/gnc-timezone.cpp       | 2 +-
 src/libqof/qof/test/test-gnc-date.c   | 8 +++++---
 5 files changed, 16 insertions(+), 11 deletions(-)



More information about the gnucash-changes mailing list