[Xfce4-commits] <xfce4-weather-plugin:master> Replace 'datas' with 'data_types'.
Harald Judt
noreply at xfce.org
Fri Aug 3 01:06:01 CEST 2012
Updating branch refs/heads/master
to 325e943c0868b6f8fbc4bc421fb26e8697c233e4 (commit)
from ea6d034dd894dbbe4698fe4b1a080372248dba05 (commit)
commit 325e943c0868b6f8fbc4bc421fb26e8697c233e4
Author: Harald Judt <h.judt at gmx.at>
Date: Thu Aug 2 23:23:43 2012 +0200
Replace 'datas' with 'data_types'.
Also replace 'opt' with 'type' where appropriate.
panel-plugin/weather-config.c | 10 +++++-----
panel-plugin/weather-config.h | 2 +-
panel-plugin/weather-data.c | 4 ++--
panel-plugin/weather-data.h | 6 +++---
panel-plugin/weather.c | 27 ++++++++++++++-------------
5 files changed, 25 insertions(+), 24 deletions(-)
diff --git a/panel-plugin/weather-config.c b/panel-plugin/weather-config.c
index b6bfa48..2d87650 100644
--- a/panel-plugin/weather-config.c
+++ b/panel-plugin/weather-config.c
@@ -271,7 +271,7 @@ apply_options(xfceweather_dialog *dialog)
if (data->labels && data->labels->len > 0)
g_array_free(data->labels, TRUE);
- data->labels = g_array_new(FALSE, TRUE, sizeof(datas));
+ data->labels = g_array_new(FALSE, TRUE, sizeof(data_types));
for (hasiter =
gtk_tree_model_get_iter_first(GTK_TREE_MODEL
(dialog->mdl_xmloption),
@@ -350,7 +350,7 @@ apply_options(xfceweather_dialog *dialog)
static int
-option_i(const datas opt)
+option_i(const data_types opt)
{
guint i;
@@ -466,7 +466,7 @@ create_config_dialog(xfceweather_data *data,
GtkSizeGroup *sg, *sg_buttons;
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
- datas opt;
+ data_types type;
guint i;
gint n;
@@ -668,9 +668,9 @@ create_config_dialog(xfceweather_data *data,
if (data->labels->len > 0) {
for (i = 0; i < data->labels->len; i++) {
- opt = g_array_index(data->labels, datas, i);
+ type = g_array_index(data->labels, data_types, i);
- if ((n = option_i(opt)) != -1)
+ if ((n = option_i(type)) != -1)
add_mdl_option(dialog->mdl_xmloption, n);
}
}
diff --git a/panel-plugin/weather-config.h b/panel-plugin/weather-config.h
index 224afa3..3b05f4e 100644
--- a/panel-plugin/weather-config.h
+++ b/panel-plugin/weather-config.h
@@ -22,7 +22,7 @@ G_BEGIN_DECLS
typedef struct {
gchar *name;
- datas number;
+ data_types number;
} labeloption;
typedef struct {
diff --git a/panel-plugin/weather-data.c b/panel-plugin/weather-data.c
index f6c0ad1..2fd581f 100644
--- a/panel-plugin/weather-data.c
+++ b/panel-plugin/weather-data.c
@@ -55,7 +55,7 @@ has_timeslice(xml_weather *data,
gchar *
get_data(const xml_time *timeslice,
const unit_systems unit_system,
- const datas type)
+ const data_types type)
{
const xml_location *loc = NULL;
double val;
@@ -135,7 +135,7 @@ get_data(const xml_time *timeslice,
const gchar *
get_unit(const unit_systems unit_system,
- const datas type)
+ const data_types type)
{
switch (type) {
case ALTITUDE:
diff --git a/panel-plugin/weather-data.h b/panel-plugin/weather-data.h
index 4f9eb00..673161e 100644
--- a/panel-plugin/weather-data.h
+++ b/panel-plugin/weather-data.h
@@ -38,7 +38,7 @@ typedef enum {
FOG,
PRECIPITATIONS,
SYMBOL
-} datas;
+} data_types;
typedef enum {
IMPERIAL,
@@ -55,10 +55,10 @@ typedef enum {
gchar *get_data(const xml_time *timeslice,
unit_systems unit_system,
- datas type);
+ data_types type);
const gchar *get_unit(unit_systems unit_system,
- datas type);
+ data_types type);
gboolean is_night_time(const xml_astro *astro);
diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index af1d970..57ca77b 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -125,13 +125,13 @@ get_label_size(xfceweather_data *data)
static gchar *
make_label(xfceweather_data *data,
- datas opt)
+ data_types type)
{
xml_time *conditions;
const gchar *lbl, *txtsize, *unit;
gchar *str, *value, *rawvalue;
- switch (opt) {
+ switch (type) {
case TEMPERATURE:
lbl = _("T");
break;
@@ -180,9 +180,9 @@ make_label(xfceweather_data *data,
/* get current weather conditions */
conditions = get_current_conditions(data->weatherdata);
- rawvalue = get_data(conditions, data->unit_system, opt);
+ rawvalue = get_data(conditions, data->unit_system, type);
- switch (opt) {
+ switch (type) {
case WIND_DIRECTION:
value = translate_wind_direction(rawvalue);
break;
@@ -200,7 +200,7 @@ make_label(xfceweather_data *data,
txtsize, lbl, value);
g_free(value);
} else {
- unit = get_unit(data->unit_system, opt);
+ unit = get_unit(data->unit_system, type);
str = g_strdup_printf("<span size=\"%s\">%s: %s%s%s</span>",
txtsize, lbl, rawvalue,
strcmp(unit, "°") ? " " : "", unit);
@@ -211,7 +211,7 @@ make_label(xfceweather_data *data,
txtsize, value);
g_free(value);
} else {
- unit = get_unit(data->unit_system, opt);
+ unit = get_unit(data->unit_system, type);
str = g_strdup_printf("<span size=\"%s\">%s%s%s</span>",
txtsize, rawvalue,
strcmp(unit, "°") ? " " : "", unit);
@@ -275,13 +275,13 @@ set_icon_current(xfceweather_data *data)
xml_time *conditions;
guint i;
GdkPixbuf *icon = NULL;
- datas opt;
+ data_types type;
gchar *str;
gint size, height;
for (i = 0; i < data->labels->len; i++) {
- opt = g_array_index(data->labels, datas, i);
- str = make_label(data, opt);
+ type = g_array_index(data->labels, data_types, i);
+ str = make_label(data, type);
gtk_scrollbox_set_label(GTK_SCROLLBOX(data->scrollbox), -1, str);
g_free(str);
}
@@ -558,7 +558,7 @@ labels_clear(GArray *array)
if (!array || array->len > 0) {
if (array)
g_array_free(array, TRUE);
- array = g_array_new(FALSE, TRUE, sizeof(datas));
+ array = g_array_new(FALSE, TRUE, sizeof(data_types));
}
return array;
}
@@ -712,7 +712,8 @@ xfceweather_write_config(XfcePanelPlugin *plugin,
for (i = 0; i < data->labels->len; i++) {
g_snprintf(label, 10, "label%d", i);
xfce_rc_write_int_entry(rc, label,
- (gint) g_array_index(data->labels, datas, i));
+ (gint) g_array_index(data->labels,
+ data_types, i));
}
xfce_rc_close(rc);
@@ -1025,7 +1026,7 @@ xfceweather_create_control(XfcePanelPlugin *plugin)
{
xfceweather_data *data = g_slice_new0(xfceweather_data);
GtkWidget *refresh, *mi;
- datas lbl;
+ data_types lbl;
GdkPixbuf *icon = NULL;
/* Initialize with sane default values */
@@ -1056,7 +1057,7 @@ xfceweather_create_control(XfcePanelPlugin *plugin)
if (G_LIKELY(icon))
g_object_unref(G_OBJECT(icon));
- data->labels = g_array_new(FALSE, TRUE, sizeof(datas));
+ data->labels = g_array_new(FALSE, TRUE, sizeof(data_types));
data->vbox_center_scrollbox = gtk_vbox_new(FALSE, 0);
data->top_hbox = gtk_hbox_new(FALSE, 0);
More information about the Xfce4-commits
mailing list