diff options
| author | monsta <[email protected]> | 2017-12-20 17:31:48 +0300 |
|---|---|---|
| committer | monsta <[email protected]> | 2017-12-21 21:37:30 +0300 |
| commit | 5607600446ee672e6d49509957dcaad3cde2cefb (patch) | |
| tree | 89e1b5a7e0a11ca54923cd43541f9902d08c5e04 | |
| parent | c776a6400df26794aecae98d73c8fb913d8d3c05 (diff) | |
| download | pluma-5607600446ee672e6d49509957dcaad3cde2cefb.tar.bz2 pluma-5607600446ee672e6d49509957dcaad3cde2cefb.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.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/pluma/pluma-window.c b/pluma/pluma-window.c index 8bff1509..5577782e 100644 --- a/pluma/pluma-window.c +++ b/pluma/pluma-window.c @@ -1089,7 +1089,7 @@ _pluma_recent_add (PlumaWindow *window, const gchar *mime) { GtkRecentManager *recent_manager; - GtkRecentData *recent_data; + GtkRecentData recent_data; static gchar *groups[2] = { "pluma", @@ -1098,23 +1098,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 |
