[Xfce4-commits] <orage:master> 4.7.5.5: --enable-debug=full fixes
Juha Kautto
noreply at xfce.org
Wed Dec 23 12:06:02 CET 2009
Updating branch refs/heads/master
to 0b27934404b56cb57b1cdd6cdd062867314f1a14 (commit)
from 692c918d7fcfcc6d86dfd7da5ab7061a9ebe59d7 (commit)
commit 0b27934404b56cb57b1cdd6cdd062867314f1a14
Author: Juha Kautto <juha at xfce.org>
Date: Wed Dec 23 13:02:39 2009 +0200
4.7.5.5: --enable-debug=full fixes
Compiles now with --enable-debug=full.
Also fixed translation issues in Bug 6097.
configure.in.in | 2 +-
globaltime/gt_prefs.c | 1 +
globaltime/timezone_selection.c | 8 +-
libical/src/libical/vsnprintf.c | 4 +-
panel-plugin/orageclock.c | 763 ---------------------------------
panel-plugin/orageclock.desktop.in.in | 8 -
panel-plugin/orageclock.h | 79 ----
panel-plugin/timezone_selection.c | 8 +-
src/appointment.c | 10 +-
src/day-view.c | 15 +-
src/ical-code.c | 27 +-
src/ical-expimp.c | 2 +
src/parameters.c | 8 +-
src/reminder.c | 6 +-
src/timezone_selection.c | 17 +-
src/tz_zoneinfo_read.c | 24 +-
16 files changed, 63 insertions(+), 919 deletions(-)
diff --git a/configure.in.in b/configure.in.in
index 62150e7..fa4b3ef 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -9,7 +9,7 @@ dnl Written for Xfce by Juha Kautto <juha at xfce.org>
dnl
dnl Version information
-m4_define([orage_version], [4.7.5.4-git])
+m4_define([orage_version], [4.7.5.5-git])
m4_define([gtk_minimum_version], [2.10.0])
m4_define([xfce_minimum_version], [4.6.0])
diff --git a/globaltime/gt_prefs.c b/globaltime/gt_prefs.c
index b9b3cf2..a95dac8 100644
--- a/globaltime/gt_prefs.c
+++ b/globaltime/gt_prefs.c
@@ -32,6 +32,7 @@
#include <libxfce4util/libxfce4util.h>
#include "globaltime.h"
+#include "timezone_selection.h"
extern global_times_struct clocks;
diff --git a/globaltime/timezone_selection.c b/globaltime/timezone_selection.c
index f82eaa1..59a4dbe 100644
--- a/globaltime/timezone_selection.c
+++ b/globaltime/timezone_selection.c
@@ -80,7 +80,7 @@ static GtkTreeStore *tz_button_create_store(gboolean details
#define MAX_AREA_LENGTH 100
GtkTreeStore *store;
- GtkTreeIter iter1, iter2, main;
+ GtkTreeIter iter1, iter2, main_iter;
orage_timezone_array tz_a;
char area_old[MAX_AREA_LENGTH+2]; /*+2 = / + null */
char s_offset[100], s_country[100], s_changes[200], s_change[50]
@@ -106,7 +106,7 @@ static GtkTreeStore *tz_button_create_store(gboolean details
, CHANGES, " "
, COUNTRY, " "
, -1);
- main = iter1; /* need to remember that */
+ main_iter = iter1; /* need to remember that */
for (i=0; i < tz_a.count-2; i++) {
/* first check area */
@@ -118,7 +118,7 @@ static GtkTreeStore *tz_button_create_store(gboolean details
}
/* now tz_a.city[i][j] is either / or 0 which means not found / */
if (!tz_a.city[i][j]) { /* end of name = no are code */
- iter1 = main;
+ iter1 = main_iter;
}
else if (j < MAX_AREA_LENGTH) { /* new area, let's add it */
area_old[j] = 0;
@@ -131,7 +131,7 @@ static GtkTreeStore *tz_button_create_store(gboolean details
, COUNTRY, " "
, -1);
/* let's make sure we do not match accidentally to those
- * plain names on main level. We do this by adding / */
+ * plain names on main_iter level. We do this by adding / */
area_old[j++] = '/';
area_old[j] = 0;
}
diff --git a/libical/src/libical/vsnprintf.c b/libical/src/libical/vsnprintf.c
index 982920b..5933daa 100644
--- a/libical/src/libical/vsnprintf.c
+++ b/libical/src/libical/vsnprintf.c
@@ -164,9 +164,11 @@ snprintf(str, n, fmt, va_alist)
#else
/* ANSI C forbids an empty source file... */
-
+/* Juha 023.12.2009: does not get through compiler check when there is
+ function which is not used, commented it out
static void vsnprintf_dummy_func() {
vsnprintf_dummy_func();
}
+*/
#endif
diff --git a/panel-plugin/orageclock.c b/panel-plugin/orageclock.c
deleted file mode 100644
index 56c9a31..0000000
--- a/panel-plugin/orageclock.c
+++ /dev/null
@@ -1,763 +0,0 @@
-/* vim: set expandtab ts=4 sw=4: */
-/*
- *
- * Copyright © 2006-2007 Juha Kautto <juha at xfce.org>
- *
- * it under the terms of the GNU Library General Public License as published
- * by the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Authors:
- * Juha Kautto <juha at xfce.org>
- * Based on XFce panel plugin clock and date-time plugin
- */
-
-#include <config.h>
-#include <sys/stat.h>
-#include <memory.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
-
-#include <glib.h>
-#include <gtk/gtk.h>
-#include <gdk/gdkevents.h>
-
-#include <libxfce4util/libxfce4util.h>
-#include <libxfcegui4/libxfcegui4.h>
-#include <libxfce4panel/xfce-panel-plugin.h>
-
-#include "orageclock.h"
-
-/* -------------------------------------------------------------------- *
- * Clock *
- * -------------------------------------------------------------------- */
-
-static void utf8_strftime(char *res, int res_l, char *format, struct tm *tm)
-{
- char *tmp = NULL;
-
- /* strftime is nasty. It returns formatted characters (%A...) in utf8
- * but it does not convert plain characters so they will be in locale
- * charset.
- * It expects format to be in locale charset, so we need to convert
- * that first (it may contain utf8).
- * We need then convert the results finally to utf8.
- * */
- tmp = g_locale_from_utf8(format, -1, NULL, NULL, NULL);
- strftime(res, res_l, tmp, tm);
- g_free(tmp);
- /* Then convert to utf8 if needed */
- if (!g_utf8_validate(res, -1, NULL)) {
- tmp = g_locale_to_utf8(res, -1, NULL, NULL, NULL);
- if (tmp) {
- g_strlcpy(res, tmp, res_l);
- g_free(tmp);
- }
- }
-}
-
-static void oc_tooltip_set(Clock *clock)
-{
- char res[OC_MAX_LINE_LENGTH-1];
-
- utf8_strftime(res, sizeof(res), clock->tooltip_data->str, &clock->now);
- if (strcmp(res, clock->tooltip_prev)) {
- gtk_tooltips_set_tip(clock->tips, GTK_WIDGET(clock->plugin),res, NULL);
- strcpy(clock->tooltip_prev, res);
- }
-}
-
-static gboolean oc_get_time(Clock *clock)
-{
- time_t t;
- char res[OC_MAX_LINE_LENGTH-1];
- int i;
- ClockLine *line;
-
- time(&t);
- localtime_r(&t, &clock->now);
- for (i = 0; i < OC_MAX_LINES; i++) {
- line = &clock->line[i];
- if (line->show) {
- utf8_strftime(res, sizeof(res), line->data->str, &clock->now);
- /* gtk_label_set_text call takes almost
- * 100 % of the time wasted in this procedure
- * Note that even though we only wake up when needed, we
- * may not have to update all lines, so this check still
- * probably is worth doing. Specially after we added the
- * hibernate update option.
- * */
- if (strcmp(res, line->prev)) {
- gtk_label_set_text(GTK_LABEL(line->label), res);
- strcpy(line->prev, res);
- }
- }
- }
- oc_tooltip_set(clock);
-
- return(TRUE);
-}
-
-static gboolean oc_get_time_and_tune(Clock *clock)
-{
- oc_get_time(clock);
- if (clock->now.tm_sec > 1) {
- /* we are more than 1 sec off => fix the timing */
- oc_start_timer(clock);
- }
- else if (clock->interval > 60000 && clock->now.tm_min != 0) {
- /* we need to check also minutes if we are using hour timer */
- oc_start_timer(clock);
- }
- return(TRUE);
-}
-
-static gboolean oc_get_time_delay(Clock *clock)
-{
- oc_get_time(clock); /* update clock */
- /* now we really start the clock */
- clock->timeout_id = g_timeout_add_full(G_PRIORITY_DEFAULT_IDLE
- , clock->interval, (GSourceFunc)oc_get_time_and_tune, clock, NULL);
- return(FALSE); /* this is one time only timer */
-}
-
-void oc_start_timer(Clock *clock)
-{
- gint delay_time; /* this is used to set the clock start tie correct */
-
- /*
- g_message("oc_start_timer: (%s) interval %d %d:%d:%d", clock->tooltip_prev, clock->interval, clock->now.tm_hour, clock->now.tm_min, clock->now.tm_sec);
- */
- /* stop the clock refresh since we will start it again here soon */
- if (clock->timeout_id) {
- g_source_remove(clock->timeout_id);
- clock->timeout_id = 0;
- }
- if (clock->delay_timeout_id) {
- g_source_remove(clock->delay_timeout_id);
- clock->delay_timeout_id = 0;
- }
- oc_get_time(clock); /* put time on the clock and also fill clock->now */
- /* if we are using longer than 1 second (== 1000) interval, we need
- * to delay the first start so that clock changes when minute or hour
- * changes */
- if (clock->interval <= 1000) { /* no adjustment needed, we show seconds */
- clock->timeout_id = g_timeout_add_full(G_PRIORITY_DEFAULT_IDLE
- , clock->interval, (GSourceFunc)oc_get_time, clock, NULL);
- }
- else { /* need to tune time */
- if (clock->interval <= 60000) /* adjust to next full minute */
- delay_time = (clock->interval - clock->now.tm_sec*1000);
- else /* if (clock->interval <= 3600000) *//* adjust to next full hour */
- delay_time = (clock->interval -
- (clock->now.tm_min*60000 + clock->now.tm_sec*1000));
-
- clock->delay_timeout_id = g_timeout_add_full(G_PRIORITY_DEFAULT_IDLE
- , delay_time, (GSourceFunc)oc_get_time_delay, clock, NULL);
- }
-}
-
-gboolean oc_check_if_same(Clock *clock, int diff)
-{
- /* we compare if clock would change after diff seconds */
- /* instead of waiting for the time to really pass, we just move the clock
- * and see what would happen in the future. No need to wait for hours. */
- time_t t, t_next;
- struct tm tm, tm_next;
- char res[OC_MAX_LINE_LENGTH-1], res_next[OC_MAX_LINE_LENGTH-1];
- int i, max_len;
- ClockLine *line;
- gboolean same_time = TRUE, first_check = TRUE, result_known = FALSE;
-
- max_len = sizeof(res);
- while (!result_known) {
- time(&t);
- t_next = t + diff; /* diff secs forward */
- localtime_r(&t, &tm);
- localtime_r(&t_next, &tm_next);
- for (i = 0; (i < OC_MAX_LINES) && same_time; i++) {
- line = &clock->line[i];
- if (line->show) {
- utf8_strftime(res, max_len, line->data->str, &tm);
- utf8_strftime(res_next, max_len, line->data->str, &tm_next);
- if (strcmp(res, res_next)) { /* differ */
- same_time = FALSE;
- }
- }
- }
- /* Need to check also tooltip */
- if (same_time) { /* we only check tooltip if needed */
- utf8_strftime(res, max_len, clock->tooltip_data->str, &tm);
- utf8_strftime(res_next, max_len, clock->tooltip_data->str,&tm_next);
- if (strcmp(res, res_next)) { /* differ */
- same_time = FALSE;
- }
- }
-
- if (!same_time) {
- if (first_check) {
- /* change detected, but it can be that bigger unit
- * like hour or day happened to change, so we need to check
- * again to be sure */
- first_check = FALSE;
- same_time = TRUE;
- }
- else { /* second check, now we are sure the clock has changed */
- result_known = TRUE; /* no need to check more */
- }
- }
- else { /* clock did not change */
- result_known = TRUE; /* no need to check more */
- }
- }
- return(same_time);
-}
-
-void oc_tune_interval(Clock *clock)
-{
- /* check if clock changes after 2 secs */
- if (oc_check_if_same(clock, 2)) { /* Continue checking */
- /* We know now that clock does not change every second.
- * Let's check 2 minutes next: */
- if (oc_check_if_same(clock, 2*60)) {
- /* We know now that clock does not change every minute.
- * We could check hours next, but cpu saving between 1 hour and 24
- * hours would be minimal. But keeping 24 hour wake up time clock
- * in accurate time would be much more difficult, so we end here
- * and schedule clock to fire every hour. */
- clock->interval = 3600000;
- }
- else { /* we schedule clock to fire every minute */
- clock->interval = 60000;
- }
- }
-}
-
-void oc_init_timer(Clock *clock)
-{
- clock->interval = OC_BASE_INTERVAL;
- oc_get_time(clock); /* update clock once */
- if (!clock->hib_timing) /* using suspend/hibernate, do not tune time */
- oc_tune_interval(clock);
- oc_start_timer(clock);
-}
-
-static void oc_update_size(Clock *clock, int size)
-{
- if (size > 26) {
- gtk_container_set_border_width(GTK_CONTAINER(clock->frame), 2);
- size -= 3;
- }
- else {
- gtk_container_set_border_width(GTK_CONTAINER(clock->frame), 0);
- size -= 1;
- }
-}
-
-static gboolean popup_program(GtkWidget *widget, gchar *program, Clock *clock
- , guint event_time)
-{
- GdkAtom atom;
- Window xwindow;
- GError *error = NULL;
- GdkEventClient gev;
- gchar *check, *popup; /* atom names to use */
-
- if (strcmp(program, "orage") == 0) {
- check = "_XFCE_CALENDAR_RUNNING";
- popup = "_XFCE_CALENDAR_TOGGLE_HERE";
- }
- else if (strcmp(program, "globaltime") == 0) {
- check = "_XFCE_GLOBALTIME_RUNNING";
- popup = "_XFCE_GLOBALTIME_TOGGLE_HERE";
- }
- else {
- g_warning("unknown program to start %s", program);
- return(FALSE);
- }
-
- /* send message to program to check if it is running */
- atom = gdk_atom_intern(check, FALSE);
- if ((xwindow = XGetSelectionOwner(GDK_DISPLAY(),
- gdk_x11_atom_to_xatom(atom))) != None) { /* yes, then toggle */
- gev.type = GDK_CLIENT_EVENT;
- gev.window = widget->window;
- gev.send_event = TRUE;
- gev.message_type = gdk_atom_intern(popup, FALSE);
- gev.data_format = 8;
-
- if (!gdk_event_send_client_message((GdkEvent *) &gev,
- (GdkNativeWindow)xwindow))
- g_message("%s: send message to %s failed", OC_NAME, program);
- gdk_flush();
-
- return(TRUE);
- }
- else { /* not running, let's try to start it. Need to reset TZ! */
- static guint prev_event_time = 0; /* prevenst double start (BUG 4096) */
-
- if (prev_event_time && ((event_time - prev_event_time) < 1000)) {
- g_message("%s: double start of %s prevented", OC_NAME, program);
- return(FALSE);
- }
-
- prev_event_time = event_time;
- if (clock->TZ_orig != NULL) /* we had TZ when we started */
- g_setenv("TZ", clock->TZ_orig, 1);
- else /* TZ was not set so take it out */
- g_unsetenv("TZ");
- tzset();
-
- if (!xfce_exec(program, FALSE, FALSE, &error))
- g_message("%s: start of %s failed", OC_NAME, program);
-
- if ((clock->timezone->str != NULL) && (clock->timezone->len > 0)) {
- /* user has set timezone, so let's set TZ */
- g_setenv("TZ", clock->timezone->str, 1);
- tzset();
- }
-
- return(TRUE);
- }
-
- return(FALSE);
-}
-
-static gboolean on_button_press_event_cb(GtkWidget *widget
- , GdkEventButton *event, Clock *clock)
-{
- if (event->type != GDK_BUTTON_PRESS) /* double or triple click */
- return(FALSE); /* ignore */
- if (event->button == 1)
- return(popup_program(widget, "orage", clock, event->time));
- else if (event->button == 2)
- return(popup_program(widget, "globaltime", clock, event->time));
-
- return(FALSE);
-}
-
-
-/* -------------------------------------------------------------------- *
- * Panel Plugin Interface *
- * -------------------------------------------------------------------- */
-
-
-/* Interface Implementation */
-
-static gboolean oc_set_size(XfcePanelPlugin *plugin, int size, Clock *clock)
-{
- oc_update_size(clock, size);
-
- return(TRUE);
-}
-
-static void oc_free_data(XfcePanelPlugin *plugin, Clock *clock)
-{
- GtkWidget *dlg = g_object_get_data(G_OBJECT(plugin), "dialog");
-
- if (dlg)
- gtk_widget_destroy(dlg);
-
- if (clock->timeout_id) {
- g_source_remove(clock->timeout_id);
- }
- g_object_unref(clock->tips);
- g_object_unref(clock->line[0].label);
- g_object_unref(clock->line[1].label);
- g_object_unref(clock->line[2].label);
- g_free(clock->TZ_orig);
- g_free(clock);
-}
-
-static void oc_read_rc_file(XfcePanelPlugin *plugin, Clock *clock)
-{
- gchar *file;
- XfceRc *rc;
- const gchar *ret;
- gchar tmp[100];
- gint i;
- unsigned int red, green, blue;
-
- if (!(file = xfce_panel_plugin_lookup_rc_file(plugin)))
- return; /* if it does not exist, we use defaults from orage_oc_new */
- if (!(rc = xfce_rc_simple_open(file, TRUE))) {
- g_warning("unable to read-open rc file (%s)", file);
- return;
- }
- g_free(file);
-
- clock->show_frame = xfce_rc_read_bool_entry(rc, "show_frame", TRUE);
-
- clock->fg_set = xfce_rc_read_bool_entry(rc, "fg_set", FALSE);
- if (clock->fg_set) {
- ret = xfce_rc_read_entry(rc, "fg", NULL);
- /*
- sscanf(ret, "%uR %uG %uB"
- , (unsigned int *)&clock->fg.red
- , (unsigned int *)&clock->fg.green
- , (unsigned int *)&clock->fg.blue);
- */
- sscanf(ret, "%uR %uG %uB", &red, &green, &blue);
- clock->fg.red = red;
- clock->fg.green = green;
- clock->fg.blue = blue;
- clock->fg.pixel = 0;
- }
-
- clock->bg_set = xfce_rc_read_bool_entry(rc, "bg_set", FALSE);
- if (clock->bg_set) {
- ret = xfce_rc_read_entry(rc, "bg", NULL);
- /*
- sscanf(ret, "%uR %uG %uB"
- , (unsigned int *)&clock->bg.red
- , (unsigned int *)&clock->bg.green
- , (unsigned int *)&clock->bg.blue);
- */
- sscanf(ret, "%uR %uG %uB", &red, &green, &blue);
- clock->bg.red = red;
- clock->bg.green = green;
- clock->bg.blue = blue;
- clock->bg.pixel = 0;
- }
-
- ret = xfce_rc_read_entry(rc, "timezone", NULL);
- g_string_assign(clock->timezone, ret);
-
- clock->width_set = xfce_rc_read_bool_entry(rc, "width_set", FALSE);
- if (clock->width_set) {
- clock->width = xfce_rc_read_int_entry(rc, "width", -1);
- }
- clock->height_set = xfce_rc_read_bool_entry(rc, "height_set", FALSE);
- if (clock->height_set) {
- clock->height = xfce_rc_read_int_entry(rc, "height", -1);
- }
-
- for (i = 0; i < OC_MAX_LINES; i++) {
- sprintf(tmp, "show%d", i);
- clock->line[i].show = xfce_rc_read_bool_entry(rc, tmp, FALSE);
- if (clock->line[i].show) {
- sprintf(tmp, "data%d", i);
- ret = xfce_rc_read_entry(rc, tmp, NULL);
- g_string_assign(clock->line[i].data, ret);
-
- sprintf(tmp, "font%d", i);
- ret = xfce_rc_read_entry(rc, tmp, NULL);
- g_string_assign(clock->line[i].font, ret);
- }
- }
-
- if ((ret = xfce_rc_read_entry(rc, "tooltip", NULL)))
- g_string_assign(clock->tooltip_data, ret);
-
- clock->hib_timing = xfce_rc_read_bool_entry(rc, "hib_timing", FALSE);
-
- xfce_rc_close(rc);
-}
-
-void oc_write_rc_file(XfcePanelPlugin *plugin, Clock *clock)
-{
- gchar *file;
- XfceRc *rc;
- gchar tmp[100];
- gint i;
-
- if (!(file = xfce_panel_plugin_save_location(plugin, TRUE))) {
- g_warning("unable to write rc file");
- return;
- }
- if (!(rc = xfce_rc_simple_open(file, FALSE))) {
- g_warning("unable to read-open rc file (%s)", file);
- return;
- }
- g_free(file);
-
- xfce_rc_write_bool_entry(rc, "show_frame", clock->show_frame);
-
- xfce_rc_write_bool_entry(rc, "fg_set", clock->fg_set);
- if (clock->fg_set) {
- sprintf(tmp, "%uR %uG %uB"
- , clock->fg.red, clock->fg.green, clock->fg.blue);
- xfce_rc_write_entry(rc, "fg", tmp);
- }
- else {
- xfce_rc_delete_entry(rc, "fg", TRUE);
- }
-
- xfce_rc_write_bool_entry(rc, "bg_set", clock->bg_set);
- if (clock->bg_set) {
- sprintf(tmp, "%uR %uG %uB"
- , clock->bg.red, clock->bg.green, clock->bg.blue);
- xfce_rc_write_entry(rc, "bg", tmp);
- }
- else {
- xfce_rc_delete_entry(rc, "bg", TRUE);
- }
-
- xfce_rc_write_entry(rc, "timezone", clock->timezone->str);
-
- xfce_rc_write_bool_entry(rc, "width_set", clock->width_set);
- if (clock->width_set) {
- xfce_rc_write_int_entry(rc, "width", clock->width);
- }
- else {
- xfce_rc_delete_entry(rc, "width", TRUE);
- }
-
- xfce_rc_write_bool_entry(rc, "height_set", clock->height_set);
- if (clock->height_set) {
- xfce_rc_write_int_entry(rc, "height", clock->height);
- }
- else {
- xfce_rc_delete_entry(rc, "height", TRUE);
- }
-
- for (i = 0; i < OC_MAX_LINES; i++) {
- sprintf(tmp, "show%d", i);
- xfce_rc_write_bool_entry(rc, tmp, clock->line[i].show);
- if (clock->line[i].show) {
- sprintf(tmp, "data%d", i);
- xfce_rc_write_entry(rc, tmp, clock->line[i].data->str);
- sprintf(tmp, "font%d", i);
- xfce_rc_write_entry(rc, tmp, clock->line[i].font->str);
- }
- else {
- sprintf(tmp, "data%d", i);
- xfce_rc_delete_entry(rc, tmp, FALSE);
- sprintf(tmp, "font%d", i);
- xfce_rc_delete_entry(rc, tmp, FALSE);
- }
- }
-
- xfce_rc_write_entry(rc, "tooltip", clock->tooltip_data->str);
-
- xfce_rc_write_bool_entry(rc, "hib_timing", clock->hib_timing);
-
- xfce_rc_close(rc);
-}
-
-/* Create widgets and connect to signals */
-
-Clock *orage_oc_new(XfcePanelPlugin *plugin)
-{
- Clock *clock = g_new0(Clock, 1);
- gchar *data_init[] = {"%X", "%A", "%x"};
- gboolean show_init[] = {TRUE, FALSE, FALSE};
- gint i;
-
- clock->plugin = plugin;
-
- clock->ebox = gtk_event_box_new();
- gtk_widget_show(clock->ebox);
-
- clock->frame = gtk_frame_new(NULL);
- gtk_container_add(GTK_CONTAINER(clock->ebox), clock->frame);
- gtk_widget_show(clock->frame);
-
- clock->vbox = gtk_vbox_new(TRUE, 0);
- gtk_widget_show(clock->vbox);
- gtk_container_add(GTK_CONTAINER(clock->frame), clock->vbox);
-
- clock->show_frame = TRUE;
- clock->fg_set = FALSE;
- clock->bg_set = FALSE;
- clock->width_set = FALSE;
- clock->height_set = FALSE;
-
- clock->timezone = g_string_new(""); /* = not set */
- clock->TZ_orig = g_strdup(g_getenv("TZ"));
-
- for (i = 0; i < OC_MAX_LINES; i++) {
- clock->line[i].label = gtk_label_new("");
- /* clicking does not work after this
- gtk_label_set_selectable(GTK_LABEL(clock->line[i].label), TRUE);
- */
- g_object_ref(clock->line[i].label); /* it is not always in the vbox */
- gtk_widget_show(clock->line[i].label);
- clock->line[i].show = show_init[i];
- clock->line[i].data = g_string_new(data_init[i]);
- clock->line[i].font = g_string_new("");
- }
-
- /* TRANSLATORS: Use format characters from strftime(3)
- * to get the proper string for your locale.
- * I used these:
- * %A : full weekday name
- * %d : day of the month
- * %B : full month name
- * %Y : four digit year
- * %V : ISO week number
- */
- clock->tooltip_data = g_string_new(_("%A %d %B %Y/%V"));
-
- clock->hib_timing = FALSE;
-
- clock->tips = gtk_tooltips_new();
- g_object_ref(clock->tips);
- gtk_object_sink(GTK_OBJECT(clock->tips));
-
- return(clock);
-}
-
-void oc_show_frame_set(Clock *clock)
-{
- gtk_frame_set_shadow_type(GTK_FRAME(clock->frame)
- , clock->show_frame ? GTK_SHADOW_IN : GTK_SHADOW_NONE);
-}
-
-void oc_hib_timing_set(Clock *clock)
-{
-}
-
-void oc_fg_set(Clock *clock)
-{
- GdkColor *fg = NULL;
- gint i;
-
- if (clock->fg_set)
- fg = &clock->fg;
-
- for (i = 0; i < OC_MAX_LINES; i++)
- gtk_widget_modify_fg(clock->line[i].label, GTK_STATE_NORMAL, fg);
-}
-
-void oc_bg_set(Clock *clock)
-{
- GdkColor *bg = NULL;
-
- if (clock->bg_set)
- bg = &clock->bg;
-
- gtk_widget_modify_bg(clock->ebox, GTK_STATE_NORMAL, bg);
-}
-
-void oc_timezone_set(Clock *clock)
-{
- if ((clock->timezone->str != NULL) && (clock->timezone->len > 0)) {
- /* user has set timezone, so let's set TZ */
- g_setenv("TZ", clock->timezone->str, 1);
- }
- else if (clock->TZ_orig != NULL) { /* we had TZ when we started */
- g_setenv("TZ", clock->TZ_orig, 1);
- }
- else { /* TZ was not set so take it out */
- g_unsetenv("TZ");
- }
- tzset();
-}
-
-void oc_size_set(Clock *clock)
-{
- gint w, h;
-
- w = clock->width_set ? clock->width : -1;
- h = clock->height_set ? clock->height : -1;
- gtk_widget_set_size_request(clock->vbox, w, h);
-}
-
-void oc_show_line_set(Clock *clock, gint lno)
-{
- GtkWidget *line_label = clock->line[lno].label;
-
- if (clock->line[lno].show) {
- gtk_box_pack_start(GTK_BOX(clock->vbox), line_label, FALSE, FALSE, 0);
- switch (lno) {
- case 0: /* always on top */
- gtk_box_reorder_child(GTK_BOX(clock->vbox), line_label, 0);
- break;
- case 1: /* if line 0 is missing, we are first */
- if (clock->line[0].show) /* we are second line */
- gtk_box_reorder_child(GTK_BOX(clock->vbox), line_label, 1);
- else /* we are top line */
- gtk_box_reorder_child(GTK_BOX(clock->vbox), line_label, 0);
- break;
- case 2: /* always last */
- break;
- }
- }
- else {
- gtk_container_remove(GTK_CONTAINER(clock->vbox), line_label);
- }
-
- oc_update_size(clock,
- xfce_panel_plugin_get_size(XFCE_PANEL_PLUGIN(clock->plugin)));
-}
-
-void oc_line_font_set(Clock *clock, gint lno)
-{
- PangoFontDescription *font;
-
- if (clock->line[lno].font->str) {
- font = pango_font_description_from_string(clock->line[lno].font->str);
- gtk_widget_modify_font(clock->line[lno].label, font);
- pango_font_description_free(font);
- }
- else
- gtk_widget_modify_font(clock->line[lno].label, NULL);
-}
-
-static void oc_construct(XfcePanelPlugin *plugin)
-{
- Clock *clock;
- gint i;
-
- xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
-
- clock = orage_oc_new(plugin);
-
- gtk_container_add(GTK_CONTAINER(plugin), clock->ebox);
-
- oc_read_rc_file(plugin, clock);
- oc_init_timer(clock);
-
- oc_show_frame_set(clock);
- oc_fg_set(clock);
- oc_bg_set(clock);
- oc_timezone_set(clock);
- oc_size_set(clock);
- for (i = 0; i < OC_MAX_LINES; i++) {
- if (clock->line[i].show) /* need to add */
- oc_show_line_set(clock, i);
- oc_line_font_set(clock, i);
- }
-
- oc_update_size(clock,
- xfce_panel_plugin_get_size(XFCE_PANEL_PLUGIN(plugin)));
-
- xfce_panel_plugin_add_action_widget(plugin, clock->ebox);
-
- xfce_panel_plugin_menu_show_configure(plugin);
-
- g_signal_connect(plugin, "configure-plugin",
- G_CALLBACK(oc_properties_dialog), clock);
-
- g_signal_connect(plugin, "size-changed",
- G_CALLBACK(oc_set_size), clock);
-
- g_signal_connect(plugin, "free-data",
- G_CALLBACK(oc_free_data), clock);
-
- g_signal_connect(plugin, "save",
- G_CALLBACK(oc_write_rc_file), clock);
-
-/* callback for calendar and globaltime popup */
- g_signal_connect(clock->ebox, "button-press-event",
- G_CALLBACK(on_button_press_event_cb), clock);
-
-}
-
-/* Register with the panel */
-
-XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL(oc_construct);
-
diff --git a/panel-plugin/orageclock.desktop.in.in b/panel-plugin/orageclock.desktop.in.in
deleted file mode 100644
index 641bd01..0000000
--- a/panel-plugin/orageclock.desktop.in.in
+++ /dev/null
@@ -1,8 +0,0 @@
-[Xfce Panel]
-Type=X-XFCE-PanelPlugin
-Encoding=UTF-8
-_Name=Orage Clock
-_Comment=What time and date is it?
-Icon=xfce-schedule
-X-XFCE-Exec=@PLUGIN_PATH@/orageclock
-
diff --git a/panel-plugin/orageclock.h b/panel-plugin/orageclock.h
deleted file mode 100644
index f325e77..0000000
--- a/panel-plugin/orageclock.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* xfce4
- * Copyright (C) 2006-2007 Juha Kautto (juha at xfce.org)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This pibrary is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#define OC_NAME "orageclock panel plugin"
-#define OC_MAX_LINES 3 /* changing this causes trouble. don't do it */
-#define OC_MAX_LINE_LENGTH 100
-#define OC_BASE_INTERVAL 1000 /* best accurance of the clock = 1 sec */
-#define OC_CONFIG_INTERVAL 200 /* special fast interval used in setup */
-
-typedef struct _clockline
-{
- GtkWidget *label;
- gboolean show;
- GString *data; /* the time formatting data */
- GString *font;
- gchar prev[OC_MAX_LINE_LENGTH+1];
-} ClockLine;
-
-typedef struct _clock
-{
- XfcePanelPlugin *plugin;
-
- GtkWidget *ebox;
- GtkWidget *frame;
- GtkWidget *vbox;
- gboolean width_set;
- gint width;
- gboolean height_set;
- gint height;
- gboolean show_frame;
- gboolean fg_set;
- GdkColor fg;
- gboolean bg_set;
- GdkColor bg;
- GString *timezone;
- gchar *TZ_orig;
- GtkWidget *tz_entry;
- ClockLine line[OC_MAX_LINES];
- GString *tooltip_data;
- gchar tooltip_prev[OC_MAX_LINE_LENGTH+1];
- gboolean hib_timing;
-
- GtkTooltips *tips;
- int timeout_id; /* timer id for the clock */
- int delay_timeout_id;
- int interval;
- struct tm now;
-} Clock;
-
-void oc_properties_dialog(XfcePanelPlugin *plugin, Clock *clock);
-
-void oc_show_frame_set(Clock *clock);
-void oc_fg_set(Clock *clock);
-void oc_bg_set(Clock *clock);
-void oc_size_set(Clock *clock);
-void oc_timezone_set(Clock *clock);
-void oc_show_line_set(Clock *clock, gint lno);
-void oc_line_font_set(Clock *clock, gint lno);
-void oc_hib_timing_set(Clock *clock);
-void oc_write_rc_file(XfcePanelPlugin *plugin, Clock *clock);
-void oc_start_timer(Clock *clock);
-void oc_init_timer(Clock *clock);
-
diff --git a/panel-plugin/timezone_selection.c b/panel-plugin/timezone_selection.c
index f82eaa1..59a4dbe 100644
--- a/panel-plugin/timezone_selection.c
+++ b/panel-plugin/timezone_selection.c
@@ -80,7 +80,7 @@ static GtkTreeStore *tz_button_create_store(gboolean details
#define MAX_AREA_LENGTH 100
GtkTreeStore *store;
- GtkTreeIter iter1, iter2, main;
+ GtkTreeIter iter1, iter2, main_iter;
orage_timezone_array tz_a;
char area_old[MAX_AREA_LENGTH+2]; /*+2 = / + null */
char s_offset[100], s_country[100], s_changes[200], s_change[50]
@@ -106,7 +106,7 @@ static GtkTreeStore *tz_button_create_store(gboolean details
, CHANGES, " "
, COUNTRY, " "
, -1);
- main = iter1; /* need to remember that */
+ main_iter = iter1; /* need to remember that */
for (i=0; i < tz_a.count-2; i++) {
/* first check area */
@@ -118,7 +118,7 @@ static GtkTreeStore *tz_button_create_store(gboolean details
}
/* now tz_a.city[i][j] is either / or 0 which means not found / */
if (!tz_a.city[i][j]) { /* end of name = no are code */
- iter1 = main;
+ iter1 = main_iter;
}
else if (j < MAX_AREA_LENGTH) { /* new area, let's add it */
area_old[j] = 0;
@@ -131,7 +131,7 @@ static GtkTreeStore *tz_button_create_store(gboolean details
, COUNTRY, " "
, -1);
/* let's make sure we do not match accidentally to those
- * plain names on main level. We do this by adding / */
+ * plain names on main_iter level. We do this by adding / */
area_old[j++] = '/';
area_old[j] = 0;
}
diff --git a/src/appointment.c b/src/appointment.c
index e52e3d7..2ab8e33 100644
--- a/src/appointment.c
+++ b/src/appointment.c
@@ -42,6 +42,7 @@
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
+#include <gdk/gdkx.h>
#include <glib.h>
#include <glib/gprintf.h>
#include <glib/gstdio.h>
@@ -1351,8 +1352,8 @@ static void recur_row_clicked(GtkWidget *widget
recur_exception = new_exception(text);
appt = (xfical_appt *)apptw->xf_appt;
g_free(text);
- if (gl_pos = g_list_find_custom(appt->recur_exceptions
- , recur_exception, check_exists)) {
+ if ((gl_pos = g_list_find_custom(appt->recur_exceptions
+ , recur_exception, check_exists))) {
/* let's remove it */
recur_exception_cur = gl_pos->data;
appt->recur_exceptions =
@@ -3100,7 +3101,8 @@ static void enable_alarm_page_signals(appt_win *apptw)
static void build_recurrence_page(appt_win *apptw)
{
- gint row, i, y, m, d;
+ gint row, i;
+ guint y, m;
char *recur_freq_array[5] = {
_("None"), _("Daily"), _("Weekly"), _("Monthly"), _("Yearly")};
char *weekday_array[7] = {
@@ -3337,7 +3339,7 @@ static void build_recurrence_page(appt_win *apptw)
apptw->Recur_calendar1 = gtk_calendar_new();
gtk_calendar_set_display_options(GTK_CALENDAR(apptw->Recur_calendar1)
, GTK_CALENDAR_SHOW_HEADING | GTK_CALENDAR_SHOW_DAY_NAMES);
- gtk_calendar_get_date(GTK_CALENDAR(apptw->Recur_calendar1), &y, &m, &d);
+ gtk_calendar_get_date(GTK_CALENDAR(apptw->Recur_calendar1), &y, &m, NULL);
gtk_calendar_select_day(GTK_CALENDAR(apptw->Recur_calendar1), 0);
gtk_box_pack_start(GTK_BOX(apptw->Recur_calendar_hbox)
, apptw->Recur_calendar1, FALSE, FALSE, 0);
diff --git a/src/day-view.c b/src/day-view.c
index ff282ba..5e7f63d 100644
--- a/src/day-view.c
+++ b/src/day-view.c
@@ -674,7 +674,7 @@ static void fill_days(day_win *dw, gint days)
static void build_day_view_header(day_win *dw, char *start_date)
{
- GtkWidget *hbox, *label, *space_label;
+ GtkWidget *hbox, *label;
hbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(dw->Vbox), hbox, FALSE, FALSE, 10);
@@ -686,24 +686,13 @@ static void build_day_view_header(day_win *dw, char *start_date)
dw->StartDate_button = gtk_button_new();
gtk_box_pack_start(GTK_BOX(hbox), dw->StartDate_button, FALSE, FALSE, 0);
- space_label = gtk_label_new(" ");
- gtk_box_pack_start(GTK_BOX(hbox), space_label, FALSE, FALSE, 0);
-
- space_label = gtk_label_new(" ");
- gtk_box_pack_start(GTK_BOX(hbox), space_label, FALSE, FALSE, 0);
-
- label = gtk_label_new(_("Show"));
+ label = gtk_label_new(_(" Number of days to show"));
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 10);
/* show days spin = how many days to show */
dw->day_spin = gtk_spin_button_new_with_range(1, MAX_DAYS, 1);
gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(dw->day_spin), TRUE);
gtk_box_pack_start(GTK_BOX(hbox), dw->day_spin, FALSE, FALSE, 0);
- label = gtk_label_new(_("days"));
- gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
-
- space_label = gtk_label_new(" ");
- gtk_box_pack_start(GTK_BOX(hbox), space_label, FALSE, FALSE, 0);
/* initial values */
gtk_button_set_label(GTK_BUTTON(dw->StartDate_button)
diff --git a/src/ical-code.c b/src/ical-code.c
index 32568f2..720d674 100644
--- a/src/ical-code.c
+++ b/src/ical-code.c
@@ -122,6 +122,7 @@ static icaltimezone *local_icaltimezone = NULL;
/* in timezone_names.c */
extern const gchar *trans_timezone[];
+/*
static struct icaltimetype ical_get_current_local_time()
{
#undef P_N
@@ -137,13 +138,13 @@ static struct icaltimetype ical_get_current_local_time()
else if ((g_par.local_timezone)
&& (strcmp(g_par.local_timezone, "floating") != 0))
ctime = icaltime_current_time_with_zone(local_icaltimezone);
- else { /* use floating time */
+ else { / * use floating time * /
ctime.is_utc = 0;
ctime.is_date = 0;
ctime.is_daylight = 0;
ctime.zone = NULL;
}
- /* and at the end we need to change the clock to be correct */
+ / * and at the end we need to change the clock to be correct * /
tm = orage_localtime();
ctime.year = tm->tm_year+1900;
ctime.month = tm->tm_mon+1;
@@ -154,7 +155,9 @@ static struct icaltimetype ical_get_current_local_time()
return(ctime);
}
+*/
+/*
static xfical_timezone_array get_ical_timezones()
{
#undef P_N
@@ -164,7 +167,6 @@ static xfical_timezone_array get_ical_timezones()
static char tz_floating[]="floating";
icalarray *tz_array;
icaltimezone *l_tz;
- int dst; /* daylight saving time = summer time */
struct icaltimetype ctime;
#ifdef ORAGE_DEBUG
@@ -178,12 +180,9 @@ static xfical_timezone_array get_ical_timezones()
ctime = ical_get_current_local_time();
for (tz.count = 0; tz.count < tz_array->num_elements; tz.count++) {
l_tz = (icaltimezone *)icalarray_element_at(tz_array, tz.count);
- /* ical timezones are static so this is safe although not
- * exactly pretty */
+ / * ical timezones are static so this is safe although not
+ * exactly pretty * /
tz.city[tz.count] = (char *)icaltimezone_get_location(l_tz);
- /*
- g_print(P_N "before %d %s\n", tz.count, tz.city[tz.count]);
- */
tz.utc_offset[tz.count] = icaltimezone_get_utc_offset(
l_tz, &ctime, &tz.dst[tz.count]);
}
@@ -196,6 +195,7 @@ static xfical_timezone_array get_ical_timezones()
}
return (tz);
}
+*/
gboolean xfical_set_local_timezone(gboolean testing)
{
@@ -1926,7 +1926,6 @@ gboolean get_appt_from_icalcomponent(icalcomponent *c, xfical_appt *appt)
{
#undef P_N
#define P_N "get_appt_from_icalcomponent: "
- gboolean key_found = TRUE;
const char *text;
icalproperty *p = NULL;
struct icaltimetype itime, stime, etime, sltime, eltime, wtime;
@@ -2569,7 +2568,7 @@ alarm_struct *process_alarm_trigger(icalcomponent *c
alarm_struct *new_alarm;
struct icaldurationtype alarm_start_diff;
struct icaldatetimeperiodtype rdate_period;
- pvl_elem property_iterator; /* for saving the iterator */
+ /* pvl_elem property_iterator; */ /* for saving the iterator */
#ifdef ORAGE_DEBUG
orage_message(-200, P_N);
@@ -3199,7 +3198,6 @@ void mark_calendar(icalcomponent *c, icaltime_span *span , void *data)
#define P_N "mark_calendar: "
struct icaltimetype sdate, edate;
struct tm start_tm, end_tm;
- gboolean key_found;
struct mark_calendar_data {
GtkCalendar *cal;
guint year;
@@ -3425,7 +3423,6 @@ void add_appt_to_list(icalcomponent *c, icaltime_span *span , void *data)
#undef P_N
#define P_N "add_appt_to_list: "
xfical_appt *appt;
- GList **list = (GList **)data;
struct icaltimetype start, end;
struct tm start_tm, end_tm;
gboolean key_found;
@@ -3495,12 +3492,8 @@ static void xfical_get_each_app_within_time_internal(char *a_day, gint days
{
#undef P_N
#define P_N "xfical_get_each_app_within_time_internal: "
- struct icaltimetype asdate, aedate /* period to check */
- , nsdate, nedate; /* repeating event occurrency start and end */
- xfical_period per; /* event start and end times with duration */
+ struct icaltimetype asdate, aedate; /* period to check */
icalcomponent *c=NULL;
- char *uid;
- xfical_appt *appt;
icalcomponent_kind ikind = ICAL_VEVENT_COMPONENT;
typedef struct _app_data
{
diff --git a/src/ical-expimp.c b/src/ical-expimp.c
index 0705839..f571a0a 100644
--- a/src/ical-expimp.c
+++ b/src/ical-expimp.c
@@ -86,6 +86,8 @@ typedef struct _foreign_ical_files
extern ic_foreign_ical_files ic_f_ical[10];
+gboolean ic_internal_file_open(icalcomponent **p_ical
+ , icalset **p_fical, gchar *file_icalpath, gboolean test);
static gboolean add_event(icalcomponent *c)
{
diff --git a/src/parameters.c b/src/parameters.c
index 490123d..d36f817 100644
--- a/src/parameters.c
+++ b/src/parameters.c
@@ -615,7 +615,7 @@ static void create_parameter_dialog_display_tab(Itf *dialog)
dialog->show_todos_checkbutton), g_par.show_todos);
hbox = gtk_hbox_new(FALSE, 0);
- label = gtk_label_new(_("Show"));
+ label = gtk_label_new(_("Number of days to show in event window"));
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
dialog->show_events_spin = gtk_spin_button_new_with_range(0, 31, 1);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog->show_events_spin)
@@ -625,8 +625,10 @@ static void create_parameter_dialog_display_tab(Itf *dialog)
gtk_box_pack_start(GTK_BOX(hbox)
, dialog->show_events_spin, FALSE, FALSE, 5);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+ /*
label = gtk_label_new(_("days in event list"));
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
+ */
dialog->set_stick_checkbutton = gtk_check_button_new_with_mnemonic(
_("Set sticked"));
@@ -829,15 +831,17 @@ static void create_parameter_dialog_extra_setup_tab(Itf *dialog)
gtk_box_pack_start(GTK_BOX(dialog->extra_vbox)
, dialog->el_extra_days_frame, FALSE, FALSE, 5);
- label = gtk_label_new(_("Show:"));
+ label = gtk_label_new(_("Number of extra days to show in event list"));
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
dialog->el_extra_days_spin = gtk_spin_button_new_with_range(0, 999, 1);
gtk_box_pack_start(GTK_BOX(hbox)
, dialog->el_extra_days_spin, FALSE, FALSE, 5);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog->el_extra_days_spin)
, g_par.el_days);
+ /*
label = gtk_label_new(_("extra days"));
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
+ */
gtk_tooltips_set_tip(dialog->Tooltips, dialog->el_extra_days_spin
, _("This is just the default value, you can change it in the actual eventlist window.")
, NULL);
diff --git a/src/reminder.c b/src/reminder.c
index 93bc6a1..39bbe1b 100644
--- a/src/reminder.c
+++ b/src/reminder.c
@@ -683,7 +683,7 @@ static void create_orage_reminder(alarm_struct *alarm)
GtkWidget *swReminder;
GtkWidget *hdReminder;
orage_ddmmhh_hbox_struct *ddmmhh_hbox;
- GtkWidget *e_label, *e_hbox;
+ GtkWidget *e_hbox;
gchar *tmp;
#ifdef ORAGE_DEBUG
@@ -779,10 +779,6 @@ static void create_orage_reminder(alarm_struct *alarm)
, btRecreateReminder, GTK_RESPONSE_OK);
g_signal_connect((gpointer) btRecreateReminder, "clicked"
, G_CALLBACK(on_btRecreateReminder_clicked), alarm);
- /*
- g_signal_connect_after((gpointer) btRecreateReminder, "clicked"
- , G_CALLBACK(on_btOkReminder_clicked), wReminder);
- */
g_signal_connect(G_OBJECT(wReminder), "destroy",
G_CALLBACK(destroy_orage_reminder), alarm);
diff --git a/src/timezone_selection.c b/src/timezone_selection.c
index 7f8318f..297769f 100644
--- a/src/timezone_selection.c
+++ b/src/timezone_selection.c
@@ -79,7 +79,7 @@ static GtkTreeStore *tz_button_create_store(gboolean details
#define MAX_AREA_LENGTH 100
GtkTreeStore *store;
- GtkTreeIter iter1, iter2, main;
+ GtkTreeIter iter1, iter2, main_iter;
orage_timezone_array tz_a;
char area_old[MAX_AREA_LENGTH+2]; /*+2 = / + null */
char s_offset[100], s_country[100], s_changes[200], s_change[50]
@@ -106,7 +106,14 @@ static GtkTreeStore *tz_button_create_store(gboolean details
, CHANGES, " "
, COUNTRY, " "
, -1);
- main = iter1; /* need to remember that */
+ main_iter = iter1; /* need to remember that */
+#else
+ /* FIXME: this needs to be done better so that main_iter is created
+ when needed to store main level */
+ main_iter.stamp = 0;
+ main_iter.user_data = NULL;
+ main_iter.user_data2 = NULL;
+ main_iter.user_data3 = NULL;
#endif
for (i=0; i < tz_a.count-2; i++) {
@@ -119,7 +126,7 @@ static GtkTreeStore *tz_button_create_store(gboolean details
}
/* now tz_a.city[i][j] is either / or 0 which means not found / */
if (!tz_a.city[i][j]) { /* end of name = no are code */
- iter1 = main;
+ iter1 = main_iter;
}
else if (j < MAX_AREA_LENGTH) { /* new area, let's add it */
area_old[j] = 0;
@@ -132,11 +139,11 @@ static GtkTreeStore *tz_button_create_store(gboolean details
, COUNTRY, " "
, -1);
/* let's make sure we do not match accidentally to those
- * plain names on main level. We do this by adding / */
+ * plain names on main_iter level. We do this by adding / */
area_old[j++] = '/';
area_old[j] = 0;
#ifdef HAVE_LIBICAL
- main = iter1; /* need to remember that */
+ main_iter = iter1; /* need to remember that */
#endif
}
else {
diff --git a/src/tz_zoneinfo_read.c b/src/tz_zoneinfo_read.c
index c89950a..d7cd2fb 100644
--- a/src/tz_zoneinfo_read.c
+++ b/src/tz_zoneinfo_read.c
@@ -198,7 +198,7 @@ static int process_header()
return(0);
}
-static process_local_time_table()
+static void process_local_time_table()
{ /* points when time changes */
unsigned long tmp;
int i;
@@ -217,7 +217,7 @@ static process_local_time_table()
}
}
-static process_local_time_type_table()
+static void process_local_time_type_table()
{ /* pointers to table, which explain how time changes */
unsigned char tmp;
int i;
@@ -233,7 +233,7 @@ static process_local_time_type_table()
}
}
-static process_ttinfo_table()
+static void process_ttinfo_table()
{ /* table of different time changes = types */
long tmp;
unsigned char tmp2, tmp3;
@@ -254,7 +254,7 @@ static process_ttinfo_table()
}
}
-static process_abbr_table()
+static void process_abbr_table()
{
unsigned char *tmp;
int i;
@@ -271,7 +271,7 @@ static process_abbr_table()
in_head += charcnt;
}
-static process_leap_table()
+static void process_leap_table()
{
unsigned long tmp, tmp2;
int i;
@@ -287,7 +287,7 @@ static process_leap_table()
}
}
-static process_std_table()
+static void process_std_table()
{
unsigned char tmp;
int i;
@@ -302,7 +302,7 @@ static process_std_table()
}
}
-static process_gmt_table()
+static void process_gmt_table()
{
unsigned char tmp;
int i;
@@ -397,7 +397,7 @@ static int timezone_exists_in_ical()
else
return(0); /* not found */
#else
- if (str = strstr(zones_tab_buf, in_timezone_name))
+ if ((str = strstr(zones_tab_buf, in_timezone_name)))
return(1); /* yes, it is there */
else
return(0); /* not found */
@@ -678,7 +678,7 @@ static int check_parameters()
for (s_tz = strstr(s_tz, tz); s_tz != NULL; s_tz = strstr(s_tz, tz)) {
if (s_tz[tz_len] == '\0' || s_tz[tz_len] == '/')
last_tz = s_tz;
- *s_tz++;
+ s_tz++;
}
if (last_tz == NULL) {
printf("check_parameters: in_file name (%s) does not contain (%s). Ending\n"
@@ -828,6 +828,7 @@ static void read_countries()
fclose(country_file);
}
+#ifndef HAVE_LIBICAL
static void read_ical_timezones()
{
FILE *zones_tab_file;
@@ -856,12 +857,9 @@ static void read_ical_timezones()
return;
}
zones_tab_buf[zones_tab_file_stat.st_size] = '\0';
- /*
- printf("read_ical_timezones: zones.tab file read (%s) (%d bytes)\n"
- , ICAL_ZONES_TAB_FILE_LOC, strlen(zones_tab_buf));
- */
fclose(zones_tab_file);
}
+#endif
orage_timezone_array get_orage_timezones(int show_details, int ical)
{
More information about the Xfce4-commits
mailing list