summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-02-03 13:34:43 +0100
committerraveit65 <[email protected]>2021-02-25 08:10:37 +0100
commit09179d9d1d686db03701c843172c43c5425afdda (patch)
treeab0870b60ed4ad86f78a7555839c572f604a7e41
parenta17e85d74bc6e6d7927880eaa50bee4141cef58c (diff)
downloadpluma-09179d9d1d686db03701c843172c43c5425afdda.tar.bz2
pluma-09179d9d1d686db03701c843172c43c5425afdda.tar.xz
Drop pluma_dirs_get_ui_file
-rw-r--r--pluma/dialogs/Makefile.am15
-rw-r--r--pluma/dialogs/pluma-encodings-dialog.c5
-rw-r--r--pluma/dialogs/pluma-preferences-dialog.c5
-rw-r--r--pluma/dialogs/pluma-search-dialog.c6
-rw-r--r--pluma/pluma-dirs.c14
-rw-r--r--pluma/pluma-dirs.h2
-rw-r--r--pluma/pluma-print-job.c5
-rw-r--r--pluma/pluma-window.c12
8 files changed, 18 insertions, 46 deletions
diff --git a/pluma/dialogs/Makefile.am b/pluma/dialogs/Makefile.am
index 524f7a6f..246fe51b 100644
--- a/pluma/dialogs/Makefile.am
+++ b/pluma/dialogs/Makefile.am
@@ -1,12 +1,13 @@
uidir = $(datadir)/pluma/ui/
-AM_CPPFLAGS = \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(top_srcdir)/pluma \
- -I$(top_builddir)/pluma \
- $(PLUMA_CFLAGS) \
- $(WARN_CFLAGS)
+AM_CPPFLAGS = \
+ -I$(top_srcdir) \
+ -I$(top_builddir) \
+ -I$(top_srcdir)/pluma \
+ -I$(top_builddir)/pluma \
+ $(PLUMA_CFLAGS) \
+ $(WARN_CFLAGS) \
+ -DPLUMA_DATADIR=\""$(datadir)/pluma"\"
noinst_LTLIBRARIES = libdialogs.la
diff --git a/pluma/dialogs/pluma-encodings-dialog.c b/pluma/dialogs/pluma-encodings-dialog.c
index cff41e2b..d8a8a545 100644
--- a/pluma/dialogs/pluma-encodings-dialog.c
+++ b/pluma/dialogs/pluma-encodings-dialog.c
@@ -316,7 +316,6 @@ pluma_encodings_dialog_init (PlumaEncodingsDialog *dlg)
GtkWidget *error_widget;
int i;
gboolean ret;
- gchar *file;
gchar *root_objects[] = {
"encodings-dialog-contents",
NULL
@@ -346,8 +345,7 @@ pluma_encodings_dialog_init (PlumaEncodingsDialog *dlg)
G_CALLBACK (response_handler),
dlg);
- file = pluma_dirs_get_ui_file ("pluma-encodings-dialog.ui");
- ret = pluma_utils_get_ui_objects (file,
+ ret = pluma_utils_get_ui_objects (PLUMA_DATADIR "/ui/pluma-encodings-dialog.ui",
root_objects,
&error_widget,
"encodings-dialog-contents", &content,
@@ -356,7 +354,6 @@ pluma_encodings_dialog_init (PlumaEncodingsDialog *dlg)
"available-treeview", &dlg->priv->available_treeview,
"displayed-treeview", &dlg->priv->displayed_treeview,
NULL);
- g_free (file);
if (!ret)
{
diff --git a/pluma/dialogs/pluma-preferences-dialog.c b/pluma/dialogs/pluma-preferences-dialog.c
index b0b35482..98338246 100644
--- a/pluma/dialogs/pluma-preferences-dialog.c
+++ b/pluma/dialogs/pluma-preferences-dialog.c
@@ -1211,7 +1211,6 @@ pluma_preferences_dialog_init (PlumaPreferencesDialog *dlg)
{
GtkWidget *error_widget;
gboolean ret;
- gchar *file;
gchar *root_objects[] = {
"notebook",
"adjustment1",
@@ -1243,8 +1242,7 @@ pluma_preferences_dialog_init (PlumaPreferencesDialog *dlg)
G_CALLBACK (dialog_response_handler),
NULL);
- file = pluma_dirs_get_ui_file ("pluma-preferences-dialog.ui");
- ret = pluma_utils_get_ui_objects (file,
+ ret = pluma_utils_get_ui_objects (PLUMA_DATADIR "/ui/pluma-preferences-dialog.ui",
root_objects,
&error_widget,
@@ -1288,7 +1286,6 @@ pluma_preferences_dialog_init (PlumaPreferencesDialog *dlg)
"plugin_manager_place_holder", &dlg->priv->plugin_manager_place_holder,
NULL);
- g_free (file);
if (!ret)
{
diff --git a/pluma/dialogs/pluma-search-dialog.c b/pluma/dialogs/pluma-search-dialog.c
index e4fd38e6..f36e0231 100644
--- a/pluma/dialogs/pluma-search-dialog.c
+++ b/pluma/dialogs/pluma-search-dialog.c
@@ -311,7 +311,6 @@ pluma_search_dialog_init (PlumaSearchDialog *dlg)
GtkWidget *content;
GtkWidget *error_widget;
gboolean ret;
- gchar *file;
gchar *root_objects[] = {
"search_dialog_content",
NULL
@@ -329,9 +328,7 @@ pluma_search_dialog_init (PlumaSearchDialog *dlg)
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))),
2); /* 2 * 5 + 2 = 12 */
- file = pluma_dirs_get_ui_file ("pluma-search-dialog.ui");
-
- ret = pluma_utils_get_ui_objects (file,
+ ret = pluma_utils_get_ui_objects (PLUMA_DATADIR "/ui/pluma-search-dialog.ui",
root_objects,
&error_widget,
"search_dialog_content", &content,
@@ -345,7 +342,6 @@ pluma_search_dialog_init (PlumaSearchDialog *dlg)
"wrap_around_checkbutton", &dlg->priv->wrap_around_checkbutton,
"parse_escapes_checkbutton", &dlg->priv->parse_escapes_checkbutton,
NULL);
- g_free (file);
if (!ret)
{
diff --git a/pluma/pluma-dirs.c b/pluma/pluma-dirs.c
index 96f46a0b..c800f692 100644
--- a/pluma/pluma-dirs.c
+++ b/pluma/pluma-dirs.c
@@ -107,17 +107,3 @@ gchar* pluma_dirs_get_pluma_plugins_data_dir(void)
return plugin_data_dir;
}
-
-gchar* pluma_dirs_get_ui_file(const gchar* file)
-{
- gchar* datadir;
- gchar* ui_file;
-
- g_return_val_if_fail(file != NULL, NULL);
-
- datadir = pluma_dirs_get_pluma_data_dir();
- ui_file = g_build_filename(datadir, "ui", file, NULL);
- g_free(datadir);
-
- return ui_file;
-}
diff --git a/pluma/pluma-dirs.h b/pluma/pluma-dirs.h
index 086ffe3c..4d1708e5 100644
--- a/pluma/pluma-dirs.h
+++ b/pluma/pluma-dirs.h
@@ -46,8 +46,6 @@ gchar *pluma_dirs_get_pluma_plugins_dir (void);
gchar *pluma_dirs_get_pluma_plugins_data_dir (void);
-gchar *pluma_dirs_get_ui_file (const gchar *file);
-
G_END_DECLS
#endif /* __PLUMA_DIRS_H__ */
diff --git a/pluma/pluma-print-job.c b/pluma/pluma-print-job.c
index 601e4927..0e16fe61 100644
--- a/pluma/pluma-print-job.c
+++ b/pluma/pluma-print-job.c
@@ -294,7 +294,6 @@ create_custom_widget_cb (GtkPrintOperation *operation,
GtkWidget *error_widget;
guint line_numbers;
GtkWrapMode wrap_mode;
- gchar *file;
gboolean syntax_hl;
gboolean print_header;
gchar *font_body, *font_header, *font_numbers;
@@ -304,8 +303,7 @@ create_custom_widget_cb (GtkPrintOperation *operation,
NULL
};
- file = pluma_dirs_get_ui_file ("pluma-print-preferences.ui");
- ret = pluma_utils_get_ui_objects (file,
+ ret = pluma_utils_get_ui_objects (PLUMA_DATADIR "/ui/pluma-print-preferences.ui",
root_objects,
&error_widget,
"contents", &widget,
@@ -325,7 +323,6 @@ create_custom_widget_cb (GtkPrintOperation *operation,
"numbers_fontbutton", &job->priv->numbers_fontbutton,
"restore_button", &job->priv->restore_button,
NULL);
- g_free (file);
if (!ret)
{
diff --git a/pluma/pluma-window.c b/pluma/pluma-window.c
index 58d3fcf7..337af89c 100644
--- a/pluma/pluma-window.c
+++ b/pluma/pluma-window.c
@@ -63,7 +63,6 @@
#include "pluma-settings.h"
#define LANGUAGE_NONE (const gchar *)"LangNone"
-#define PLUMA_UIFILE "pluma-ui.xml"
#define TAB_WIDTH_DATA "PlumaWindowTabWidthData"
#define LANGUAGE_DATA "PlumaWindowLanguageData"
#define FULLSCREEN_ANIMATION_SPEED 4
@@ -1505,7 +1504,6 @@ create_menu_bar_and_toolbar (PlumaWindow *window,
GtkUIManager *manager;
GtkRecentManager *recent_manager;
GError *error = NULL;
- gchar *ui_file;
pluma_debug (DEBUG_WINDOW);
@@ -1590,14 +1588,16 @@ create_menu_bar_and_toolbar (PlumaWindow *window,
window->priv->panes_action_group = action_group;
/* now load the UI definition */
- ui_file = pluma_dirs_get_ui_file (PLUMA_UIFILE);
- gtk_ui_manager_add_ui_from_file (manager, ui_file, &error);
+ gtk_ui_manager_add_ui_from_file (manager,
+ PLUMA_DATADIR "/ui/pluma-ui.xml",
+ &error);
if (error != NULL)
{
- g_warning ("Could not merge %s: %s", ui_file, error->message);
+ g_warning ("Could not merge %s: %s",
+ PLUMA_DATADIR "/ui/pluma-ui.xml",
+ error->message);
g_error_free (error);
}
- g_free (ui_file);
/* show tooltips in the statusbar */
g_signal_connect (manager,