* Add detection and dependency on libtime
* Store last updated in utc, and properly adapt it for display
* Fix am/pm calculation
pmo-trunk-r8750
+AC_CHECK_HEADERS([clockd/libtime.h], have_libtime=true, have_libtime=false)
+
+if test "x$have_libtime" == "xtrue"; then
+ AC_DEFINE_UNQUOTED(MODEST_USE_LIBTIME, 1, ["use libtime API"])
+ MODEST_LIBTIME_LIBS=-ltime
+else
+ MODEST_LIBTIME_LIBS=
+fi
+AC_SUBST(MODEST_LIBTIME_LIBS)
#
# if we don't have an addressbook, use the dummy one
#
# if we don't have an addressbook, use the dummy one
if [ $gtk_html_found = "true" ]; then
echo "GtkHTML version : $gtk_html_version"
fi
if [ $gtk_html_found = "true" ]; then
echo "GtkHTML version : $gtk_html_version"
fi
+echo "Libtime : $have_libtime"
echo "CFLAGS : $CFLAGS"
echo "Debug version : $with_debug"
echo "CFLAGS : $CFLAGS"
echo "Debug version : $with_debug"
Maintainer: Dirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Build-Depends: debhelper (>= 4.0.0), cdbs, gnome-common, gtkhtml3.14-dev, libconic0-dev, libhildon1-dev, libdbus-1-dev,
libdbus-glib-1-dev, libebook-dev, osso-af-settings, libedataserver-dev, libhildonnotify-dev, libgconf2-dev,
Maintainer: Dirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Build-Depends: debhelper (>= 4.0.0), cdbs, gnome-common, gtkhtml3.14-dev, libconic0-dev, libhildon1-dev, libdbus-1-dev,
libdbus-glib-1-dev, libebook-dev, osso-af-settings, libedataserver-dev, libhildonnotify-dev, libgconf2-dev,
- libglib2.0-dev, libosso-abook-dev, libosso-gnomevfs2-dev, libhildonmime-dev, libprofile-dev, libtinymail-1.0-0-dev, libtinymail-camel-1.0-0-dev,
+ libglib2.0-dev, libosso-abook-dev, libosso-gnomevfs2-dev, libhildonmime-dev, libprofile-dev, libtime-dev, libtinymail-1.0-0-dev, libtinymail-camel-1.0-0-dev,
libtinymail-maemo-1.0-0-dev, libtinymailui-1.0-0-dev, libtinymail-gnomevfs-1.0-0-dev, libtinymailui-gtk-1.0-0-dev, wpeditor0,
wpeditor-dev, modest-providers-data, libalarm-dev, gtk-doc-tools, libhildonnotify-dev, libnotify-dev,
microb-engine-dev, mce-dev, maemo-launcher-dev, profile-data-dev
libtinymail-maemo-1.0-0-dev, libtinymailui-1.0-0-dev, libtinymail-gnomevfs-1.0-0-dev, libtinymailui-gtk-1.0-0-dev, wpeditor0,
wpeditor-dev, modest-providers-data, libalarm-dev, gtk-doc-tools, libhildonnotify-dev, libnotify-dev,
microb-engine-dev, mce-dev, maemo-launcher-dev, profile-data-dev
$(MODEST_HILDON_HELP_LIBS) \
$(MODEST_HILDON_NOTIFY_LIBS) \
$(MODEST_OGS_LIBS) \
$(MODEST_HILDON_HELP_LIBS) \
$(MODEST_HILDON_NOTIFY_LIBS) \
$(MODEST_OGS_LIBS) \
+ $(MODEST_LIBTIME_LIBS) \
${easysetupmaybe} \
widgets/libmodest-widgets.la \
$(MODEST_TOOLKIT_DIR)/libmodest-ui.la
${easysetupmaybe} \
widgets/libmodest-widgets.la \
$(MODEST_TOOLKIT_DIR)/libmodest-ui.la
$(MODEST_HILDON_HELP_LIBS) \
$(MODEST_HILDON_NOTIFY_LIBS) \
$(MODEST_OGS_LIBS) \
$(MODEST_HILDON_HELP_LIBS) \
$(MODEST_HILDON_NOTIFY_LIBS) \
$(MODEST_OGS_LIBS) \
+ $(MODEST_LIBTIME_LIBS) \
${easysetupmaybe} \
libmodest.la)
${easysetupmaybe} \
libmodest.la)
#include "maemo/modest-osso-state-saving.h"
#include "modest-text-utils.h"
#include "modest-signal-mgr.h"
#include "maemo/modest-osso-state-saving.h"
#include "modest-text-utils.h"
#include "modest-signal-mgr.h"
+#ifdef MODEST_USE_LIBTIME
+#include <clockd/libtime.h>
+#endif
#define MODEST_MAIN_WINDOW_ACTION_GROUP_ADDITIONS "ModestMainWindowActionAdditions"
#define MODEST_MAIN_WINDOW_ACTION_GROUP_ADDITIONS "ModestMainWindowActionAdditions"
last_updated = modest_account_mgr_get_last_updated (modest_runtime_get_account_mgr (),
tny_account_get_id (account));
last_updated = modest_account_mgr_get_last_updated (modest_runtime_get_account_mgr (),
tny_account_get_id (account));
+#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
+
if (last_updated > 0)
last_updated_string = modest_text_utils_get_display_date(last_updated);
else
if (last_updated > 0)
last_updated_string = modest_text_utils_get_display_date(last_updated);
else
ModestDatetimeFormatterPrivate *priv;
const gchar *format_string = NULL;
gboolean is_pm;
ModestDatetimeFormatterPrivate *priv;
const gchar *format_string = NULL;
gboolean is_pm;
+ struct tm localtime_tm = {0, };
+ time_t date_copy;
g_return_val_if_fail (MODEST_IS_DATETIME_FORMATTER (self), NULL);
priv = MODEST_DATETIME_FORMATTER_GET_PRIVATE (self);
g_return_val_if_fail (MODEST_IS_DATETIME_FORMATTER (self), NULL);
priv = MODEST_DATETIME_FORMATTER_GET_PRIVATE (self);
-
- is_pm = (date / (60 * 60 * 12)) % 2;
+ date_copy = date;
+ localtime_r (&date_copy, &localtime_tm);
+ is_pm = (localtime_tm.tm_hour/12) % 2;
switch (priv->current_format) {
case DATETIME_FORMAT_12H:
switch (priv->current_format) {
case DATETIME_FORMAT_12H:
#include <libgnomevfs/gnome-vfs.h>
#include "modest-utils.h"
#include "modest-debug.h"
#include <libgnomevfs/gnome-vfs.h>
#include "modest-utils.h"
#include "modest-debug.h"
+#ifdef MODEST_USE_LIBTIME
+#include <clockd/libtime.h>
+#endif
ModestAccountRetrieveType retrieve_type;
TnyList *new_headers = NULL;
gboolean headers_only, ignore_limit;
ModestAccountRetrieveType retrieve_type;
TnyList *new_headers = NULL;
gboolean headers_only, ignore_limit;
info = (UpdateAccountInfo *) user_data;
priv = MODEST_MAIL_OPERATION_GET_PRIVATE (info->mail_op);
info = (UpdateAccountInfo *) user_data;
priv = MODEST_MAIL_OPERATION_GET_PRIVATE (info->mail_op);
}
/* Set the last updated as the current time */
}
/* Set the last updated as the current time */
- modest_account_mgr_set_last_updated (mgr, tny_account_get_id (priv->account), time (NULL));
+#ifdef MODEST_USE_LIBTIME
+ struct tm utc_tm;
+ time_get_utc (&utc_tm);
+ time_to_store = time_mktime (&utc_tm, "GMT");
+#else
+ time_to_store = time (NULL);
+#endif
+ modest_account_mgr_set_last_updated (mgr, tny_account_get_id (priv->account), time_to_store);
/* Get the message max size */
max_size = modest_conf_get_int (modest_runtime_get_conf (),
/* Get the message max size */
max_size = modest_conf_get_int (modest_runtime_get_conf (),
#ifdef MODEST_TOOLKIT_HILDON2
#include <hildon/hildon-defines.h>
#endif
#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);
/* 'private'/'protected' functions */
static void modest_account_view_class_init (ModestAccountViewClass *klass);
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);
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)) {
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)) {