diff --git a/src/RelLib.py b/src/RelLib.py index e897dc382..20b053b2c 100644 --- a/src/RelLib.py +++ b/src/RelLib.py @@ -597,33 +597,33 @@ class MediaObject(SourceNote): if source: self.path = source.path self.mime = source.mime - self.local = source.local self.desc = source.desc self.id = source.id + self.thumb = source.thumb for attr in source.attrlist: self.attrlist.append(Attribute(attr)) else: self.id = "" - self.local = 0 self.path = "" self.mime = "" self.desc = "" + self.thumb = None def serialize(self): - return (self.id, self.local, self.path, self.mime, self.desc, self.attrlist, + return (self.id, self.path, self.mime, self.desc, self.attrlist, self.source_list, self.note) def unserialize(self,data): - (self.id, self.local, self.path, self.mime, self.desc, self.attrlist, + (self.id, self.thumb, self.path, self.mime, self.desc, self.attrlist, self.source_list, self.note) = data - def set_local(self,val): - """set or clear the local flag""" - self.local = val + def set_thumbnail(self,thumb): + """set the thumbnail""" + self.thumb = thumb - def get_local(self): - """return the local flag""" - return self.local + def get_thumbnail(self): + """return the thumbnail""" + return self.thumb def set_id(self,id): """Sets the gramps ID for the place object""" diff --git a/src/SelectObject.py b/src/SelectObject.py index 818d6b237..154504728 100644 --- a/src/SelectObject.py +++ b/src/SelectObject.py @@ -98,15 +98,12 @@ class SelectObject: self.object_model.clear() self.object_model.new_model() - for key in self.db.get_object_map().keys(): + for key in self.db.get_object_keys(): object = self.db.get_object(key) title = object.get_description() the_id = object.get_id() the_type = Utils.get_mime_description(object.get_mime_type()) - if object.get_local(): - path = "" - else: - path = object.get_path() + path = object.get_path() self.object_model.add([title,the_id,the_type,path],key) self.object_model.connect_model() diff --git a/src/gramps_main.py b/src/gramps_main.py index 6be4a4677..987f74028 100755 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -792,22 +792,7 @@ class Gramps: can delete any thumbnail images. The thumbnails may or may not exist, depending on if the image was previewed. """ - for obj in self.db.get_added_media_objects(): - if obj.get_local(): - try: - os.unlink(obj.get_path()) - except IOError: - pass - except: - DisplayTrace.DisplayTrace() - thumb = "%s/.thumb/%s.jpg" % (self.db.get_save_path(),obj.get_id()) - if os.path.isfile(thumb): - try: - os.unlink(thumb) - except IOError: - pass - except: - DisplayTrace.DisplayTrace() + pass def on_about_activate(self,obj): """Displays the about box. Called from Help menu""" @@ -1095,7 +1080,7 @@ class Gramps: #------------------------------------------------------------------------- for ObjectId in self.db.get_object_keys(): object = self.db.find_object_from_id(ObjectId) - if object.get_local(): + if 0: oldfile = object.get_path() (base,ext) = os.path.splitext(os.path.basename(oldfile)) newfile = os.path.join(filename,os.path.basename(oldfile))