Fix drag&drop in staging view
Drag&drop offers a FileTransfer, but considered only StagingEntries.
If only StagingFolderEntries were selected, the resulting FileTransfer
would be empty, which is not allowed and produces a SWTException,
making the drag&drop fail.
This is especially devastating on GTK, where the FileTransfer sometimes
gets created up front, and thus even drags between our own two viewers
failed frequently. On Mac, the FileTransfer is created lazily when
hovering over an item (such as a Finder window) that accepts such
transfers, and the problem thus went largely unnoticed there.
Fix this by also considering folders and including the staged or
unstaged files contained in those folders when creating a FileTransfer.
Transfer creation may still fail and log an exception if the selection
includes only deleted files. In my tests on GTK, drag&drop of deleted
files between the staged and unstaged viewer worked all the same.
Also reduce code duplication by factoring out the creation of the
staged and unstaged viewers into a common method.
Additionally, ensure that dropping onto the same staged or unstaged
viewer the drag&drop initially started from is a no-op; otherwise this
did inadvertently stage/unstage other files contained in selected
folders.
Bug: 453637
Bug: 505923
Change-Id: I3016da202f7d02365374fd9b90ca3537e277ece1