[anjuta] sourceview: Work around bgo#638017 - GtkTextView: Crash in gtk_text_view_set_tabs()



commit f72c6548c7e2d72dcc6872dcc031e8e7f170570c
Author: Johannes Schmid <jhs gnome org>
Date:   Tue Jan 4 11:27:44 2011 +0100

    sourceview: Work around bgo#638017 - GtkTextView: Crash in gtk_text_view_set_tabs()

 plugins/sourceview/anjuta-view.c |   28 +++++++++++-----------------
 1 files changed, 11 insertions(+), 17 deletions(-)
---
diff --git a/plugins/sourceview/anjuta-view.c b/plugins/sourceview/anjuta-view.c
index 91869cf..ad11dcf 100644
--- a/plugins/sourceview/anjuta-view.c
+++ b/plugins/sourceview/anjuta-view.c
@@ -381,22 +381,6 @@ anjuta_view_init (AnjutaView *view)
   GtkTargetList* tl;
   view->priv = ANJUTA_VIEW_GET_PRIVATE (view);
 
-  /*
-   *  Set tab, fonts, wrap mode, colors, etc. according
-   *  to preferences 
-   */
-
-  g_object_set (G_OBJECT (view), 
-                "wrap-mode", FALSE,
-                "show-line-numbers", TRUE,
-                "auto-indent", TRUE,
-                "tab-width", 4,
-                "insert-spaces-instead-of-tabs", FALSE,
-                "highlight-current-line", TRUE, 
-                "indent-on-tab", TRUE, /* Fix #388727 */
-                "smart-home-end", FALSE, /* Never changes this */
-                NULL);
-
   /* Drag and drop support */	
   tl = gtk_drag_dest_get_target_list (GTK_WIDGET (view));
 
@@ -467,7 +451,17 @@ anjuta_view_new (Sourceview *sv)
 {
 	GtkWidget *view;
 
-	view = GTK_WIDGET (g_object_new (ANJUTA_TYPE_VIEW, NULL));
+	/* Create widget with sane defaults */
+	view = GTK_WIDGET (g_object_new (ANJUTA_TYPE_VIEW, 
+	                                 "wrap-mode", FALSE,
+	                                 "show-line-numbers", TRUE,
+	                                 "auto-indent", TRUE,
+	                                 "tab-width", 4,
+	                                 "insert-spaces-instead-of-tabs", FALSE,
+	                                 "highlight-current-line", TRUE, 
+	                                 "indent-on-tab", TRUE, /* Fix #388727 */
+	                                 "smart-home-end", FALSE, /* Never changes this */
+	                                 NULL));
 	
 	gtk_text_view_set_buffer (GTK_TEXT_VIEW (view),
 				  GTK_TEXT_BUFFER (sv->priv->document));



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