summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2017-12-20 17:31:48 +0300
committermonsta <[email protected]>2017-12-20 17:31:48 +0300
commite86397d000d3d307cb425404c74f963c0073b99b (patch)
tree6808c02bc970dd5f52e0d985c8b6ec0b2b5b672f
parent206ca3be6dc6e7a0bbb2373285a65e31e94b747c (diff)
downloadpluma-e86397d000d3d307cb425404c74f963c0073b99b.tar.bz2
pluma-e86397d000d3d307cb425404c74f963c0073b99b.tar.xz
pluma-window: have GtkRecentData on stack instead of allocating it
adapted from: https://git.gnome.org/browse/gedit/commit/?id=cd9ed7b05eb0397ac3345d7e5177d2a112e7874b
-rw-r--r--pluma/pluma-window.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/pluma/pluma-window.c b/pluma/pluma-window.c
index 8e107f92..e56fd84f 100644
--- a/pluma/pluma-window.c
+++ b/pluma/pluma-window.c
@@ -1138,7 +1138,7 @@ _pluma_recent_add (PlumaWindow *window,
const gchar *mime)
{
GtkRecentManager *recent_manager;
- GtkRecentData *recent_data;
+ GtkRecentData recent_data;
static gchar *groups[2] = {
"pluma",
@@ -1147,23 +1147,19 @@ _pluma_recent_add (PlumaWindow *window,
recent_manager = gtk_recent_manager_get_default ();
- recent_data = g_slice_new (GtkRecentData);
-
- recent_data->display_name = NULL;
- recent_data->description = NULL;
- recent_data->mime_type = (gchar *) mime;
- recent_data->app_name = (gchar *) g_get_application_name ();
- recent_data->app_exec = g_strjoin (" ", g_get_prgname (), "%u", NULL);
- recent_data->groups = groups;
- recent_data->is_private = FALSE;
+ recent_data.display_name = NULL;
+ recent_data.description = NULL;
+ recent_data.mime_type = (gchar *) mime;
+ recent_data.app_name = (gchar *) g_get_application_name ();
+ recent_data.app_exec = g_strjoin (" ", g_get_prgname (), "%u", NULL);
+ recent_data.groups = groups;
+ recent_data.is_private = FALSE;
gtk_recent_manager_add_full (recent_manager,
uri,
- recent_data);
-
- g_free (recent_data->app_exec);
+ &recent_data);
- g_slice_free (GtkRecentData, recent_data);
+ g_free (recent_data.app_exec);
}
void