Commit d742de13 authored by Paolo Borelli's avatar Paolo Borelli Committed by Paolo Borelli

bump gnome-vfs requirements use the new vfs api to guess the mime type

2006-01-16  Paolo Borelli  <pborelli@katamail.com>

	* configure.ac: bump gnome-vfs requirements
	* gedit/gedit-document.c: use the new vfs api to guess the mime type
	from a filename, so that gedit foo.c uses the right highlighting.
parent 4a801e63
2006-01-16 Paolo Borelli <pborelli@katamail.com>
* configure.ac: bump gnome-vfs requirements
* gedit/gedit-document.c: use the new vfs api to guess the mime type
from a filename, so that gedit foo.c uses the right highlighting.
2006-01-16 Steve Frécinaux <nud@apinc.org>
plugins/externaltools/*: new plugin to execute shell commands.
......
......@@ -84,7 +84,7 @@ PKG_CHECK_MODULES(GEDIT, [
libgnomeui-2.0 >= 2.6.0
libglade-2.0 >= 2.4.0
libgnomeprintui-2.2 >= 2.6.0
gnome-vfs-2.0 >= 2.12.0
gnome-vfs-2.0 >= 2.13.4
])
GEDIT_LIBS="${GEDIT_LIBS}"
AC_SUBST(GEDIT_LIBS)
......
......@@ -711,15 +711,23 @@ set_uri (GeditDocument *doc,
{
gchar *base_name;
/* Set the mime type using the file extension or "text/plain"
* if no match. */
/* Guess the mime type from file extension or fallback to "text/plain" */
base_name = gnome_vfs_uri_extract_short_path_name (doc->priv->vfs_uri);
if (base_name != NULL)
doc->priv->mime_type = g_strdup ("text/plain"); // FIXME
// gnome_vfs_mime_type_from_name_or_default (base_name,
// "text/plain");
if (base_name != NULL)
{
const gchar *detected_mime;
detected_mime = gnome_vfs_get_mime_type_for_name (base_name);
if (detected_mime == NULL ||
strcmp (GNOME_VFS_MIME_TYPE_UNKNOWN, detected_mime) == 0)
detected_mime = "text/plain";
doc->priv->mime_type = g_strdup (detected_mime);
}
else
{
doc->priv->mime_type = g_strdup ("text/plain");
}
g_free (base_name);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment