X-Git-Url: http://pileus.org/git/?p=grits;a=blobdiff_plain;f=src%2Fplugin-radar.c;h=30f58168ad54093c44308d330861628a81b181dc;hp=355f93d0431dec7e78fae315f167342625af81a3;hb=5ffc3c31ece77d1debfc619a1e5817b7398209e8;hpb=a5c578c4ab1311302308ac0d7f3f567f0d0520fc diff --git a/src/plugin-radar.c b/src/plugin-radar.c index 355f93d..30f5816 100644 --- a/src/plugin-radar.c +++ b/src/plugin-radar.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -29,25 +30,47 @@ /**************** * GObject code * ****************/ +/* Plugin init */ static void aweather_radar_plugin_init(AWeatherPluginInterface *iface); static void _aweather_radar_expose(AWeatherPlugin *_radar); G_DEFINE_TYPE_WITH_CODE(AWeatherRadar, aweather_radar, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE(AWEATHER_TYPE_PLUGIN, aweather_radar_plugin_init)); -static void aweather_radar_class_init(AWeatherRadarClass *klass) -{ - GObjectClass *object_class = (GObjectClass*)klass; -} static void aweather_radar_plugin_init(AWeatherPluginInterface *iface) { + g_debug("AWeatherRadar: plugin_init"); /* Add methods to the interface */ iface->expose = _aweather_radar_expose; } +/* Class/Object init */ static void aweather_radar_init(AWeatherRadar *radar) { + g_debug("AWeatherRadar: class_init"); /* Set defaults */ radar->gui = NULL; } +static void aweather_radar_dispose(GObject *gobject) +{ + g_debug("AWeatherRadar: dispose"); + AWeatherRadar *self = AWEATHER_RADAR(gobject); + /* Drop references */ + G_OBJECT_CLASS(aweather_radar_parent_class)->dispose(gobject); +} +static void aweather_radar_finalize(GObject *gobject) +{ + g_debug("AWeatherRadar: finalize"); + AWeatherRadar *self = AWEATHER_RADAR(gobject); + /* Free data */ + G_OBJECT_CLASS(aweather_radar_parent_class)->finalize(gobject); + +} +static void aweather_radar_class_init(AWeatherRadarClass *klass) +{ + g_debug("AWeatherRadar: class_init"); + GObjectClass *gobject_class = (GObjectClass*)klass; + gobject_class->dispose = aweather_radar_dispose; + gobject_class->finalize = aweather_radar_finalize; +} /************************** * Data loading functions * @@ -132,7 +155,7 @@ static void load_radar_gui(AWeatherRadar *self, Radar *radar) gdouble elev; guint rows = 1, cols = 1, cur_cols; gchar row_label_str[64], col_label_str[64], button_str[64]; - GtkWidget *row_label, *col_label, *button = NULL, *elev_box; + GtkWidget *row_label, *col_label, *button = NULL, *elev_box = NULL; GtkWidget *table = gtk_table_new(rows, cols, FALSE); for (guint vi = 0; vi < radar->h.nvolumes; vi++) { @@ -356,7 +379,7 @@ static void on_time_changed(AWeatherView *view, char *time, gpointer _self) aweather_gui_gl_redraw(self->gui); /* Start loading the new radar */ - cache_file(base, path, AWEATHER_AUTOMATIC, cached_cb, self); + cache_file(base, path, AWEATHER_UPDATE, cached_cb, self); g_free(path); } @@ -371,7 +394,7 @@ static void on_site_changed(AWeatherView *view, char *site, gpointer _self) g_free(time); } -static void on_refresh(AWeatherView *view, gpointer user_data, gpointer _self) +static void on_refresh(AWeatherView *view, gpointer _self) { AWeatherRadar *self = AWEATHER_RADAR(_self); char *site = aweather_view_get_site(view);