FoldersPanel: Fix inline renaming

Commit 5a0da4a9c8 changed the value
for emitRoleEditingFinished() to a struct containing
the new name, but folderspanel was not updated.

BUG: 441124
This commit is contained in:
Jan Paul Batrina 2021-08-19 22:34:40 +08:00 committed by Méven Car
parent 542e2a214a
commit 1d125057cb

View file

@ -15,6 +15,7 @@
#include "kitemviews/kitemlistcontainer.h"
#include "kitemviews/kitemlistcontroller.h"
#include "kitemviews/kitemlistselectionmanager.h"
#include "kitemviews/private/kitemlistroleeditor.h"
#include "treeviewcontextmenu.h"
#include "views/draganddrophelper.h"
@ -245,7 +246,8 @@ void FoldersPanel::slotRoleEditingFinished(int index, const QByteArray& role, co
{
if (role == "text") {
const KFileItem item = m_model->fileItem(index);
const QString newName = value.toString();
const EditResult retVal = value.value<EditResult>();
const QString newName = retVal.newName;
if (!newName.isEmpty() && newName != item.text() && newName != QLatin1Char('.') && newName != QLatin1String("..")) {
const QUrl oldUrl = item.url();
QUrl newUrl = oldUrl.adjusted(QUrl::RemoveFilename);