[libgweather/ebassi/clean-up-tz: 6/6] Remove year fields from GWeatherDb
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgweather/ebassi/clean-up-tz: 6/6] Remove year fields from GWeatherDb
- Date: Fri, 26 Nov 2021 20:40:21 +0000 (UTC)
commit 0f1fe5b5a41d4024008d314c81fc298e65fc7b33
Author: Emmanuele Bassi <ebassi gnome org>
Date: Tue Nov 23 23:11:52 2021 +0000
Remove year fields from GWeatherDb
They were used by the time zone parsing code, and that has been
removed, so we can remove them as well.
libgweather/gweather-private.c | 13 -------------
libgweather/gweather-private.h | 3 ---
2 files changed, 16 deletions(-)
---
diff --git a/libgweather/gweather-private.c b/libgweather/gweather-private.c
index d1110cd0..6df95c87 100644
--- a/libgweather/gweather-private.c
+++ b/libgweather/gweather-private.c
@@ -46,8 +46,6 @@ ensure_world (gpointer dummy G_GNUC_UNUSED)
g_autofree char *filename = NULL;
g_autoptr (GMappedFile) map;
const char *locations_path;
- time_t now;
- struct tm tm;
GWeatherDb *db = NULL;
locations_path = g_getenv ("LIBGWEATHER_LOCATIONS_PATH");
@@ -88,17 +86,6 @@ ensure_world (gpointer dummy G_GNUC_UNUSED)
g_ptr_array_set_size (db->locations, db_arrayof_location_get_length (db->locations_ref));
g_ptr_array_set_size (db->timezones, db_world_timezones_get_length (db->timezones_ref));
- /* Get timestamps for the start and end of this year.
- * This is used to parse timezone information. */
- now = time (NULL);
- tm = *gmtime (&now);
- tm.tm_mon = 0;
- tm.tm_mday = 1;
- tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
- db->year_start = mktime (&tm);
- tm.tm_year++;
- db->year_end = mktime (&tm);
-
world_db = db;
return db;
diff --git a/libgweather/gweather-private.h b/libgweather/gweather-private.h
index bb973a8a..d2ba299c 100644
--- a/libgweather/gweather-private.h
+++ b/libgweather/gweather-private.h
@@ -34,9 +34,6 @@ typedef struct {
GPtrArray *locations;
GPtrArray *timezones;
-
- time_t year_start;
- time_t year_end;
} GWeatherDb;
struct _GWeatherLocation {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]