Commit 9497dce2 authored by Philipp Hörist's avatar Philipp Hörist

Don't clean up temp file to early

We have to preserve it until the file transfer is finished
parent 4b2dc9f3
......@@ -26,7 +26,7 @@
import os
import time
import uuid
from tempfile import TemporaryDirectory
import tempfile
from gi.repository import Gtk
from gi.repository import Gdk
......@@ -793,15 +793,12 @@ def _paste_event_confirmed(self, is_checked, image):
if is_checked:
app.config.set('confirm_paste_image', False)
tmp_dir = TemporaryDirectory()
dir_ = tmp_dir.name
path = os.path.join(dir_, '0.png')
dir_ = tempfile.gettempdir()
path = os.path.join(dir_, '%s.png' % str(uuid.uuid4()))
image.savev(path, 'png', [], [])
self._start_filetransfer(path)
tmp_dir.cleanup()
def _get_pref_ft_method(self):
ft_pref = app.config.get_per('accounts', self.account,
'filetransfer_preference')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment