summaryrefslogtreecommitdiff
path: root/previewer/ev-previewer-window.c
diff options
context:
space:
mode:
authorChristian Persch <[email protected]>2012-06-12 19:51:29 +0200
committerraveit65 <[email protected]>2018-03-22 21:24:30 +0100
commitc3fe25efdf8861b9e4582d84a320f37e3b89ccbd (patch)
treedb2cd7a55e3bef9780c1ff710ee5567fd7b4185c /previewer/ev-previewer-window.c
parent9668d3f72eda80945a22aaed3ec5ff5079cc62f4 (diff)
downloadatril-c3fe25efdf8861b9e4582d84a320f37e3b89ccbd.tar.bz2
atril-c3fe25efdf8861b9e4582d84a320f37e3b89ccbd.tar.xz
previewer: Use GResource for data files
origin commit: https://git.gnome.org/browse/evince/commit/?h=gnome-3-6&id=45be486
Diffstat (limited to 'previewer/ev-previewer-window.c')
-rw-r--r--previewer/ev-previewer-window.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/previewer/ev-previewer-window.c b/previewer/ev-previewer-window.c
index df1cb7a1..a33929a3 100644
--- a/previewer/ev-previewer-window.c
+++ b/previewer/ev-previewer-window.c
@@ -468,12 +468,6 @@ ev_previewer_window_dispose (GObject *object)
G_OBJECT_CLASS (ev_previewer_window_parent_class)->dispose (object);
}
-static gchar*
-data_dir (void)
-{
- return g_strdup (ATRILDATADIR);
-}
-
static void
ev_previewer_window_init (EvPreviewerWindow *window)
{
@@ -513,7 +507,6 @@ ev_previewer_window_constructor (GType type,
GtkWidget *toolbar;
GtkAction *action;
GError *error = NULL;
- gchar *datadir, *ui_path;
gdouble dpi;
object = G_OBJECT_CLASS (ev_previewer_window_parent_class)->constructor (type,
@@ -566,14 +559,9 @@ ev_previewer_window_constructor (GType type,
window->accels_group, 1);
gtk_window_add_accel_group (GTK_WINDOW (window),
gtk_ui_manager_get_accel_group (window->ui_manager));
- datadir = data_dir ();
- ui_path = g_build_filename (datadir, "atril-previewer-ui.xml", NULL);
- if (!gtk_ui_manager_add_ui_from_file (window->ui_manager, ui_path, &error)) {
- g_warning ("Failed to load ui from atril-previewer-ui.xml: %s", error->message);
- g_error_free (error);
- }
- g_free (ui_path);
- g_free (datadir);
+
+ gtk_ui_manager_add_ui_from_resource (window->ui_manager, "/org/mate/atril/previewer/ui/previewer.xml", &error);
+ g_assert_no_error (error);
/* GTKUIManager connects actions accels only for menu items,
* but not for tool items. See bug #612972.