Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
xfce4-weather-plugin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
25
Issues
25
List
Boards
Labels
Service Desk
Milestones
Custom Issue Tracker
Custom Issue Tracker
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Panel Plugins
xfce4-weather-plugin
Commits
bf677ce8
Commit
bf677ce8
authored
Dec 10, 2012
by
Harald Judt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cppcheck test results.
parent
84b595ba
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
15 additions
and
37 deletions
+15
-37
panel-plugin/weather-config.c
panel-plugin/weather-config.c
+2
-5
panel-plugin/weather-data.c
panel-plugin/weather-data.c
+2
-3
panel-plugin/weather-debug.c
panel-plugin/weather-debug.c
+3
-5
panel-plugin/weather-icon.c
panel-plugin/weather-icon.c
+0
-1
panel-plugin/weather-scrollbox.c
panel-plugin/weather-scrollbox.c
+1
-1
panel-plugin/weather-search.c
panel-plugin/weather-search.c
+1
-2
panel-plugin/weather-summary.c
panel-plugin/weather-summary.c
+1
-1
panel-plugin/weather-translate.c
panel-plugin/weather-translate.c
+1
-5
panel-plugin/weather.c
panel-plugin/weather.c
+4
-14
No files found.
panel-plugin/weather-config.c
View file @
bf677ce8
...
...
@@ -222,7 +222,7 @@ cb_lookup_altitude(SoupSession *session,
gpointer
user_data
)
{
xfceweather_dialog
*
dialog
=
(
xfceweather_dialog
*
)
user_data
;
xml_altitude
*
altitude
=
NULL
;
xml_altitude
*
altitude
;
gdouble
alt
;
altitude
=
(
xml_altitude
*
)
...
...
@@ -248,7 +248,7 @@ cb_lookup_timezone(SoupSession *session,
gpointer
user_data
)
{
xfceweather_dialog
*
dialog
=
(
xfceweather_dialog
*
)
user_data
;
xml_timezone
*
timezone
=
NULL
;
xml_timezone
*
timezone
;
gint
tz
;
timezone
=
(
xml_timezone
*
)
...
...
@@ -1002,9 +1002,6 @@ button_scrollbox_color_pressed(GtkWidget *button,
gpointer
user_data
)
{
xfceweather_dialog
*
dialog
=
(
xfceweather_dialog
*
)
user_data
;
GtkStyle
*
style
;
GdkColor
color
;
gchar
*
colstr
;
if
(
event
->
type
!=
GDK_BUTTON_PRESS
)
return
FALSE
;
...
...
panel-plugin/weather-data.c
View file @
bf677ce8
...
...
@@ -415,8 +415,7 @@ make_combined_timeslice(xml_weather *wd,
const
xml_time
*
interval
,
const
time_t
*
between_t
)
{
xml_time
*
comb
,
*
start
=
NULL
,
*
end
=
NULL
;
xml_location
*
combloc
,
*
startloc
,
*
endloc
;
xml_time
*
comb
,
*
start
,
*
end
;
gboolean
ipol
=
(
between_t
!=
NULL
)
?
TRUE
:
FALSE
;
guint
i
;
...
...
@@ -788,7 +787,7 @@ find_point_data(const xml_weather *wd,
const
gdouble
min_diff
,
const
gdouble
max_diff
)
{
point_data_results
*
found
=
NULL
;
point_data_results
*
found
;
xml_time
*
timeslice
;
guint
i
;
gdouble
diff
;
...
...
panel-plugin/weather-debug.c
View file @
bf677ce8
...
...
@@ -113,7 +113,6 @@ gchar *
weather_debug_strftime_t
(
const
time_t
t
)
{
struct
tm
tm
;
gchar
*
res
;
gchar
str
[
20
];
size_t
size
;
...
...
@@ -228,14 +227,14 @@ weather_dump_astrodata(const xml_astro *astro)
{
gchar
*
out
,
*
sunrise
,
*
sunset
,
*
moonrise
,
*
moonset
;
if
(
!
astro
)
return
g_strdup
(
"No astronomical data."
);
sunrise
=
weather_debug_strftime_t
(
astro
->
sunrise
);
sunset
=
weather_debug_strftime_t
(
astro
->
sunset
);
moonrise
=
weather_debug_strftime_t
(
astro
->
moonrise
);
moonset
=
weather_debug_strftime_t
(
astro
->
moonset
);
if
(
!
astro
)
return
g_strdup
(
"No astronomical data."
);
out
=
g_strdup_printf
(
"Astronomical data:
\n
"
" --------------------------------------------
\n
"
" sunrise: %s
\n
"
...
...
@@ -408,7 +407,6 @@ gchar *
weather_dump_plugindata
(
const
plugin_data
*
data
)
{
GString
*
out
;
GtkOrientation
orientation
,
panel_orientation
;
gchar
*
last_astro_update
,
*
last_data_update
,
*
last_conditions_update
;
gchar
*
result
;
...
...
panel-plugin/weather-icon.c
View file @
bf677ce8
...
...
@@ -46,7 +46,6 @@ get_icon(const icon_theme *theme,
GdkPixbuf
*
image
=
NULL
;
const
gchar
*
dir
;
gchar
*
filename
,
*
suffix
=
""
;
guint
i
;
g_assert
(
theme
!=
NULL
);
if
(
G_UNLIKELY
(
!
theme
))
{
...
...
panel-plugin/weather-scrollbox.c
View file @
bf677ce8
...
...
@@ -380,7 +380,7 @@ void
gtk_scrollbox_set_color
(
GtkScrollbox
*
self
,
const
GdkColor
color
)
{
PangoAttribute
*
pattr
=
NULL
;
PangoAttribute
*
pattr
;
g_return_if_fail
(
GTK_IS_SCROLLBOX
(
self
));
...
...
panel-plugin/weather-search.c
View file @
bf677ce8
...
...
@@ -364,9 +364,8 @@ cb_geolocation(SoupSession *session,
{
geolocation_data
*
data
=
(
geolocation_data
*
)
user_data
;
xml_geolocation
*
geo
;
gchar
*
full_loc
,
*
p
;
gchar
*
full_loc
;
units_config
*
units
;
gsize
length
;
geo
=
(
xml_geolocation
*
)
parse_xml_document
(
msg
,
(
XmlParseFunc
)
parse_geolocation
);
...
...
panel-plugin/weather-summary.c
View file @
bf677ce8
...
...
@@ -254,7 +254,7 @@ static GtkWidget *
weather_summary_get_logo
(
plugin_data
*
data
)
{
GtkWidget
*
image
=
gtk_image_new
();
GdkPixbuf
*
pixbuf
=
NULL
;
GdkPixbuf
*
pixbuf
;
gchar
*
path
=
get_logo_path
();
pixbuf
=
gdk_pixbuf_new_from_file
(
path
,
NULL
);
...
...
panel-plugin/weather-translate.c
View file @
bf677ce8
...
...
@@ -240,14 +240,10 @@ translate_day(const gint weekday)
gchar
*
translate_wind_direction
(
const
gchar
*
wdir
)
{
gint
wdir_len
;
gchar
*
wdir_loc
,
*
tmp
,
wdir_i
[
2
];
guint
i
;
if
(
wdir
==
NULL
||
(
wdir_len
=
strlen
(
wdir
))
<
1
)
return
NULL
;
if
(
strchr
(
wdir
,
'/'
))
/* N/A */
if
(
wdir
==
NULL
||
strlen
(
wdir
)
<
1
)
return
NULL
;
/*
...
...
panel-plugin/weather.c
View file @
bf677ce8
...
...
@@ -198,7 +198,7 @@ get_cache_directory(void)
void
update_icon
(
plugin_data
*
data
)
{
GdkPixbuf
*
icon
=
NULL
;
GdkPixbuf
*
icon
;
xml_time
*
conditions
;
gchar
*
str
;
gint
size
;
...
...
@@ -298,8 +298,7 @@ update_current_conditions(plugin_data *data)
/* use exact 5 minute intervals for calculation */
time
(
&
data
->
last_conditions_update
);
now_tm
=
*
localtime
(
&
data
->
last_conditions_update
);
if
(
now_tm
.
tm_min
%
5
<
5
)
now_tm
.
tm_min
-=
(
now_tm
.
tm_min
%
5
);
now_tm
.
tm_min
-=
(
now_tm
.
tm_min
%
5
);
if
(
now_tm
.
tm_min
<
0
)
now_tm
.
tm_min
=
0
;
now_tm
.
tm_sec
=
0
;
...
...
@@ -764,7 +763,6 @@ static gchar *
cache_file_strftime_t
(
const
time_t
t
)
{
struct
tm
*
tm
;
gchar
*
res
;
gchar
str
[
21
];
size_t
size
;
...
...
@@ -1175,7 +1173,7 @@ weather_get_tooltip_text(const plugin_data *data)
{
xml_time
*
conditions
;
struct
tm
*
point_tm
,
*
start_tm
,
*
end_tm
,
*
sunrise_tm
,
*
sunset_tm
;
gchar
*
text
,
*
sym
,
*
symbol
,
*
alt
,
*
lat
,
*
lon
,
*
temp
;
gchar
*
text
,
*
sym
,
*
alt
,
*
temp
;
gchar
*
windspeed
,
*
windbeau
,
*
winddir
,
*
winddir_trans
,
*
winddeg
;
gchar
*
pressure
,
*
humidity
,
*
precipitations
;
gchar
*
fog
,
*
cloudiness
,
*
sunval
,
*
value
;
...
...
@@ -1215,10 +1213,7 @@ weather_get_tooltip_text(const plugin_data *data)
sunval
=
g_strdup_printf
(
""
);
sym
=
get_data
(
conditions
,
data
->
units
,
SYMBOL
,
FALSE
);
DATA_AND_UNIT
(
symbol
,
SYMBOL
);
DATA_AND_UNIT
(
alt
,
ALTITUDE
);
DATA_AND_UNIT
(
lat
,
LATITUDE
);
DATA_AND_UNIT
(
lon
,
LONGITUDE
);
DATA_AND_UNIT
(
temp
,
TEMPERATURE
);
DATA_AND_UNIT
(
windspeed
,
WIND_SPEED
);
DATA_AND_UNIT
(
windbeau
,
WIND_BEAUFORT
);
...
...
@@ -1272,8 +1267,7 @@ weather_get_tooltip_text(const plugin_data *data)
"<b>Pressure:</b> %s <b>Humidity:</b> %s
\n
"
"<b>Fog:</b> %s <b>Cloudiness:</b> %s
\n\n
"
"<span size=
\"
smaller
\"
>%s</span>"
),
data
->
location_name
,
alt
,
data
->
location_name
,
alt
,
translate_desc
(
sym
,
data
->
night_time
),
interval_start
,
interval_end
,
precipitations
,
...
...
@@ -1286,10 +1280,7 @@ weather_get_tooltip_text(const plugin_data *data)
}
g_free
(
sunval
);
g_free
(
sym
);
g_free
(
symbol
);
g_free
(
alt
);
g_free
(
lat
);
g_free
(
lon
);
g_free
(
temp
);
g_free
(
windspeed
);
g_free
(
windbeau
);
...
...
@@ -1350,7 +1341,6 @@ static plugin_data *
xfceweather_create_control
(
XfcePanelPlugin
*
plugin
)
{
plugin_data
*
data
=
g_slice_new0
(
plugin_data
);
SoupMessage
*
msg
;
SoupURI
*
soup_proxy_uri
;
const
gchar
*
proxy_uri
;
GtkWidget
*
refresh
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment