Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Wed, 26 Apr 2017 20:46:20 UTC Commit: 663d3d798b0ab6ba7ae6b3cee75f9689e83fca6f https://github.com/geany/geany-plugins/commit/663d3d798b0ab6ba7ae6b3cee75f96...
Log Message: ----------- overview: Fix locating the ui file on OS X when using bundle
Modified Paths: -------------- overview/overview/overviewprefspanel.c
Modified: overview/overview/overviewprefspanel.c 26 lines changed, 19 insertions(+), 7 deletions(-) =================================================================== @@ -192,18 +192,31 @@ overview_prefs_panel_load_prefs (OverviewPrefsPanel *self) g_signal_emit_by_name (self, "prefs-loaded", self->prefs); }
+static gchar * +get_data_dir_path (const gchar *filename) +{ + gchar *prefix = NULL; + gchar *path; + +#ifdef G_OS_WIN32 + prefix = g_win32_get_package_installation_directory_of_module (NULL); +#elif defined(__APPLE__) + if (g_getenv ("GEANY_PLUGINS_SHARE_PATH")) + return g_build_filename (g_getenv ("GEANY_PLUGINS_SHARE_PATH"), + PLUGIN, filename, NULL); +#endif + path = g_build_filename (prefix ? prefix : "", PLUGINDATADIR, filename, NULL); + g_free (prefix); + return path; +} + static void overview_prefs_panel_init (OverviewPrefsPanel *self) { GtkBuilder *builder; GError *error = NULL; GtkWidget *overlay_frame; -#ifdef G_OS_WIN32 - gchar *prefix = g_win32_get_package_installation_directory_of_module (NULL); -#else - gchar *prefix = NULL; -#endif - gchar *ui_file_path = g_build_filename (prefix ? prefix : "", PLUGINDATADIR, "prefs.ui", NULL); + gchar *ui_file_path = get_data_dir_path ("prefs.ui");
builder = gtk_builder_new (); if (! gtk_builder_add_from_file (builder, ui_file_path, &error)) @@ -215,7 +228,6 @@ overview_prefs_panel_init (OverviewPrefsPanel *self) }
g_free (ui_file_path); - g_free (prefix);
self->prefs_table = builder_get_widget (builder, "prefs-table"); self->width_spin = builder_get_widget (builder, "width-spin");
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).