summaryrefslogtreecommitdiff
path: root/src/terminal-window.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-02-22 12:02:30 +0100
committerZenWalker <[email protected]>2019-03-15 20:37:21 +0100
commit449753407d3ecf43e3401363557437984c138941 (patch)
tree9fc9697392d10fce6c36a676e94c7ff16b879ec2 /src/terminal-window.c
parent773ef179210ecc4572ba9df1887ba79ac1eb1876 (diff)
downloadmate-terminal-449753407d3ecf43e3401363557437984c138941.tar.bz2
mate-terminal-449753407d3ecf43e3401363557437984c138941.tar.xz
Use gresources for about_DATA, uimanager_DATA & builder_DATA
Diffstat (limited to 'src/terminal-window.c')
-rw-r--r--src/terminal-window.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 7d623c0..25af081 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -2237,14 +2237,10 @@ terminal_window_init (TerminalWindow *window)
/* Load the UI */
error = NULL;
- priv->ui_id = gtk_ui_manager_add_ui_from_file (manager,
- TERM_PKGDATADIR G_DIR_SEPARATOR_S "terminal.xml",
+ priv->ui_id = gtk_ui_manager_add_ui_from_resource (manager,
+ TERMINAL_RESOURCES_PATH_PREFIX G_DIR_SEPARATOR_S "ui/terminal.xml",
&error);
- if (error)
- {
- g_printerr ("Failed to load UI: %s\n", error->message);
- g_error_free (error);
- }
+ g_assert_no_error (error);
priv->menubar = gtk_ui_manager_get_widget (manager, "/menubar");
gtk_box_pack_start (GTK_BOX (priv->main_vbox),
@@ -4337,26 +4333,31 @@ help_about_callback (GtkAction *action,
"Copyright © 2011 Perberos\n"
"Copyright © 2012-2018 MATE developers";
char *licence_text;
+ GBytes *bytes;
+ const guint8 *data;
GKeyFile *key_file;
GError *error = NULL;
char **authors, **contributors, **artists, **documenters, **array_strv;
- gsize n_authors = 0, n_contributors = 0, n_artists = 0, n_documenters = 0 , i;
+ gsize data_len, n_authors = 0, n_contributors = 0, n_artists = 0, n_documenters = 0 , i;
GPtrArray *array;
+
+ bytes = g_resources_lookup_data (TERMINAL_RESOURCES_PATH_PREFIX G_DIR_SEPARATOR_S "ui/terminal.about",
+ G_RESOURCE_LOOKUP_FLAGS_NONE,
+ &error);
+ g_assert_no_error (error);
+
+ data = g_bytes_get_data (bytes, &data_len);
key_file = g_key_file_new ();
- if (!g_key_file_load_from_file (key_file, TERM_PKGDATADIR G_DIR_SEPARATOR_S "terminal.about", 0, &error))
- {
- g_warning ("Couldn't load about data: %s\n", error->message);
- g_error_free (error);
- g_key_file_free (key_file);
- return;
- }
+ g_key_file_load_from_data (key_file, (const char *) data, data_len, 0, &error);
+ g_assert_no_error (error);
authors = g_key_file_get_string_list (key_file, ABOUT_GROUP, "Authors", &n_authors, NULL);
contributors = g_key_file_get_string_list (key_file, ABOUT_GROUP, "Contributors", &n_contributors, NULL);
artists = g_key_file_get_string_list (key_file, ABOUT_GROUP, "Artists", &n_artists, NULL);
documenters = g_key_file_get_string_list (key_file, ABOUT_GROUP, "Documenters", &n_documenters, NULL);
g_key_file_free (key_file);
+ g_bytes_unref (bytes);
array = g_ptr_array_new ();