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
ceb13257
Commit
ceb13257
authored
Dec 09, 2012
by
Harald Judt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move code to create and get cache directory into its own function.
parent
dd32a634
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
10 deletions
+25
-10
panel-plugin/weather-summary.c
panel-plugin/weather-summary.c
+7
-9
panel-plugin/weather.c
panel-plugin/weather.c
+15
-0
panel-plugin/weather.h
panel-plugin/weather.h
+3
-1
No files found.
panel-plugin/weather-summary.c
View file @
ceb13257
...
...
@@ -213,15 +213,13 @@ view_size_allocate_cb(GtkWidget *widget,
static
gchar
*
get_logo_path
(
void
)
{
gchar
*
dir
=
g_strconcat
(
g_get_user_cache_dir
(),
G_DIR_SEPARATOR_S
,
"xfce4"
,
G_DIR_SEPARATOR_S
,
"weather-plugin"
,
NULL
);
g_mkdir_with_parents
(
dir
,
0755
);
g_free
(
dir
);
return
g_strconcat
(
g_get_user_cache_dir
(),
G_DIR_SEPARATOR_S
,
"xfce4"
,
G_DIR_SEPARATOR_S
,
"weather-plugin"
,
G_DIR_SEPARATOR_S
,
"weather_logo.gif"
,
NULL
);
gchar
*
cache_dir
,
*
logo_path
;
cache_dir
=
get_cache_directory
();
logo_path
=
g_strconcat
(
cache_dir
,
G_DIR_SEPARATOR_S
,
"weather_logo.gif"
,
NULL
);
g_free
(
cache_dir
);
return
logo_path
;
}
...
...
panel-plugin/weather.c
View file @
ceb13257
...
...
@@ -161,6 +161,21 @@ make_label(const xfceweather_data *data,
}
/*
* Return the weather plugin cache directory, creating it if
* necessary. The string returned does not contain a trailing slash.
*/
gchar
*
get_cache_directory
(
void
)
{
gchar
*
dir
=
g_strconcat
(
g_get_user_cache_dir
(),
G_DIR_SEPARATOR_S
,
"xfce4"
,
G_DIR_SEPARATOR_S
,
"weather-plugin"
,
NULL
);
g_mkdir_with_parents
(
dir
,
0755
);
return
dir
;
}
void
update_icon
(
xfceweather_data
*
data
)
{
...
...
panel-plugin/weather.h
View file @
ceb13257
...
...
@@ -111,13 +111,15 @@ void scrollbox_set_visible(xfceweather_data *data);
void
forecast_click
(
GtkWidget
*
widget
,
gpointer
user_data
);
gchar
*
get_cache_directory
(
void
);
void
update_icon
(
xfceweather_data
*
data
);
void
update_scrollbox
(
xfceweather_data
*
data
);
void
update_weatherdata_with_reset
(
xfceweather_data
*
data
);
GArray
*
labels_clear
(
GArray
*
array
);
GArray
*
labels_clear
(
GArray
*
array
);
G_END_DECLS
...
...
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