* src/Utils.py (find_mime_type_pixbuf): Dont segfault with note only object

* src/SelectObject.py (on_select_row): Dont segfault with note only object


svn: r4937
This commit is contained in:
Martin Hawlisch 2005-07-15 05:44:06 +00:00
parent c31363c02b
commit add5f946d9
3 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,7 @@
2005-07-15 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/plugins/NavWebPage.py: Avoid some segfaults
* src/Utils.py (find_mime_type_pixbuf): Dont segfault with note only object
* src/SelectObject.py (on_select_row): Dont segfault with note only object
2005-07-14 Don Allingham <don@gramps-project.org>
* src/plugins/NavWebPage.py: gallery/media object enhancements, div/span fixes

View File

@ -123,7 +123,10 @@ class SelectObject:
self.preview.set_from_pixbuf(image)
self.object_handle.set_text(obj.get_gramps_id())
self.object_type.set_text(the_type)
if the_type:
self.object_type.set_text(the_type)
else:
self.object_type.set_text("")
self.object_desc.set_text(obj.get_description())
if len(path) == 0:
self.object_path.set_text(_("The file no longer exists"))

View File

@ -232,8 +232,8 @@ def view_photo(photo):
_icon_theme = gtk.icon_theme_get_default()
def find_mime_type_pixbuf(mime_type):
icontmp = mime_type.replace('/','-')
try:
icontmp = mime_type.replace('/','-')
newicon = "gnome-mime-%s" % icontmp
try:
return _icon_theme.load_icon(newicon,48,0)