diff options
author | Ted Gould <ted@gould.cx> | 2012-02-17 16:15:25 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2012-02-17 16:15:25 -0600 |
commit | 52d15e402e4ada9c8f1ee1f4b7e3a9ada473772c (patch) | |
tree | bb80c652ef218150d4f8d7d9b604fccc404ab465 /libmap/test-timezone.c | |
parent | 09dcfec3e1305ed9ad26df78a9ff6c755ed08ece (diff) | |
parent | 59ade0a5dad1cb85f3576fc89c323a8baceb3a5e (diff) | |
download | ayatana-indicator-datetime-52d15e402e4ada9c8f1ee1f4b7e3a9ada473772c.tar.gz ayatana-indicator-datetime-52d15e402e4ada9c8f1ee1f4b7e3a9ada473772c.tar.bz2 ayatana-indicator-datetime-52d15e402e4ada9c8f1ee1f4b7e3a9ada473772c.zip |
Import upstream version 0.3.90
Diffstat (limited to 'libmap/test-timezone.c')
-rw-r--r-- | libmap/test-timezone.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/libmap/test-timezone.c b/libmap/test-timezone.c deleted file mode 100644 index c1935fd..0000000 --- a/libmap/test-timezone.c +++ /dev/null @@ -1,56 +0,0 @@ -#include <config.h> -#include <locale.h> - -#include "tz.h" - -int main (int argc, char **argv) -{ - TzDB *db; - GPtrArray *locs; - guint i; - char *pixmap_dir; - int retval = 0; - - setlocale (LC_ALL, ""); - - if (argc == 2) { - pixmap_dir = g_strdup (argv[1]); - } else if (argc == 1) { - pixmap_dir = g_strdup ("data/"); - } else { - g_message ("Usage: %s [PIXMAP DIRECTORY]", argv[0]); - return 1; - } - - db = tz_load_db (); - locs = tz_get_locations (db); - for (i = 0; i < locs->len ; i++) { - TzLocation *loc = locs->pdata[i]; - TzInfo *info; - char *filename, *path; - gdouble selected_offset; - char buf[16]; - - info = tz_info_from_location (loc); - selected_offset = tz_location_get_utc_offset (loc) - / (60.0*60.0) + ((info->daylight) ? -1.0 : 0.0); - - filename = g_strdup_printf ("timezone_%s.png", - g_ascii_formatd (buf, sizeof (buf), - "%g", selected_offset)); - path = g_build_filename (pixmap_dir, filename, NULL); - - if (g_file_test (path, G_FILE_TEST_IS_REGULAR) == FALSE) { - g_message ("File '%s' missing for zone '%s'", filename, loc->zone); - retval = 1; - } - - g_free (filename); - g_free (path); - tz_info_free (info); - } - tz_db_free (db); - g_free (pixmap_dir); - - return retval; -} |