Skip to content

Commit fe0452e

Browse files
DeskTop: Ensure File > Copy To... always copies
Regressed in 3dca09f which unified the File > Copy To... and drag/drop code paths. Need to not check for move vs. copy when the menu item is used. Fixes #853
1 parent 7443c24 commit fe0452e

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

desktop/main.s

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ check_double_click:
864864
END_IF
865865

866866
;; Copy/Move
867-
jsr DoCopySelection
867+
jsr DoCopyOrMoveSelection
868868
jmp _PerformPostDropUpdates
869869
.endproc ; _IconClick
870870

@@ -9900,22 +9900,28 @@ FinishOperation:
99009900
;;; File > Copy To...
99019901
;;; Drag / Drop (to anything but Trash)
99029902
;;; Caller sets `path_buf4` (destination)
9903-
.proc DoCopySelection
9904-
copy #0, operation_flags ; bit7=0 = copy/delete
9905-
copy #$00, copy_delete_flags ; bit7=0 = copy
9906-
9903+
.proc DoCopyOrMoveSelection
99079904
lda selected_window_id
99089905
beq :+ ; dragging volume always copies
99099906
jsr GetWindowPath
99109907
jsr CheckMoveOrCopy
9911-
: sta move_flag
9908+
: .byte OPC_BIT_abs ; skip next 2-byte instruction
9909+
9910+
ep_always_copy:
9911+
lda #0
9912+
9913+
sta move_flag
9914+
9915+
copy #0, operation_flags ; bit7=0 = copy/delete
9916+
copy #$00, copy_delete_flags ; bit7=0 = copy
99129917

99139918
tsx
99149919
stx stack_stash
99159920
jsr PrepCallbacksForEnumeration
99169921
jsr OpenCopyProgressDialog
99179922
jmp OperationOnSelection
9918-
.endproc ; DoCopySelection
9923+
.endproc ; DoCopyOrMoveSelection
9924+
DoCopySelection := DoCopyOrMoveSelection::ep_always_copy
99199925

99209926
;;; File > Delete
99219927
;;; Drag / Drop to Trash (except volumes)
@@ -12322,6 +12328,7 @@ ret: return #$FF
1232212328

1232312329
.endscope ; operations
1232412330

12331+
DoCopyOrMoveSelection := operations::DoCopyOrMoveSelection
1232512332
DoCopySelection := operations::DoCopySelection
1232612333
DoDeleteSelection := operations::DoDeleteSelection
1232712334
DoCopyToRAM := operations::DoCopyToRAM

res/notes/testplan.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@
488488

489489
* Ensure the startup volume has a name that would be case-adjusted by DeskTop, e.g. `/HD` but that shows as "Hd". Launch DeskTop. Open the startup volume. Apple Menu > Control Panels. Drag a DA file to the startup volume window. Verify that the file is moved, not copied.
490490

491+
* Launch DeskTop. Use File > Copy To... to copy a file. Verify that the file is indeed copied, not moved.
491492
* Launch DeskTop. Drag a file icon to a same-volume window so it is moved, not copied. Use File > Copy To... to copy a file. Verify that the file is indeed copied, not moved.
492493

493494
# TODO: Rewrite this A -> Vol's icon, B -> Vol's window, C -> Folder's icon, D -> Folder's window

0 commit comments

Comments
 (0)