From e6f48d43307326e14146a9d3d184d784d6ee8a4c Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Tue, 21 Apr 2009 17:15:18 +0200 Subject: Fix Q3FileDialog bug that make impossible to rename twice a file The line edit (to rename the file) contains a guard to avoid double emit when the editing is finished but this flag was not set back properly so it was making the line edit not usable afterwards. Task-number: 251779 Reviewed-by: bnilsen --- src/qt3support/dialogs/q3filedialog.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/qt3support/dialogs') diff --git a/src/qt3support/dialogs/q3filedialog.cpp b/src/qt3support/dialogs/q3filedialog.cpp index 4874b6d940..1ec0cfc6c2 100644 --- a/src/qt3support/dialogs/q3filedialog.cpp +++ b/src/qt3support/dialogs/q3filedialog.cpp @@ -631,6 +631,7 @@ public: protected: void keyPressEvent(QKeyEvent *e); void focusOutEvent(QFocusEvent *e); + void emitDoRename(); signals: void cancelRename(); @@ -1143,16 +1144,20 @@ void QRenameEdit::keyPressEvent(QKeyEvent *e) void QRenameEdit::focusOutEvent(QFocusEvent *) { - if (!doRenameAlreadyEmitted) { - doRenameAlreadyEmitted = true; - emit doRename(); - } + if (!doRenameAlreadyEmitted) + emitDoRename(); } void QRenameEdit::slotReturnPressed() +{ + emitDoRename(); +} + +void QRenameEdit::emitDoRename() { doRenameAlreadyEmitted = true; emit doRename(); + doRenameAlreadyEmitted = false; } /************************************************************************ -- cgit v1.2.3