SF.net SVN: geany-plugins:[1146] trunk/geanylatex/src/geanylatex.c

frlan at users.sourceforge.net frlan at xxxxx
Sun Jan 31 18:15:33 UTC 2010


Revision: 1146
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1146&view=rev
Author:   frlan
Date:     2010-01-31 18:15:33 +0000 (Sun, 31 Jan 2010)

Log Message:
-----------
GeanyLaTeX: Only toggle toolbar if Geany's main window is already realized.

Modified Paths:
--------------
    trunk/geanylatex/src/geanylatex.c

Modified: trunk/geanylatex/src/geanylatex.c
===================================================================
--- trunk/geanylatex/src/geanylatex.c	2010-01-29 18:17:35 UTC (rev 1145)
+++ trunk/geanylatex/src/geanylatex.c	2010-01-31 18:15:33 UTC (rev 1146)
@@ -336,14 +336,22 @@
 									 GeanyDocument *doc, G_GNUC_UNUSED gpointer data)
 {
 	g_return_if_fail(doc != NULL);
-	toggle_toolbar_items_by_file_type(doc->file_type->id);
+
+	if (main_is_realized() == TRUE)
+	{
+		toggle_toolbar_items_by_file_type(doc->file_type->id);
+	}
 }
 
 
 static void on_document_new(GObject *object, GeanyDocument *doc, gpointer data)
 {
 	g_return_if_fail(doc != NULL);
-	on_document_activate(object, doc, data);
+
+	if (main_is_realized() == TRUE)
+	{
+		on_document_activate(object, doc, data);
+	}
 }
 
 
@@ -364,11 +372,15 @@
 static void on_document_filetype_set(GObject *obj, GeanyDocument *doc,
 	GeanyFiletype *filetype_old, gpointer user_data)
 {
-	if (doc != NULL)
+	g_return_if_fail(doc != NULL);
+
+	if (main_is_realized() == TRUE)
 	{
 		GeanyFiletype *ft = doc->file_type;
 		if (filetype_old != NULL && filetype_old->id != ft->id)
+		{
 			on_document_activate(obj, doc, user_data);
+		}
 	}
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Plugins-Commits mailing list