diff options
| author | Andreas Krutzler <[email protected]> | 2017-11-10 19:32:53 -0700 |
|---|---|---|
| committer | Nathaniel Graham <[email protected]> | 2017-11-10 19:33:27 -0700 |
| commit | fa04e37569a316b3aaab3ca9fc42d50501347fd8 (patch) | |
| tree | ea5290812ee133b175c86b299fbac7fa0c306a6b | |
| parent | 0905b13dc49fcab0c8f80f5ac040deb594758488 (diff) | |
Prevent "Two clicks renaming" if the selected file/folder is not movable
Summary:
Two clicks renaming doesn't check if the user is actually allowed to rename a file/folder. With this patch, this get fixed.
Depends on D7647
Reviewers: rkflx, #dolphin, ngraham
Reviewed By: #dolphin, ngraham
Subscribers: elvisangelaccio, ngraham, #dolphin
Differential Revision: https://phabricator.kde.org/D8740
| -rw-r--r-- | src/views/dolphinview.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 4485c1707..cd802eec1 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -1125,8 +1125,12 @@ void DolphinView::slotMouseButtonPressed(int itemIndex, Qt::MouseButtons buttons void DolphinView::slotSelectedItemTextPressed(int index) { if (GeneralSettings::renameInline()) { - m_twoClicksRenamingItemUrl = m_model->fileItem(index).url(); - m_twoClicksRenamingTimer->start(QApplication::doubleClickInterval()); + const KFileItem item = m_model->fileItem(index); + const KFileItemListProperties capabilities(KFileItemList() << item); + if (capabilities.supportsMoving()) { + m_twoClicksRenamingItemUrl = item.url(); + m_twoClicksRenamingTimer->start(QApplication::doubleClickInterval()); + } } } |
