aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2014-03-06 22:30:55 +0800
committerMilan Crha <mcrha@redhat.com>2014-03-06 22:30:55 +0800
commit3048de0d913db3a3ca16856e7b0c1e99512b22c5 (patch)
tree3a452318b2e79ab0aa9c2a75385332f271616559
parentddffaf3bcef9daf894e85911cd6179b9458ee502 (diff)
downloadgsoc2013-evolution-3048de0d913db3a3ca16856e7b0c1e99512b22c5.tar
gsoc2013-evolution-3048de0d913db3a3ca16856e7b0c1e99512b22c5.tar.gz
gsoc2013-evolution-3048de0d913db3a3ca16856e7b0c1e99512b22c5.tar.bz2
gsoc2013-evolution-3048de0d913db3a3ca16856e7b0c1e99512b22c5.tar.lz
gsoc2013-evolution-3048de0d913db3a3ca16856e7b0c1e99512b22c5.tar.xz
gsoc2013-evolution-3048de0d913db3a3ca16856e7b0c1e99512b22c5.tar.zst
gsoc2013-evolution-3048de0d913db3a3ca16856e7b0c1e99512b22c5.zip
Bug #711658 - Time zone for new events sometimes defaults to UTC
-rw-r--r--calendar/alarm-notify/alarm-queue.c2
-rw-r--r--calendar/gui/comp-util.c2
-rw-r--r--calendar/gui/itip-utils.c5
-rw-r--r--e-util/e-client-cache.c30
-rw-r--r--e-util/e-client-cache.h3
-rw-r--r--modules/settings/e-settings-client-cache.c8
6 files changed, 41 insertions, 9 deletions
diff --git a/calendar/alarm-notify/alarm-queue.c b/calendar/alarm-notify/alarm-queue.c
index 011b78794c..4b51f9e98f 100644
--- a/calendar/alarm-notify/alarm-queue.c
+++ b/calendar/alarm-notify/alarm-queue.c
@@ -803,7 +803,7 @@ get_alarms_for_object (ECalClient *cal_client,
*alarms = e_cal_util_generate_alarms_for_comp (
comp, start, end, omit, e_cal_client_resolve_tzid_cb,
- cal_client, e_cal_client_get_default_timezone (cal_client));
+ cal_client, config_data_get_timezone ());
g_object_unref (comp);
diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c
index a85bc921ea..16dfd5d85a 100644
--- a/calendar/gui/comp-util.c
+++ b/calendar/gui/comp-util.c
@@ -384,7 +384,7 @@ cal_comp_event_new_with_current_time (ECalClient *client,
default_reminder_interval, default_reminder_units);
g_return_val_if_fail (comp != NULL, NULL);
- zone = e_cal_client_get_default_timezone (client);
+ zone = calendar_config_get_icaltimezone ();
if (all_day) {
itt = icaltime_from_timet_with_zone (time (NULL), 1, zone);
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c
index 82c0392794..7190c05212 100644
--- a/calendar/gui/itip-utils.c
+++ b/calendar/gui/itip-utils.c
@@ -32,6 +32,7 @@
#include "itip-utils.h"
#include "dialogs/comp-editor-util.h"
+#include "calendar-config.h"
#define d(x)
@@ -1708,7 +1709,7 @@ itip_send_comp (ESourceRegistry *registry,
g_object_unref (settings);
- default_zone = e_cal_client_get_default_timezone (cal_client);
+ default_zone = calendar_config_get_icaltimezone ();
/* check whether backend could handle auto-saving requests/updates */
if (method != E_CAL_COMPONENT_METHOD_PUBLISH && e_cal_client_check_save_schedules (cal_client))
@@ -1855,7 +1856,7 @@ reply_to_calendar_comp (ESourceRegistry *registry,
/* FIXME Pass this in. */
shell = e_shell_get_default ();
- default_zone = e_cal_client_get_default_timezone (cal_client);
+ default_zone = calendar_config_get_icaltimezone ();
/* Tidy up the comp */
comp = comp_compliant (
diff --git a/e-util/e-client-cache.c b/e-util/e-client-cache.c
index 9aedf4e5e8..215c470a88 100644
--- a/e-util/e-client-cache.c
+++ b/e-util/e-client-cache.c
@@ -92,6 +92,7 @@ enum {
enum {
BACKEND_DIED,
BACKEND_ERROR,
+ CLIENT_CONNECTED,
CLIENT_CREATED,
CLIENT_NOTIFY,
LAST_SIGNAL
@@ -572,6 +573,8 @@ client_cache_process_results (ClientData *client_data,
0);
client_data->notify_handler_id = handler_id;
+ g_signal_emit (client_cache, signals[CLIENT_CONNECTED], 0, client);
+
signal_closure = g_slice_new0 (SignalClosure);
signal_closure->client_cache =
g_object_ref (client_cache);
@@ -886,12 +889,37 @@ e_client_cache_class_init (EClientCacheClass *class)
E_TYPE_ALERT);
/**
+ * EClientCache::client-connected:
+ * @client_cache: the #EClientCache that received the signal
+ * @client: the newly-created #EClient
+ *
+ * This signal is emitted when a call to e_client_cache_get_client()
+ * triggers the creation of a new #EClient instance, immediately after
+ * the client's opening phase is over.
+ *
+ * See the difference with EClientCache::client-created, which is
+ * called on idle.
+ **/
+ signals[CLIENT_CONNECTED] = g_signal_new (
+ "client-connected",
+ G_TYPE_FROM_CLASS (class),
+ G_SIGNAL_RUN_FIRST,
+ 0 /* G_STRUCT_OFFSET (EClientCacheClass, client_connected) */,
+ NULL, NULL, NULL,
+ G_TYPE_NONE, 1,
+ E_TYPE_CLIENT);
+
+ /**
* EClientCache::client-created:
* @client_cache: the #EClientCache that received the signal
* @client: the newly-created #EClient
*
* This signal is emitted when a call to e_client_cache_get_client()
- * triggers the creation of a new #EClient instance.
+ * triggers the creation of a new #EClient instance, invoked in an idle
+ * callback.
+ *
+ * See the difference with EClientCache::client-connected, which is
+ * called immediately.
**/
signals[CLIENT_CREATED] = g_signal_new (
"client-created",
diff --git a/e-util/e-client-cache.h b/e-util/e-client-cache.h
index bcb1e03c4b..c3c45ed261 100644
--- a/e-util/e-client-cache.h
+++ b/e-util/e-client-cache.h
@@ -76,6 +76,9 @@ struct _EClientCacheClass {
GParamSpec *pspec);
void (*client_created) (EClientCache *client_cache,
EClient *client);
+ /* Do not break ABI right now
+ void (*client_connected) (EClientCache *client_cache,
+ EClient *client); */
};
GType e_client_cache_get_type (void) G_GNUC_CONST;
diff --git a/modules/settings/e-settings-client-cache.c b/modules/settings/e-settings-client-cache.c
index 487ffe2388..419b660800 100644
--- a/modules/settings/e-settings-client-cache.c
+++ b/modules/settings/e-settings-client-cache.c
@@ -64,8 +64,8 @@ settings_map_string_to_icaltimezone (GValue *value,
}
static void
-settings_client_cache_client_created_cb (EClientCache *client_cache,
- EClient *client)
+settings_client_cache_client_connected_cb (EClientCache *client_cache,
+ EClient *client)
{
if (E_IS_CAL_CLIENT (client)) {
GSettings *settings;
@@ -94,8 +94,8 @@ settings_client_cache_constructed (GObject *object)
extensible = e_extension_get_extensible (extension);
g_signal_connect (
- extensible, "client-created",
- G_CALLBACK (settings_client_cache_client_created_cb),
+ extensible, "client-connected",
+ G_CALLBACK (settings_client_cache_client_connected_cb),
NULL);
}