From fc01de524fe22c99a3c86a2c80cccdabe910804e Mon Sep 17 00:00:00 2001 From: nswarup14 Date: Sat, 13 Jul 2019 12:05:43 +0530 Subject: [PATCH] Delete the activity bundle after downloading and installation --- downloadmanager.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/downloadmanager.py b/downloadmanager.py index 3ce9c81..d72847c 100644 --- a/downloadmanager.py +++ b/downloadmanager.py @@ -271,6 +271,12 @@ def __download_finished_cb(self, download): self._stop_alert.connect('response', self.__stop_response_cb) self._stop_alert.show() + def remove_journal_object(self): + datastore.delete(self._object_id) + self._object_id = None + if os.path.isfile(self._dest_path): + os.remove(self._dest_path) + def __download_failed_cb(self, download, error): logging.error('Error downloading URI due to %s' % error) @@ -305,6 +311,7 @@ def __stop_response_cb(self, alert, response_id): launch_bundle(object_id=self._object_id) if response_id == Gtk.ResponseType.ACCEPT: activity.show_object_in_journal(self._object_id) + self.remove_journal_object() self._activity.remove_alert(alert) def cleanup(self):