aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/calendar-weather
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-05-27 22:29:19 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-05-27 22:29:19 +0800
commit948235c3d1076dbe6ed2e57a24c16a083bbd9f01 (patch)
tree4133b1adfd94d8f889ca7ad4ad851346518f4171 /plugins/calendar-weather
parentcc3a98fc1ad5bb87aa7335f3de404ee7feee1541 (diff)
downloadgsoc2013-evolution-948235c3d1076dbe6ed2e57a24c16a083bbd9f01.tar.gz
gsoc2013-evolution-948235c3d1076dbe6ed2e57a24c16a083bbd9f01.tar.zst
gsoc2013-evolution-948235c3d1076dbe6ed2e57a24c16a083bbd9f01.zip
Prefer GLib basic types over C types.
Diffstat (limited to 'plugins/calendar-weather')
-rw-r--r--plugins/calendar-weather/calendar-weather.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/plugins/calendar-weather/calendar-weather.c b/plugins/calendar-weather/calendar-weather.c
index b636bcee86..f72421baba 100644
--- a/plugins/calendar-weather/calendar-weather.c
+++ b/plugins/calendar-weather/calendar-weather.c
@@ -43,20 +43,20 @@ GtkWidget *e_calendar_weather_refresh (EPlugin *epl, EConfigHookItemFactoryData
GtkWidget *e_calendar_weather_units (EPlugin *epl, EConfigHookItemFactoryData *data);
gboolean e_calendar_weather_check (EPlugin *epl, EConfigHookPageCheckData *data);
void e_calendar_weather_migrate (EPlugin *epl, ECalEventTargetComponent *data);
-int e_plugin_lib_enable (EPluginLib *epl, int enable);
+gint e_plugin_lib_enable (EPluginLib *epl, gint enable);
#define WEATHER_BASE_URI "weather://"
-int
-e_plugin_lib_enable (EPluginLib *epl, int enable)
+gint
+e_plugin_lib_enable (EPluginLib *epl, gint enable)
{
GList *l;
const gchar *tmp;
gint ii;
static struct {
- const char *description;
- const char *icon_name;
+ const gchar *description;
+ const gchar *icon_name;
} categories[] = {
{ N_("Weather: Fog"), "weather-fog" },
{ N_("Weather: Cloudy"), "weather-few-clouds" },
@@ -74,12 +74,12 @@ e_plugin_lib_enable (EPluginLib *epl, int enable)
/* Add the categories icons if we don't have them. */
for (l = e_categories_get_list (); l; l = g_list_next (l)) {
- if (!strcmp ((const char *)l->data, tmp))
+ if (!strcmp ((const gchar *)l->data, tmp))
goto exit;
}
for (ii = 0; categories[ii].description; ii++) {
- char *filename;
+ gchar *filename;
filename = e_icon_factory_get_icon_filename (
categories[ii].icon_name, GTK_ICON_SIZE_MENU);
@@ -327,7 +327,7 @@ location_clicked (GtkButton *button, ESource *source)
label = GTK_WIDGET (gtk_bin_get_child (GTK_BIN (button)));
text = gtk_label_get_text (GTK_LABEL (label));
- if (strcmp ((const char *)text, _("None")) == 0)
+ if (strcmp ((const gchar *)text, _("None")) == 0)
e_source_set_relative_uri (source, "");
}
@@ -339,11 +339,11 @@ e_calendar_weather_location (EPlugin *epl, EConfigHookItemFactoryData *data)
{
static GtkWidget *label;
GtkWidget *button, *parent, *text;
- int row;
+ gint row;
ECalConfigTargetSource *t = (ECalConfigTargetSource *) data->target;
ESource *source = t->source;
EUri *uri;
- char *uri_text;
+ gchar *uri_text;
static GtkWidget *hidden;
if (store == NULL)
@@ -357,7 +357,7 @@ e_calendar_weather_location (EPlugin *epl, EConfigHookItemFactoryData *data)
uri_text = e_source_get_uri (t->source);
uri = e_uri_new (uri_text);
- if (strcmp ((const char *)uri->protocol, "weather")) {
+ if (strcmp ((const gchar *)uri->protocol, "weather")) {
e_uri_free (uri);
return hidden;
}
@@ -396,9 +396,9 @@ e_calendar_weather_location (EPlugin *epl, EConfigHookItemFactoryData *data)
static void
set_refresh_time (ESource *source, GtkWidget *spin, GtkWidget *combobox)
{
- int time;
- int item_num = 0;
- const char *refresh_str = e_source_get_property (source, "refresh");
+ gint time;
+ gint item_num = 0;
+ const gchar *refresh_str = e_source_get_property (source, "refresh");
time = refresh_str ? atoi (refresh_str) : 30;
if (time && !(time % 10080)) {
@@ -418,10 +418,10 @@ set_refresh_time (ESource *source, GtkWidget *spin, GtkWidget *combobox)
gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), time);
}
-static char *
+static gchar *
get_refresh_minutes (GtkWidget *spin, GtkWidget *combobox)
{
- int setting = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spin));
+ gint setting = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spin));
switch (gtk_combo_box_get_active (GTK_COMBO_BOX (combobox))) {
case 0:
/* minutes */
@@ -448,7 +448,7 @@ get_refresh_minutes (GtkWidget *spin, GtkWidget *combobox)
static void
spin_changed (GtkSpinButton *spin, ECalConfigTargetSource *t)
{
- char *refresh_str;
+ gchar *refresh_str;
GtkWidget *combobox;
combobox = g_object_get_data (G_OBJECT (spin), "combobox");
@@ -461,7 +461,7 @@ spin_changed (GtkSpinButton *spin, ECalConfigTargetSource *t)
static void
combobox_changed (GtkComboBox *combobox, ECalConfigTargetSource *t)
{
- char *refresh_str;
+ gchar *refresh_str;
GtkWidget *spin;
spin = g_object_get_data (G_OBJECT (combobox), "spin");
@@ -476,11 +476,11 @@ e_calendar_weather_refresh (EPlugin *epl, EConfigHookItemFactoryData *data)
{
static GtkWidget *label;
GtkWidget *spin, *combobox, *hbox, *parent;
- int row;
+ gint row;
ECalConfigTargetSource *t = (ECalConfigTargetSource *) data->target;
ESource *source = t->source;
EUri *uri;
- char *uri_text;
+ gchar *uri_text;
static GtkWidget *hidden = NULL;
if (!hidden)
@@ -492,7 +492,7 @@ e_calendar_weather_refresh (EPlugin *epl, EConfigHookItemFactoryData *data)
uri_text = e_source_get_uri (t->source);
uri = e_uri_new (uri_text);
g_free (uri_text);
- if (strcmp ((const char *)uri->protocol, "weather")) {
+ if (strcmp ((const gchar *)uri->protocol, "weather")) {
e_uri_free (uri);
return hidden;
}
@@ -537,13 +537,13 @@ e_calendar_weather_refresh (EPlugin *epl, EConfigHookItemFactoryData *data)
static void
set_units (ESource *source, GtkWidget *combobox)
{
- const char *format = e_source_get_property (source, "units");
+ const gchar *format = e_source_get_property (source, "units");
if (format == NULL) {
format = e_source_get_property (source, "temperature");
if (format == NULL) {
e_source_set_property (source, "units", "metric");
gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), 0);
- } else if (strcmp ((const char *)format, "fahrenheit") == 0) {
+ } else if (strcmp ((const gchar *)format, "fahrenheit") == 0) {
/* old format, convert */
e_source_set_property (source, "units", "imperial");
gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), 1);
@@ -552,7 +552,7 @@ set_units (ESource *source, GtkWidget *combobox)
gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), 0);
}
} else {
- if (strcmp ((const char *)format, "metric") == 0)
+ if (strcmp ((const gchar *)format, "metric") == 0)
gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), 0);
else
gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), 1);
@@ -562,7 +562,7 @@ set_units (ESource *source, GtkWidget *combobox)
static void
units_changed (GtkComboBox *combobox, ECalConfigTargetSource *t)
{
- int choice = gtk_combo_box_get_active (GTK_COMBO_BOX (combobox));
+ gint choice = gtk_combo_box_get_active (GTK_COMBO_BOX (combobox));
if (choice == 0)
e_source_set_property (t->source, "units", "metric");
else
@@ -574,11 +574,11 @@ e_calendar_weather_units (EPlugin *epl, EConfigHookItemFactoryData *data)
{
static GtkWidget *label;
GtkWidget *combobox, *parent;
- int row;
+ gint row;
ECalConfigTargetSource *t = (ECalConfigTargetSource *) data->target;
ESource *source = t->source;
EUri *uri;
- char *uri_text;
+ gchar *uri_text;
static GtkWidget *hidden = NULL;
if (!hidden)
@@ -590,7 +590,7 @@ e_calendar_weather_units (EPlugin *epl, EConfigHookItemFactoryData *data)
uri_text = e_source_get_uri (t->source);
uri = e_uri_new (uri_text);
g_free (uri_text);
- if (strcmp ((const char *)uri->protocol, "weather")) {
+ if (strcmp ((const gchar *)uri->protocol, "weather")) {
e_uri_free (uri);
return hidden;
}