Bug 410253

Summary: Loading of Find & Replace settings handles spaces incorrectly
Product: [Applications] krename Reporter: Marcin Orlowski <mail>
Component: generalAssignee: Heiko Becker <heiko.becker>
Status: RESOLVED DUPLICATE    
Severity: normal CC: justin.zobel, kramski
Priority: NOR    
Version First Reported In: 5.0.0   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Marcin Orlowski 2019-07-26 21:15:24 UTC
SUMMARY

Loading of Find and Replace settings is handled incorrectly as it seems that either spaces are ignored or trimmed. I haven't tried all the cases but it looks like " x " would work as expected, while " " fails. The space is properly saved in XML file anyway, but it's gone while loading.

STEPS TO REPRODUCE
1. On "Filename" tab hit "Find and Replace" and add new rule where you search for a single " " (space) and replace with anything (i.e. single "_" (underscore)
2. save settings
3. load settings you just saved
4. edit your rule. The "Find" field is empty.

EXPECTED RESULT

Find field should contain " "

SOFTWARE/OS VERSIONS
Krename: 5.0.0
KDE Frameworks 5.56.0
Qt 5.12.2 (built against 5.12.2)
The xcb windowing system
Comment 1 kramski 2020-03-01 13:07:43 UTC
This is still an issue for Version 5.0.60 (krename-git 5.0.60.r533.64d6c66-1 on Arch Linux).

Testcase:

- Given a file "aaa bbb ccc.txt"

-- Add interactively Find: (a single blank), Replace: (nothing)
-- Gets you "aaa-bbb-ccc.txt"

-- Save/Load this exact definition
-- Gets you "-a-a-a- -b-b-b- -c-c-c-.-t-x-t-"

KDE Frameworks 5.67.0
Qt 5.14.1 (built against 5.14.1)
The xcb windowing system
Comment 2 kramski 2020-03-01 13:09:00 UTC
Sorry, this should read:

-- Add interactively Find: (a single blank), Replace: - (a single dash)
Comment 3 Justin Zobel 2020-11-24 06:36:19 UTC
This appears to be a duplicate of 394853. Please reopen if this is not the case.

*** This bug has been marked as a duplicate of bug 394853 ***