[Xfce4-commits] <ristretto:master> When clearing private data, use localtime

Stephan Arts noreply at xfce.org
Sat Sep 3 00:10:01 CEST 2011


Updating branch refs/heads/master
         to 857e80a658736edf5ac8a0d15f83390db8adc57c (commit)
       from 979e82ef5e5d0d6a5b516b4d43fb9316f88e8b59 (commit)

commit 857e80a658736edf5ac8a0d15f83390db8adc57c
Author: Stephan Arts <stephan at xfce.org>
Date:   Sat Sep 3 00:09:23 2011 +0200

    When clearing private data, use localtime
    
    Use localtime for 'today', to make sure the history of today is being
    cleared relative to the local timezone, not UTC.

 src/privacy_dialog.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/privacy_dialog.c b/src/privacy_dialog.c
index 55ccfb9..7191c10 100644
--- a/src/privacy_dialog.c
+++ b/src/privacy_dialog.c
@@ -406,6 +406,7 @@ static void
 cb_rstto_privacy_dialog_combobox_timeframe_changed (GtkComboBox *combobox, gpointer user_data)
 {
     RsttoPrivacyDialog *dialog = RSTTO_PRIVACY_DIALOG (user_data);
+    struct tm *time_info;
 
     switch (gtk_combo_box_get_active (combobox))
     {
@@ -419,7 +420,12 @@ cb_rstto_privacy_dialog_combobox_timeframe_changed (GtkComboBox *combobox, gpoin
             dialog->priv->time_offset = 14200;
             break;
         case 3:
-            dialog->priv->time_offset = (dialog->priv->time_now % 86400);
+            /* Convert to localtime */
+            time_info = localtime (&(dialog->priv->time_now));
+
+            dialog->priv->time_offset = (time_info->tm_hour * 3600) +
+                                        (time_info->tm_min * 60) + 
+                                        time_info->tm_sec;
             break;
         case 4:
             dialog->priv->time_offset = dialog->priv->time_now;


More information about the Xfce4-commits mailing list