GObject base_instance;
gchar *dot_dir;
+ gchar *data_dir;
gchar *accel_map_file;
gchar *toolbars_file;
gchar *crashed_file;
g_free (application->dot_dir);
application->dot_dir = NULL;
+ g_free (application->data_dir);
+ application->data_dir = NULL;
g_free (application->filechooser_open_uri);
application->filechooser_open_uri = NULL;
g_free (application->filechooser_save_uri);
{
gint i;
const gchar *home_dir;
+ gchar *toolbar_path;
ev_application->dot_dir = g_build_filename (g_get_home_dir (),
".gnome2",
if (!ev_dir_ensure_exists (ev_application->dot_dir, 0700))
exit (1);
+#ifdef G_OS_WIN32
+{
+ gchar *dir;
+
+ dir = g_win32_get_package_installation_directory_of_module (NULL);
+ ev_application->data_dir = g_build_filename (dir, "share", "evince", NULL);
+ g_free (dir);
+}
+#else
+ ev_application->data_dir = g_strdup (DATADIR);
+#endif
+
ev_application_init_session (ev_application);
home_dir = g_get_home_dir ();
ev_application->toolbars_file = g_build_filename
(ev_application->dot_dir, "evince_toolbar.xml", NULL);
+ toolbar_path = g_build_filename (ev_application->data_dir,
+ "evince-toolbar.xml", NULL);
egg_toolbars_model_load_names (ev_application->toolbars_model,
- DATADIR "/evince-toolbar.xml");
+ toolbar_path);
if (!egg_toolbars_model_load_toolbars (ev_application->toolbars_model,
ev_application->toolbars_file)) {
egg_toolbars_model_load_toolbars (ev_application->toolbars_model,
- DATADIR"/evince-toolbar.xml");
+ toolbar_path);
}
+ g_free (toolbar_path);
/* Open item doesn't exist anymore,
* convert it to OpenRecent for compatibility
{
return application->dot_dir;
}
+
+const gchar *
+ev_application_get_data_dir (EvApplication *application)
+{
+ return application->data_dir;
+}
GError *error = NULL;
GtkWidget *sidebar_widget;
GObject *mpkeys;
+ gchar *ui_path;
g_signal_connect (ev_window, "configure_event",
G_CALLBACK (window_configure_event_cb), NULL);
gtk_ui_manager_insert_action_group (ev_window->priv->ui_manager,
action_group, 0);
- if (!gtk_ui_manager_add_ui_from_file (ev_window->priv->ui_manager,
- DATADIR"/evince-ui.xml",
- &error)) {
+ ui_path = g_build_filename (ev_application_get_data_dir (EV_APP),
+ "evince-ui.xml", NULL);
+ if (!gtk_ui_manager_add_ui_from_file (
+ ev_window->priv->ui_manager, ui_path, &error))
+ {
g_warning ("building menus failed: %s", error->message);
g_error_free (error);
}
+ g_free (ui_path);
ev_window->priv->recent_manager = gtk_recent_manager_get_default ();
ev_window->priv->recent_action_group = NULL;