From 15b34a0d05e62f2056120003423a33e79329b0c4 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Mon, 10 Jun 2013 21:15:53 +0200 Subject: Do not rename files unexpectedly when changing the URL If the role editor loses focus, it considers the current renaming operation finished, and tells DolphinView to rename the file. This is a problem when changing the directory, because the URL change happens before DolphinView receives the signal, which results in a file in the new directory being renamed unexpectedly. The solution is to establish the connection to the slotRoleEditingFinished signal only when the "rename inline" editor is opened, and disconnect it when renaming is finished or canceled or the URL changes. BUG: 319912 FIXED-IN: 4.10.5 REVIEW: 110908 --- src/kitemviews/private/kitemlistroleeditor.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/kitemviews/private/kitemlistroleeditor.h') diff --git a/src/kitemviews/private/kitemlistroleeditor.h b/src/kitemviews/private/kitemlistroleeditor.h index aa2c97754..7c2b61e2d 100644 --- a/src/kitemviews/private/kitemlistroleeditor.h +++ b/src/kitemviews/private/kitemlistroleeditor.h @@ -41,17 +41,14 @@ public: explicit KItemListRoleEditor(QWidget* parent); virtual ~KItemListRoleEditor(); - void setIndex(int index); - int index() const; - void setRole(const QByteArray& role); QByteArray role() const; virtual bool eventFilter(QObject* watched, QEvent* event); signals: - void roleEditingFinished(int index, const QByteArray& role, const QVariant& value); - void roleEditingCanceled(int index, const QByteArray& role, const QVariant& value); + void roleEditingFinished(const QByteArray& role, const QVariant& value); + void roleEditingCanceled(const QByteArray& role, const QVariant& value); protected: virtual bool event(QEvent* event); @@ -72,7 +69,6 @@ private: void emitRoleEditingFinished(); private: - int m_index; QByteArray m_role; bool m_blockFinishedSignal; }; -- cgit v1.3