[RenameDialog] Fix crash when renaming single items
ClosedPublic

Authored by elvisangelaccio on Apr 5 2018, 8:38 PM.

Details

Summary

m_spinBox is initialized only when renaming multiple items.

This commit restores the single-item rename logic which was wrongly
removed by commit c5eb4e31161ccf422.

BUG: 392743
FIXED-IN: 18.03.90

Test Plan

Disable inline renaming and try to rename single or multiple items (and also to undo the jobs).

Diff Detail

Repository
R318 Dolphin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
elvisangelaccio created this revision.Apr 5 2018, 8:38 PM
Restricted Application added a subscriber: Dolphin. · View Herald TranscriptApr 5 2018, 8:38 PM
elvisangelaccio requested review of this revision.Apr 5 2018, 8:38 PM
elvisangelaccio edited the test plan for this revision. (Show Details)
elvisangelaccio edited the summary of this revision. (Show Details)
cfeck added a comment.Apr 5 2018, 8:55 PM

m_renamedItems is emitted in renamingFinished(). I haven't checked carefully, but is m_renamedItems correct for the single file rename?

m_renamedItems is emitted in renamingFinished(). I haven't checked carefully, but is m_renamedItems correct for the single file rename?

No, it's not. But it seems to be a pre-existing bug (already in 478f404b8a), as renamingFinished() was being emitted only in the multi-rename case.

cfeck added a comment.EditedApr 5 2018, 9:16 PM

and is m_renamedItems cleared anywhere before or after renaming?

EDIT: only needed if the RenameDialog instance is reused for multiple renames.

  • Set m_renamedItems also in single-rename case

and is m_renamedItems cleared anywhere before or after renaming?

Not explicitly, but any instance of the dialog is used only once anyway.

cfeck accepted this revision.Apr 5 2018, 9:24 PM

Okey. Let's commit it for the RC, and if anything comes up later, we can make changes for the final.

Thanks for the prompt fix!

This revision is now accepted and ready to land.Apr 5 2018, 9:24 PM
This revision was automatically updated to reflect the committed changes.