Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/jarabe/journal/journaltoolbox.py
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@sugarlabs.org>2009-01-03 15:47:50 (GMT)
committer Tomeu Vizoso <tomeu@sugarlabs.org>2009-01-03 15:47:50 (GMT)
commit4c090f79a50897f7c150f94c84054cfd4a1991ac (patch)
tree106b758152388cc5cb1aa3d9a975b16a09a3ddac /src/jarabe/journal/journaltoolbox.py
parent550c2f00834cf047b62f4fe541c308cea29b04a3 (diff)
Use util.TempFilePath and stop leaking temp files
Diffstat (limited to 'src/jarabe/journal/journaltoolbox.py')
-rw-r--r--src/jarabe/journal/journaltoolbox.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/jarabe/journal/journaltoolbox.py b/src/jarabe/journal/journaltoolbox.py
index bcd59b7..ce20d6b 100644
--- a/src/jarabe/journal/journaltoolbox.py
+++ b/src/jarabe/journal/journaltoolbox.py
@@ -311,6 +311,7 @@ class EntryToolbar(gtk.Toolbar):
gtk.Toolbar.__init__(self)
self._metadata = None
+ self._temp_file_path = None
self._resume = ToolButton('activity-start')
self._resume.connect('clicked', self._resume_clicked_cb)
@@ -355,12 +356,13 @@ class EntryToolbar(gtk.Toolbar):
self.__clipboard_clear_func_cb)
def __clipboard_get_func_cb(self, clipboard, selection_data, info, data):
- file_path = model.get_file(self._metadata['uid'])
- selection_data.set_uris(['file://' + file_path])
+ # Get hold of a reference so the temp file doesn't get deleted
+ self._temp_file_path = model.get_file(self._metadata['uid'])
+ selection_data.set_uris(['file://' + self._temp_file_path])
def __clipboard_clear_func_cb(self, clipboard, data):
- #TODO: should we remove here the temp file created before?
- pass
+ # Release and delete the temp file
+ self._temp_file_path = None
def _erase_button_clicked_cb(self, button):
registry = bundleregistry.get_registry()