- "Cut" in KDevelop, "Paste" into Dolphin - should move the file,
- "Copy" in KDevelop, "Paste" into Dolphin - should copy the file.
Details
Diff Detail
- Repository
- R33 KDevPlatform
- Branch
- feature-cut-elsewhere
- Lint
No Linters Available - Unit
No Unit Test Coverage
- ProjectManagerViewPlugin: Rename needsRemoveAndRename to needsCutRenameRemove
- ProjectManagerViewPlugin: Reorder and group file actions cut/copy/paste and rename/remove
Just a quick code inspection; I'll try the feature as soon as I find time.
plugins/projectmanagerview/projectmanagerviewplugin.cpp | ||
---|---|---|
683 | Could do auto ctx = ... | |
687 | Not needed | |
692 | KFileItem(url).mostLocalUrl() should work? | |
754 | Can be a free function inside namespace {}. I'd also rename to createSeparatorAction |
plugins/projectmanagerview/projectmanagerviewplugin.cpp | ||
---|---|---|
754 | Changed to a static function instead because namespace {} takes more lines of code and is harder to read. |
Just tried this locally.
The "Cut" action copies the file for me -- can you verify it is working as intended? I don't see anything wrong with your code, though.
Relevant debug output:
[kdevelop(15865)/(kdevplatform.plugins.projectmanagerview) ProjectManagerViewPlugin::createClipboardMimeData(701): (QUrl("file:///home/kfunk/devel/src/icemon/cmake")) [kdevelop(15865)/(kdevplatform.plugins.projectmanagerview) ProjectBuildSetWidget::selectionChanged(100): checking selectionmodel: () [kdevelop(15865)/(kdevplatform.vcs) KDevelop::DVcsJob::start(183): Execute dvcs command: "git stash list" [kdevelop(15865)/(kdevplatform.vcs) KDevelop::DVcsJob::start(183): Execute dvcs command: "git stash list" [kdevelop(15865)/(kdevplatform.plugins.projectmanagerview) ProjectManagerViewPlugin::pasteFromContextMenu(734): (QUrl("file:///home/kfunk/devel/src/icemon/cmake")) [kdevelop(15865)/(kf5.kcoreaddons.kdirwatch) KDirWatchPrivate::stopEntryScan(1146): "KDirWatch-7" stopped scanning "/home/kfunk/devel/src/icemon/doc" (now 0 watchers) [kdevelop(15865)/(kf5.kio.core.copyjob) KIO::copy(2138): src= QUrl("file:///home/kfunk/devel/src/icemon/cmake") dest= QUrl("file:///home/kfunk/devel/src/icemon/doc") [kdevelop(15865)/(kf5.kio.core.copyjob) KIO::CopyJobPrivate::slotStart(334): CopyJob: stating the dest QUrl("file:///home/kfunk/devel/src/icemon/doc") ...
Kevin,
Cut is fully functional, but Paste isn't. The following steps do work:
- Cut in KDevelop
- Paste in Dolphin.
Yeah, I did cut in KDevelop and then paste in KDevelop.
That needs to be working; otherwise it's totally confusing for end users. Cut+Paste *inside* KDevelop would be the main use-case; pasting into Dolphin is just secondary.
this is a really useful feature, I would love to see it fully implemented (i.e. also with paste). Can you do that? Or should we take over?
plugins/projectmanagerview/projectmanagerviewplugin.cpp | ||
---|---|---|
64 | instead of static, wrap it in an anonymous namespace the result is the same, but I much prefer the C++ way of doing this |
Milian,
I've started coding the proper paste algorithm last night, seems to be doable. Expect another patch this week, please ping me otherwise.
A cut-honoring Paste is implemented in https://phabricator.kde.org/D4772. After that one is merged, this patch may be fixed and merged as well to receive a Cut command in KDevelop.
- Rebase on top of master
- Move createClipboardMimeData() outside of class ProjectManagerViewPlugin
- Move static functions into anonymous namespace
plugins/projectmanagerview/projectmanagerviewplugin.h | ||
---|---|---|
43 | Oops, this is not needed anymore. |
plugins/projectmanagerview/projectmanagerviewplugin.cpp | ||
---|---|---|
240 | this means we cannot paste into the project root, no? since the project root has no parent, but is a folder? |
plugins/projectmanagerview/projectmanagerviewplugin.cpp | ||
---|---|---|
240 | No, this means we cannot cut/rename/delete the project root. I didn't invent this logic, it has been there and worked well for a few years already. |