[Xfce4-commits] <xfce4-weather-plugin:master> Add function to determine timeslice type.
Harald Judt
noreply at xfce.org
Sun Dec 9 23:44:33 CET 2012
Updating branch refs/heads/master
to 29d0da2a09d1583e97b8a1fdf8d554079244571a (commit)
from 4eec4c7d19b113ecf422139ab0c5877b2df471a9 (commit)
commit 29d0da2a09d1583e97b8a1fdf8d554079244571a
Author: Harald Judt <h.judt at gmx.at>
Date: Sun Dec 9 19:25:06 2012 +0100
Add function to determine timeslice type.
Check whether timeslice contains interval or point data.
panel-plugin/weather-data.c | 9 +++++++++
panel-plugin/weather-data.h | 2 ++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/panel-plugin/weather-data.c b/panel-plugin/weather-data.c
index bcc7e92..bf4da51 100644
--- a/panel-plugin/weather-data.c
+++ b/panel-plugin/weather-data.c
@@ -67,6 +67,15 @@ string_to_double(const gchar *str,
}
+/* check whether timeslice is interval or point data */
+gboolean
+timeslice_is_interval(xml_time *timeslice)
+{
+ return (timeslice->location->symbol != NULL ||
+ timeslice->location->precipitation_value != NULL);
+}
+
+
gchar *
get_data(const xml_time *timeslice,
const units_config *units,
diff --git a/panel-plugin/weather-data.h b/panel-plugin/weather-data.h
index e2c4eb4..12fbb6e 100644
--- a/panel-plugin/weather-data.h
+++ b/panel-plugin/weather-data.h
@@ -89,6 +89,8 @@ typedef struct {
gdouble string_to_double(const gchar *str,
gdouble backup);
+gboolean timeslice_is_interval(xml_time *timeslice);
+
gchar *get_data(const xml_time *timeslice,
const units_config *units,
data_types type,
More information about the Xfce4-commits
mailing list