D8206: Add Duplicate feature

Nathaniel Graham noreply at phabricator.kde.org
Sun Oct 8 19:35:23 BST 2017


ngraham created this revision.
ngraham added reviewers: Dolphin, KDE Applications, dfaure, elvisangelaccio.
ngraham added a project: Dolphin.

REVISION SUMMARY
  Adds a Duplicate feature to Dolphin, showing up as a menu item in the File menu that appears when one or more items are selected and the directory is writable. Duplicated items receive the names of the original files with " copy" appended before the file extension, if any. If only one item was duplicated, a rename operation is immediately initiated on it, allowing the user to choose a new name.

TEST PLAN
  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. :)

REPOSITORY
  R318 Dolphin

REVISION DETAIL
  https://phabricator.kde.org/D8206

AFFECTED FILES
  src/dolphinmainwindow.cpp
  src/dolphinui.rc
  src/views/dolphinview.cpp
  src/views/dolphinview.h
  src/views/dolphinviewactionhandler.cpp
  src/views/dolphinviewactionhandler.h

To: ngraham, #dolphin, #kde_applications, dfaure, elvisangelaccio
Cc: spoorun, navarromorales, firef, andrebarros, emmanuelp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20171008/9f2014d3/attachment.htm>


More information about the kfm-devel mailing list