Review Request 110223: Fix two bugs when renaming multiple files

Emmanuel Pescosta emmanuelpescosta099 at gmail.com
Thu May 2 15:00:13 BST 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/110223/#review31891
-----------------------------------------------------------

Ship it!


Works for me too.

- Emmanuel Pescosta


On April 27, 2013, 8:30 p.m., Frank Reininghaus wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/110223/
> -----------------------------------------------------------
> 
> (Updated April 27, 2013, 8:30 p.m.)
> 
> 
> Review request for Dolphin.
> 
> 
> Description
> -------
> 
> When renaming multiple files, the user can provide a pattern for the new name, which contains one or more '#' that will be replaced by digits. The "Rename" button is only enabled if the pattern contains exactly one sequence of '#'.
> 
> Currently, there are two small problems:
> 
> (a) The button is not enabled if the pattern contains just a '#' and nothing else.
> (b) The button is enabled if there is no '#' at all in the pattern.
> 
> The code that determines if the button should be enabled is obviously incorrect, and also needlessly complex. I think we can just check if the distance between the first and last '#' in the pattern is 1 less than the total number of '#'. That is the case if and only if there is exactly one sequence of '#'.
> 
> In the special case that the count is zero, both QString::indexOf() and QString::lastIndexOf() return -1, and the check fails, so it's not necessary to add a special case for that in the code.
> 
> 
> This addresses bug 318942.
>     http://bugs.kde.org/show_bug.cgi?id=318942
> 
> 
> Diffs
> -----
> 
>   dolphin/src/views/renamedialog.cpp 07add11 
> 
> Diff: http://git.reviewboard.kde.org/r/110223/diff/
> 
> 
> Testing
> -------
> 
> Works for me.
> 
> 
> Thanks,
> 
> Frank Reininghaus
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20130502/bfa44139/attachment.htm>


More information about the kfm-devel mailing list