Add renaming capability to ioslaves
Review Request #129741 - Created Jan. 1, 2017 and discarded
An ioslave protocol might support moving files but not "renaming" them (rename here means "the F2 shortcut in filemanagers"). trash:/ is a good example.
renamingfield defaults to
moving, so that we don't have to add renaming=true to every protocol file out there.
Using the new
supportsRenaming()api from Dolphin, F2 in Trash is now disabled. More context in https://git.reviewboard.kde.org/r/129714
Renaming is really a special case of moving. Saying that "kio_trash doesn't support renaming" is correct but only a partial truth. It also doesn't support moving from trash:/ to trash:/subdir/. So it would be more correct to say that kio_trash supports moving trash-to-file and file-to-trash but not trash-to-trash. So it seems to me that this patch models the wrong thing, and is likely to give us further trouble down the line. I wonder if we could invent something more dynamic than the .protocol keys. An additional way to talk to a slave and ask if a specific operation (for specific URLs) is implemented. Something like KIO::CapabilityJob *job = KIO::capability(Move, url1, url2); connect; and in the slot, enable/disable the action accordingly. By default this would just use the information from the .protocol files, but in addition a new SlaveBase method (fake-virtual until KF6, using virtual_hook) would allow slaves to answer the query with more precision, depending on the actual URLs. What do you think? Of course the alternative (which is actually simpler short term) is to implement renaming in kio_trash ;) Actual renaming should be easy, moving between subdirs is a bit more tricky but doable too. I can take a look at that next weekend.