[gnome-mag] Fix for bgo#574174 - Remove deprecated libgnomeui dependency
- From: William Walker <wwalker src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-mag] Fix for bgo#574174 - Remove deprecated libgnomeui dependency
- Date: Sat, 18 Jul 2009 15:03:54 +0000 (UTC)
commit b18beee81c4eee48ed8284ad7fa01f17a0197fa2
Author: André Klapper <a9016009 gmx de>
Date: Sat Jul 18 11:03:18 2009 -0400
Fix for bgo#574174 - Remove deprecated libgnomeui dependency
colorblind/Utils.py | 10 +++++-----
colorblind/colorblind-applet.py | 2 --
2 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/colorblind/Utils.py b/colorblind/Utils.py
index 156e826..e9999dd 100644
--- a/colorblind/Utils.py
+++ b/colorblind/Utils.py
@@ -2,10 +2,9 @@ import os, cgi, re
from os.path import *
from gettext import gettext as _
import colorblind
-import gtk, gtk.gdk, gnome.ui, gobject
+import gtk, gtk.gdk, gobject
ICON_THEME = gtk.icon_theme_get_default()
-factory = gnome.ui.ThumbnailFactory(colorblind.ICON_HEIGHT)
def get_xdg_data_dirs():
dirs = os.getenv("XDG_DATA_HOME")
@@ -20,9 +19,10 @@ def get_xdg_data_dirs():
return [dir for dir in dirs.split(":") if dir.strip() != "" and exists(dir)]
def load_icon_for_file(f):
- icon_name, flags = gnome.ui.icon_lookup(ICON_THEME, factory,
- f, "",
- gnome.ui.ICON_LOOKUP_FLAGS_SHOW_SMALL_IMAGES_AS_THEMSELVES)
+ gfile = gio.File(uri=f)
+ if gfile.query_exists():
+ info = gfile.query_info("thumbnail::path", 0)
+ f = info.get_attribute_byte_string("thumbnail::path")
return load_icon(icon_name)
diff --git a/colorblind/colorblind-applet.py b/colorblind/colorblind-applet.py
index 608b50f..ad6193f 100644
--- a/colorblind/colorblind-applet.py
+++ b/colorblind/colorblind-applet.py
@@ -101,8 +101,6 @@ if __name__ == "__main__":
}
if standalone:
- import gnome
- gnome.init(colorblind.defs.PACKAGE, colorblind.defs.VERSION)
build_window(standalone)
# run the new command using the given trace
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]