Changes to fix NB#110512
[modest] / src / widgets / modest-account-view.c
index a990788..88e5739 100644 (file)
@@ -47,6 +47,9 @@
 #ifdef MODEST_TOOLKIT_HILDON2
 #include <hildon/hildon-defines.h>
 #endif
+#ifdef MODEST_USE_LIBTIME
+#include <clockd/libtime.h>
+#endif
 
 /* 'private'/'protected' functions */
 static void modest_account_view_class_init    (ModestAccountViewClass *klass);
@@ -208,6 +211,16 @@ get_last_updated_string(ModestAccountView *self, ModestAccountMgr* account_mgr,
        server_settings = modest_account_settings_get_store_settings (settings);
        store_account_name = modest_server_account_settings_get_account_name (server_settings);
        last_updated = modest_account_mgr_get_last_updated (account_mgr, store_account_name);
+
+#ifdef MODEST_USE_LIBTIME
+       /* If we use libtime, we are storing the time in UTC so we have to convert to currently
+        * selected time */
+       time_t now;
+       struct tm *localtime_tm;
+       time (&now);
+       localtime_tm = localtime (&now);
+       last_updated -= time_get_utc_offset (localtime_tm->tm_zone);
+#endif
        g_object_unref (server_settings);
        account_name = modest_account_settings_get_account_name (settings);
        if (!modest_account_mgr_account_is_busy(account_mgr, account_name)) {