[vinagre] Simplify vinagre_utils_get_builder()



commit df4585099dfbf73750b4201d3750e7dba668aa0f
Author: Jonh Wendell <jwendell gnome org>
Date:   Tue Aug 24 14:21:42 2010 -0300

    Simplify vinagre_utils_get_builder()

 vinagre/vinagre-utils.c |   23 +++++------------------
 vinagre/vinagre-utils.h |    2 +-
 2 files changed, 6 insertions(+), 19 deletions(-)
---
diff --git a/vinagre/vinagre-utils.c b/vinagre/vinagre-utils.c
index 1ebf294..d7c0be3 100644
--- a/vinagre/vinagre-utils.c
+++ b/vinagre/vinagre-utils.c
@@ -128,29 +128,16 @@ vinagre_utils_get_ui_xml_filename (void)
     return VINAGRE_DATADIR "/" VINAGRE_UI_XML_FILE;
 }
 
-/**
- * vinagre_utils_get_builder:
- * @plugin: a #VinagrePlugin or NULL
- * @filename: the filename of the UI file for the plugin, or NULL if plugin is NULL
- *
- * This function gets a #GtkBuilder object for a UI file.
- * Supply a plugin and a filename in order to get a #GtkBuilder for the plugin.
- * Supply NULL to both arguments to get the main Vinagre #GtkBuilder
- *
- * Returns a #GtkBuilder on success (free with #g_object_unref) or NULL
- *  if the file cannot be found. In this case an error dialog will be shown.
- */
 GtkBuilder *
-vinagre_utils_get_builder (void *plugin, const gchar *filename)
+vinagre_utils_get_builder (const gchar *filename)
 {
   GtkBuilder *xml = NULL;
   GError     *error = NULL;
   gchar      *actual_filename, *plugin_datadir;
 
-  if (plugin)
+  if (filename)
     {
-      //plugin_datadir = vinagre_plugin_get_data_dir (plugin);
-      actual_filename = g_build_filename (plugin_datadir, filename, NULL);
+      actual_filename = g_strdup (filename);
       g_free (plugin_datadir);
     }
   else
@@ -163,7 +150,7 @@ vinagre_utils_get_builder (void *plugin, const gchar *filename)
     {
       GString *str = g_string_new (NULL);
 
-      if (plugin)
+      if (filename)
 	g_string_append (str, _("A plugin tried to open an UI file but did not succeed, with the error message:"));
       else
 	g_string_append (str, _("The program tried to open an UI file but did not succeed, with the error message:"));
@@ -475,7 +462,7 @@ vinagre_utils_ask_credential (GtkWindow *parent,
   int             result;
   ControlOKButton control;
 
-  xml = vinagre_utils_get_builder (NULL, NULL);
+  xml = vinagre_utils_get_builder (NULL);
 
   password_dialog = GTK_WIDGET (gtk_builder_get_object (xml, "auth_required_dialog"));
   if (parent)
diff --git a/vinagre/vinagre-utils.h b/vinagre/vinagre-utils.h
index 8a10a90..a7ba0fb 100644
--- a/vinagre/vinagre-utils.h
+++ b/vinagre/vinagre-utils.h
@@ -45,7 +45,7 @@ void		vinagre_utils_toggle_widget_visible	(GtkWidget *widget);
 
 const gchar	*vinagre_utils_get_ui_filename		(void);
 const gchar	*vinagre_utils_get_ui_xml_filename	(void);
-GtkBuilder	*vinagre_utils_get_builder		(void *plugin, const gchar *filename);
+GtkBuilder	*vinagre_utils_get_builder		(const gchar *filename);
 
 gchar		*vinagre_utils_escape_underscores	(const gchar *text,
 							 gssize      length);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]