[rhythmbox] [upnp] Use GIO to get the face icon's mime-type
- From: Bastien Nocera <hadess src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [rhythmbox] [upnp] Use GIO to get the face icon's mime-type
- Date: Thu, 10 Dec 2009 16:07:39 +0000 (UTC)
commit eeabdd5f7e3f38e396f1df1b38ce9051e22a5fd1
Author: Bastien Nocera <hadess hadess net>
Date: Wed Dec 9 16:02:13 2009 +0000
[upnp] Use GIO to get the face icon's mime-type
https://bugzilla.gnome.org/show_bug.cgi?id=604188
plugins/coherence/upnp_coherence/__init__.py | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/plugins/coherence/upnp_coherence/__init__.py b/plugins/coherence/upnp_coherence/__init__.py
index ca1d1ba..d7de3cc 100644
--- a/plugins/coherence/upnp_coherence/__init__.py
+++ b/plugins/coherence/upnp_coherence/__init__.py
@@ -17,7 +17,7 @@ import louie
from coherence import log
# for the icon
-import os.path, urllib, gnomevfs, gtk.gdk
+import os.path, urllib, gio, gtk.gdk
# the gconf configuration
gconf_keys = {
@@ -78,8 +78,10 @@ class CoherencePlugin(rb.Plugin, log.Loggable):
the_icon = None
face_path = os.path.join(os.path.expanduser('~'), ".face")
if os.path.exists(face_path):
- url = "file://" + urllib.pathname2url(face_path)
- mimetype = gnomevfs.get_mime_type(url)
+ file = gio.File(file=path_path);
+ url = file.get_uri();
+ info = file.query_info("standard::fast-content-type");
+ mimetype = info.get_attribute_as_string("standard::fast-content-type");
pixbuf = gtk.gdk.pixbuf_new_from_file(face_path)
width = "%s" % pixbuf.get_width()
height = "%s" % pixbuf.get_height()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]