anjuta r3436 - in trunk: . plugins/sourceview



Author: jhs
Date: Tue Jan  8 14:59:15 2008
New Revision: 3436
URL: http://svn.gnome.org/viewvc/anjuta?rev=3436&view=rev

Log:
2008-01-08  Johannes Schmid <jhs gnome org>

	* plugins/sourceview/sourceview.c: (autodetect_language):
	Fixed a crash when creating a new file

Modified:
   trunk/ChangeLog
   trunk/plugins/sourceview/sourceview.c

Modified: trunk/plugins/sourceview/sourceview.c
==============================================================================
--- trunk/plugins/sourceview/sourceview.c	(original)
+++ trunk/plugins/sourceview/sourceview.c	Tue Jan  8 14:59:15 2008
@@ -1816,6 +1816,15 @@
 	const gchar* detected_language = NULL;
 	g_object_get (G_OBJECT (gtk_source_language_manager_get_default ()), "language-ids",
 							&languages, NULL);
+	if (!vfs_mime_type)
+	{
+		vfs_mime_type = 
+			gnome_vfs_get_mime_type_for_name (ianjuta_document_get_filename (IANJUTA_DOCUMENT (sv),
+																			 NULL));
+	}
+	if (!vfs_mime_type)
+		return NULL;
+	
 	for (cur_lang = languages; *cur_lang != NULL; cur_lang++)
 	{
 		GtkSourceLanguage* language = 



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