Tested in KDE Neon. Test cases:
- Try to duplicate when nothing is selected: **PASS**: menu item is grayed out
- Try to duplicate anything on a read-only local volume: **PASS**: menu item is grayed out
- Try to duplicate anything on a read-only samba share: **PASS**: menu item is grayed out
- Duplicate single local file on R/W volume: **FAIL**: item is duplicated and named correctly, but and a rename operation is not initiated
- Duplicate multiple local files on R/W volume: **PASS**: 3 items are duplicated, named correctly, and selected
- Duplicate single local directory on R/W volume: **PASS**: item is duplicated and named correctly, but a rename operation is not initiated
- Duplicate multiple local directories on R/W volume: **PASS**: 3 items are duplicated, named correctly, and selected
- Duplicate single file on R/W samba share: **FAIL**: item is duplicated and correctly, but a rename operation is not initiated
- Duplicate multiple files on R/W samba share: **PASS**: 3 items are duplicated, named correctly, and selected
- Duplicate single directory on R/W samba share: **FAIL**: item is duplicated and named correctly, but a rename operation is not initiated
- Duplicate multiple directory on R/W samba share: **PASS**: 3 items are duplicated, named correctly, and selected
- Try to undo a successful duplication: **PASS**: operation is undone
The failures are due to an issue where the newly-created items are not added in time to the underlying KFileItemModel. I could use some pointers on fixing this.
This is my first attempt at a big change like this and I'm sure it's full of other issues. I will accept any and all suggestions for improvement. :)