Skip to content

Commit

Permalink
DeskTop: Make modification date for copied folders match original
Browse files Browse the repository at this point in the history
The creation/modification dates were set when copying a folder, but as
the contents are added ProDOS updates the modification date. So after
visiting a folder, re-apply the modification date if possible.
  • Loading branch information
inexorabletash committed Oct 26, 2024
1 parent b48f8c0 commit 95e31ee
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Project Page: https://github.com/a2stuff/a2d
* More consistently refresh (or don't refresh) window contents after canceled or failed operations.
* Special > Make Alias now creates link file in same directory as original.
* Add Edit menu with Cut/Copy/Paste/Clear, relocate Select All.
* Ensure the modification date for copied folders matches the original.

### Selector

Expand Down
18 changes: 13 additions & 5 deletions desktop/main.s
Original file line number Diff line number Diff line change
Expand Up @@ -11999,6 +11999,7 @@ dir:

copy_dir_contents:
jsr ProcessDir
jsr GetAndApplySrcInfoToDst ; copy modified date/time
jsr MaybeFinishFileMove

bit move_flag
Expand Down Expand Up @@ -12056,6 +12057,7 @@ ok_dir: jsr RemoveSrcPathSegment
;;; If moving, delete src file/directory.

.proc CopyFinishDirectory
jsr GetAndApplySrcInfoToDst ; apply modification date/time
jsr RemoveDstPathSegment
FALL_THROUGH_TO MaybeFinishFileMove
.endproc ; CopyFinishDirectory
Expand Down Expand Up @@ -12544,8 +12546,7 @@ eof: jsr CloseDst
bit src_dst_exclusive_flag
bmi :+
jsr CloseSrc
: jsr CopyFileInfo
jmp SetDstFileInfo
: jmp ApplySrcInfoToDst

.proc OpenSrc
@retry: MLI_CALL OPEN, open_src_params
Expand Down Expand Up @@ -13304,10 +13305,17 @@ match: lda flag

;;; ============================================================

.proc CopyFileInfo
.proc GetAndApplySrcInfoToDst
jsr GetSrcFileInfo
FALL_THROUGH_TO ApplySrcInfoToDst
.endproc ; GetAndApplySrcInfoToDst

.proc ApplySrcInfoToDst
COPY_BYTES 11, src_file_info_params::access, dst_file_info_params::access
rts
.endproc ; CopyFileInfo
FALL_THROUGH_TO SetDstFileInfo
.endproc ; ApplySrcInfoToDst

;;; ============================================================

.proc SetDstFileInfo
: copy #7, dst_file_info_params::param_count ; SET_FILE_INFO
Expand Down
1 change: 1 addition & 0 deletions res/notes/testplan.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@
* drag a file icon in B onto D while holding Apple to copy it. Verify that D activates and refreshes, and that D's item count/used/free numbers update. Click on B. Verify that B's used/free numbers update.

* 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. 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 95e31ee

Please sign in to comment.