Skip to content

Commit

Permalink
DeskTop: Fix error shown after dragging volume onto another volume
Browse files Browse the repository at this point in the history
In 95e31ee a fix was made to copy a source folder's creation and
modification dates to the destination using GET_FILE_INFO and
SET_FILE_INFO. This logic was also triggered when copying a volume to
a volume or a volume to a folder. In the latter case this was harmless
but incorrect; the contents are copied not the volume itself, so the
dates shouldn't be updated. In the former case it's also incorrect for
the same reason, but it would trigger an alert because SET_FILE_INFO
doesn't work on volumes.

Fix by making the proc early exit if the source is a volume.
  • Loading branch information
inexorabletash committed Jan 26, 2025
1 parent 63a43d5 commit c2fbb15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions desktop/main.s
Original file line number Diff line number Diff line change
Expand Up @@ -12146,6 +12146,13 @@ match: lda flag

.proc GetAndApplySrcInfoToDst
jsr GetSrcFileInfo

;; Skip if source is volume; the contents are copied not the
;; item itself, so it doesn't make sense.
lda src_file_info_params::storage_type
cmp #ST_VOLUME_DIRECTORY
RTS_IF_EQ

FALL_THROUGH_TO ApplySrcInfoToDst
.endproc ; GetAndApplySrcInfoToDst

Expand Down
2 changes: 2 additions & 0 deletions res/notes/testplan.md
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,8 @@

* Launch DeskTop. Find a folder containing a file where the folder and file's creation dates (File > Get Info) differ. Copy the folder. Select the file in the copied folder. File > Get Info. Verify that the file creation and modification dates match the original.
* Launch DeskTop. Find a folder containing files and folders. Copy the folder to another volume. Using File > Get Info, compare the source and destination folders and files (both the top level folder and nested folders). Verify that the creation and modification dates match the original.
* Launch DeskTop. Drag a volume icon onto another volume icon (with sufficient capacity). Verify that no alert is shown. Repeat, but drag onto a volume window instead.
* Launch DeskTop. Drag a volume icon onto a folder icon (with sufficient capacity). Verify that no alert is shown, and that the folder's creation and modification dates are unchanged. Repeat, but drag onto a folder window instead.

* Launch DeskTop. Open two windows containing multiple files. Select multiples files in the first window. File > Copy To.... Select the second window's location as a destination and click OK. During the initial count of the files, press Escape. Verify that the count is canceled and the progress dialog is closed, and that the second window's contents do not refresh.
* Launch DeskTop. Open two windows containing multiple files. Select multiples files in the first window. File > Copy To.... Select the second window's location as a destination and click OK. After the initial count of the files is complete and the actual operation has started, press Escape. Verify that the second window's contents do refresh.
Expand Down

0 comments on commit c2fbb15

Please sign in to comment.