[epiphany] e-dialog: handle old uses of ephy_dialog_construct



commit 860eeba788d7556af2cc2b4e9ae1fa0167f2a950
Author: Diego Escalante Urrelo <diegoe igalia com>
Date:   Tue Jul 31 16:29:07 2012 +0200

    e-dialog: handle old uses of ephy_dialog_construct
    
    This is a hack. One that we should remove when we decide what to do with
    extensions.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=680907

 lib/ephy-dialog.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/lib/ephy-dialog.c b/lib/ephy-dialog.c
index 3948fb5..32aba87 100644
--- a/lib/ephy-dialog.c
+++ b/lib/ephy-dialog.c
@@ -150,7 +150,19 @@ impl_construct (EphyDialog *dialog,
 
 	builder = gtk_builder_new ();
 	gtk_builder_set_translation_domain (builder, domain);
-	gtk_builder_add_from_resource (builder, resource, &error);
+
+	/* Hack to support extensions that use EphyDialog with files and
+	 * not GResource objects. This is far simpler than creating a
+	 * GResource binary for every extension. */
+	if (g_file_test (resource, G_FILE_TEST_EXISTS))
+	{
+		gtk_builder_add_from_file (builder, resource, &error);
+	}
+	else
+	{
+		gtk_builder_add_from_resource (builder, resource, &error);
+	}
+
 	if (error)
 	{
 		g_warning ("Unable to load UI resource %s: %s", resource, error->message);



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