[gedit] [history-entry] do not load the history in the constructed override



commit 490b6acea9e1eaf82800b2f750556c099deed9dd
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Wed Mar 9 16:14:54 2011 +0100

    [history-entry] do not load the history in the constructed override
    
    entry-has-column property is not param construct anymore so we must
    load the history after the object has been contructed.

 gedit/gedit-history-entry.c |   35 ++++++++++++++++-------------------
 1 files changed, 16 insertions(+), 19 deletions(-)
---
diff --git a/gedit/gedit-history-entry.c b/gedit/gedit-history-entry.c
index 2207f88..291ef4f 100644
--- a/gedit/gedit-history-entry.c
+++ b/gedit/gedit-history-entry.c
@@ -179,17 +179,6 @@ gedit_history_entry_load_history (GeditHistoryEntry *entry)
 }
 
 static void
-gedit_history_entry_constructed (GObject *object)
-{
-	/* We must load the history after the object has been constructed,
-	 * to ensure that the model is set properly.
-	 */
-	gedit_history_entry_load_history (GEDIT_HISTORY_ENTRY (object));
-
-	G_OBJECT_CLASS (gedit_history_entry_parent_class)->constructed (object);
-}
-
-static void
 gedit_history_entry_class_init (GeditHistoryEntryClass *klass)
 {
 	GObjectClass   *object_class = G_OBJECT_CLASS (klass);
@@ -198,7 +187,6 @@ gedit_history_entry_class_init (GeditHistoryEntryClass *klass)
 	object_class->get_property = gedit_history_entry_get_property;
 	object_class->dispose = gedit_history_entry_dispose;
 	object_class->finalize = gedit_history_entry_finalize;
-	object_class->constructed = gedit_history_entry_constructed;
 
 	g_object_class_install_property (object_class,
 					 PROP_HISTORY_ID,
@@ -512,17 +500,26 @@ GtkWidget *
 gedit_history_entry_new (const gchar *history_id,
 			 gboolean     enable_completion)
 {
+	GeditHistoryEntry *entry;
+
 	g_return_val_if_fail (history_id != NULL, NULL);
 
 	enable_completion = (enable_completion != FALSE);
 
-	return g_object_new (GEDIT_TYPE_HISTORY_ENTRY,
-	                     "has-entry", TRUE,
-	                     "entry-text-column", 0,
-	                     "id-column", 1,
-	                     "history-id", history_id,
-	                     "enable-completion", enable_completion,
-	                     NULL);
+	entry = g_object_new (GEDIT_TYPE_HISTORY_ENTRY,
+	                      "has-entry", TRUE,
+	                      "entry-text-column", 0,
+	                      "id-column", 1,
+	                      "history-id", history_id,
+	                      "enable-completion", enable_completion,
+	                      NULL);
+
+	/* We must load the history after the object has been constructed,
+	 * to ensure that the model is set properly.
+	 */
+	gedit_history_entry_load_history (entry);
+
+	return GTK_WIDGET (entry);
 }
 
 /*



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