[gtranslator] Move ui files to the ui dir.
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtranslator] Move ui files to the ui dir.
- Date: Sat, 30 Apr 2011 12:49:48 +0000 (UTC)
commit f27e8733df4d42c7f2e60b35925fa3f23594b3af
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Sat Apr 30 14:50:00 2011 +0200
Move ui files to the ui dir.
data/Makefile.am | 2 +-
src/gtr-application.c | 4 +---
src/gtr-language.c | 4 +---
src/gtr-view.c | 8 +++++---
src/gtr-window.c | 8 ++------
5 files changed, 10 insertions(+), 16 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index 7b63b10..fc34c8a 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -7,7 +7,7 @@ SUBDIRS = \
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = gtranslator.pc
-uidir = $(pkgdatadir)
+uidir = $(pkgdatadir)/ui
ui_DATA = \
gtranslator-ui.xml \
gtr-toolbar.xml \
diff --git a/src/gtr-application.c b/src/gtr-application.c
index 9c5f679..0c3574a 100644
--- a/src/gtr-application.c
+++ b/src/gtr-application.c
@@ -177,7 +177,6 @@ gtr_application_init (GtrApplication *application)
{
GtrApplicationPrivate *priv;
const gchar *gtr_folder;
- const gchar *data_dir;
gchar *path_default_gtr_toolbar;
gchar *profiles_file;
@@ -208,8 +207,7 @@ gtr_application_init (GtrApplication *application)
priv->toolbars_file = g_build_filename (gtr_folder,
"gtr-toolbar.xml", NULL);
- data_dir = gtr_dirs_get_gtr_data_dir ();
- path_default_gtr_toolbar = g_build_filename (data_dir, "gtr-toolbar.xml", NULL);
+ path_default_gtr_toolbar = gtr_dirs_get_ui_file ("gtr-toolbar.xml");
egg_toolbars_model_load_names (priv->toolbars_model,
path_default_gtr_toolbar);
diff --git a/src/gtr-language.c b/src/gtr-language.c
index 63f1186..e9ee682 100644
--- a/src/gtr-language.c
+++ b/src/gtr-language.c
@@ -217,9 +217,7 @@ gtr_language_lazy_init (void)
return;
plurals_file = g_key_file_new ();
- filename = g_build_filename (gtr_dirs_get_gtr_data_dir (),
- GTR_PLURAL_FORMS_FILENAME,
- NULL);
+ filename = gtr_dirs_get_ui_file (GTR_PLURAL_FORMS_FILENAME);
if (!g_key_file_load_from_file (plurals_file, filename, G_KEY_FILE_NONE, NULL))
{
g_warning ("Bad plugin file: '%s'", filename);
diff --git a/src/gtr-view.c b/src/gtr-view.c
index df4cc3a..8242257 100644
--- a/src/gtr-view.c
+++ b/src/gtr-view.c
@@ -100,7 +100,7 @@ gtr_view_init (GtrView * view)
GPtrArray *dirs;
gchar **langs;
const gchar *const *temp;
- const gchar *datadir;
+ gchar *ui_dir;
GtrViewPrivate *priv;
view->priv = GTR_VIEW_GET_PRIVATE (view);
@@ -117,11 +117,13 @@ gtr_view_init (GtrView * view)
temp != NULL && *temp != NULL; ++temp)
g_ptr_array_add (dirs, g_strdup (*temp));
- datadir = gtr_dirs_get_gtr_data_dir ();
- g_ptr_array_add (dirs, g_strdup (datadir));
+ ui_dir = g_build_filename (gtr_dirs_get_gtr_data_dir (), "ui", NULL);
+ g_ptr_array_add (dirs, g_strdup (ui_dir));
g_ptr_array_add (dirs, NULL);
langs = (gchar **) g_ptr_array_free (dirs, FALSE);
+ g_free (ui_dir);
+
gtk_source_language_manager_set_search_path (lm, langs);
lang = gtk_source_language_manager_get_language (lm, "gtranslator");
g_strfreev (langs);
diff --git a/src/gtr-window.c b/src/gtr-window.c
index 2d25e2b..fe24132 100644
--- a/src/gtr-window.c
+++ b/src/gtr-window.c
@@ -363,11 +363,9 @@ gtr_window_layout_load (GtrWindow * window,
!gdl_dock_layout_load_from_file (window->priv->layout_manager,
layout_filename))
{
- const gchar *datadir;
gchar *path;
- datadir = gtr_dirs_get_gtr_data_dir ();
- path = g_build_filename (datadir, "layout.xml", NULL);
+ path = gtr_dirs_get_ui_file ("layout.xml");
//DEBUG_PRINT ("Layout = %s", path);
if (!gdl_dock_layout_load_from_file (window->priv->layout_manager,
@@ -1629,7 +1627,6 @@ gtr_window_draw (GtrWindow * window)
GError *error = NULL;
GtkWidget *dockbar;
GtkActionGroup *action_group;
- const gchar *datadir;
gchar *path;
GtrWindowPrivate *priv = window->priv;
@@ -1673,8 +1670,7 @@ gtr_window_draw (GtrWindow * window)
gtk_ui_manager_insert_action_group (priv->ui_manager, action_group, 0);
g_object_unref (action_group);
- datadir = gtr_dirs_get_gtr_data_dir ();
- path = g_build_filename (datadir, "gtranslator-ui.xml", NULL);
+ path = gtr_dirs_get_ui_file ("gtranslator-ui.xml");
if (!gtk_ui_manager_add_ui_from_file (priv->ui_manager, path, &error))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]