Skip to content

Commit

Permalink
Fix copying multiple files
Browse files Browse the repository at this point in the history
  • Loading branch information
kra-mo committed Dec 24, 2023
1 parent 5cd0a02 commit 62ec4c2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions hyperplane/items_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,15 +764,15 @@ def paste_file_cb(clipboard: Gdk.Clipboard, result: Gio.AsyncResult) -> None:

for src in file_list:
try:
dst = Gio.File.new_for_path(
final_dst = Gio.File.new_for_path(
str(get_gfile_path(dst) / get_gfile_display_name(src))
)
except (FileNotFoundError, TypeError):
continue

if shared.cut_widgets:
try:
move(src, dst)
move(src, final_dst)
except FileExistsError:
self.get_root().send_toast(
_("A folder with that name already exists.")
Expand All @@ -782,19 +782,19 @@ def paste_file_cb(clipboard: Gdk.Clipboard, result: Gio.AsyncResult) -> None:
)
continue
else:
paths.append((src, dst))
paths.append((src, final_dst))

else:
try:
copy(src, dst)
copy(src, final_dst)
except FileExistsError:
try:
dst = get_copy_gfile(dst)
copy(src, dst)
final_dst = get_copy_gfile(final_dst)
copy(src, final_dst)
except (FileExistsError, FileNotFoundError):
continue

paths.append(dst)
paths.append(final_dst)

if shared.cut_widgets:
shared.undo_queue[time()] = ("cut", paths)
Expand Down

0 comments on commit 62ec4c2

Please sign in to comment.