[gnome-control-center] datetime: We shouldn't have to know where TZ files live
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] datetime: We shouldn't have to know where TZ files live
- Date: Wed, 8 Dec 2010 14:32:29 +0000 (UTC)
commit 6e7195571743810c4da4146d7255489fd68218e8
Author: Bastien Nocera <hadess hadess net>
Date: Wed Dec 8 14:30:45 2010 +0000
datetime: We shouldn't have to know where TZ files live
That's a job for the backend to sort out.
panels/datetime/cc-datetime-panel.c | 6 +-----
panels/datetime/set-timezone.c | 15 +++++++--------
panels/datetime/set-timezone.h | 10 +---------
3 files changed, 9 insertions(+), 22 deletions(-)
---
diff --git a/panels/datetime/cc-datetime-panel.c b/panels/datetime/cc-datetime-panel.c
index 6435405..7d2f11e 100644
--- a/panels/datetime/cc-datetime-panel.c
+++ b/panels/datetime/cc-datetime-panel.c
@@ -257,7 +257,6 @@ apply_button_clicked_cb (GtkButton *button,
CcDateTimePanelPrivate *priv = self->priv;
guint mon, y, d;
time_t unixtime;
- gchar *filename;
GDateTime *old_date;
old_date = priv->date;
@@ -278,10 +277,7 @@ apply_button_clicked_cb (GtkButton *button,
if (priv->current_location)
{
- filename = g_build_filename (SYSTEM_ZONEINFODIR,
- priv->current_location->zone,
- NULL);
- set_system_timezone_async (filename, (GFunc) set_timezone_cb, self, NULL);
+ set_system_timezone_async (priv->current_location->zone, (GFunc) set_timezone_cb, self, NULL);
}
}
diff --git a/panels/datetime/set-timezone.c b/panels/datetime/set-timezone.c
index 57f56fe..74a339d 100644
--- a/panels/datetime/set-timezone.c
+++ b/panels/datetime/set-timezone.c
@@ -148,7 +148,7 @@ typedef struct {
gint ref_count;
gchar *call;
gint64 time;
- gchar *filename;
+ gchar *tz;
GFunc callback;
gpointer data;
GDestroyNotify notify;
@@ -163,7 +163,7 @@ free_data (gpointer d)
if (data->ref_count == 0) {
if (data->notify)
data->notify (data->data);
- g_free (data->filename);
+ g_free (data->tz);
g_free (data);
}
}
@@ -241,7 +241,7 @@ set_time_async (SetTimeCallbackData *data)
data, free_data,
INT_MAX,
/* parameters: */
- G_TYPE_STRING, data->filename,
+ G_TYPE_STRING, data->tz,
G_TYPE_INVALID,
/* return values: */
G_TYPE_INVALID);
@@ -262,7 +262,7 @@ set_system_time_async (gint64 time,
data->ref_count = 1;
data->call = "SetTime";
data->time = time;
- data->filename = NULL;
+ data->tz = NULL;
data->callback = callback;
data->data = d;
data->notify = notify;
@@ -272,21 +272,20 @@ set_system_time_async (gint64 time,
}
void
-set_system_timezone_async (const gchar *filename,
+set_system_timezone_async (const gchar *tz,
GFunc callback,
gpointer d,
GDestroyNotify notify)
{
SetTimeCallbackData *data;
- if (filename == NULL)
- return;
+ g_return_if_fail (tz != NULL);
data = g_new0 (SetTimeCallbackData, 1);
data->ref_count = 1;
data->call = "SetTimezone";
data->time = -1;
- data->filename = g_strdup (filename);
+ data->tz = g_strdup (tz);
data->callback = callback;
data->data = d;
data->notify = notify;
diff --git a/panels/datetime/set-timezone.h b/panels/datetime/set-timezone.h
index bea433e..718aaad 100644
--- a/panels/datetime/set-timezone.h
+++ b/panels/datetime/set-timezone.h
@@ -41,17 +41,9 @@ void set_system_time_async (gint64 time,
gpointer data,
GDestroyNotify notify);
-void set_system_timezone_async (const gchar *filename,
+void set_system_timezone_async (const gchar *tz,
GFunc callback,
gpointer data,
GDestroyNotify notify);
-
-
-#ifdef HAVE_SOLARIS
-#define SYSTEM_ZONEINFODIR "/usr/share/lib/zoneinfo/tab"
-#else
-#define SYSTEM_ZONEINFODIR "/usr/share/zoneinfo"
-#endif
-
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]