Bug 341773

Summary: Replace dialog suggests incorrect filename when it contains dots
Product: [Frameworks and Libraries] kio Reporter: Christoph Feck <cfeck>
Component: generalAssignee: David Faure <faure>
Severity: minor CC: arjunak234, simonandric5
Priority: NOR    
Version: 4.14.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Christoph Feck 2014-12-11 14:28:39 UTC
To reproduce in Dolphin:
- create files "my.test.tar.gz" and "other.test.tar.gz"
- select file "other.test.tar.gz" for rename, note the correct pre-selection without the ".tar.gz" extension
- enter "my.test", i.e. try to rename it to "my.test.tar.gz"
- a pop-up appears suggesting to rename it, again with correct pre-selection
- click "Suggest New Name"

Actual result:
- "my 1.text.tar.gz"

Expected result:
- "my.text 1.tar.gz"
Comment 1 Arjun AK 2014-12-12 10:56:29 UTC
Comment 2 Arjun AK 2014-12-23 17:56:53 UTC
Git commit b75d94bfe399b2764e7947c1a4cb7f668af5d54c by Arjun AK.
Committed on 23/12/2014 at 17:41.
Pushed by arjunak into branch 'master'.

Fix replace dialog's name suggestion

The replace dialog should suggest "foo.bar 1.tar.gz" instead of
"foo 1.bar.tar.gz". Also ".foo" and "..foo" should be renamed into
".foo 1" and "..foo 1" respectively

REVIEW: 121461

M  +4    -2    autotests/globaltest.cpp
M  +16   -16   src/core/global.cpp

Comment 3 Ashish Bansal 2015-05-02 19:26:28 UTC
Git commit c806f88e4ea65330719fa1721cdf15ea5cbddb5a by Ashish Bansal.
Committed on 02/05/2015 at 19:18.
Pushed by ashishbansal into branch 'master'.

Fixed KIO::suggestName to suggest correct names

Earlier for filenames like filename-1.6.tar.gz, KIO::suggestName was
suggesting wrong names (filename-1 2.6.tar.gz, filename-1 3.6.tar.gz).
Now it suggests filename-1.6 (1).tar.gz for above given filename.

REVIEW: 123224

M  +15   -14   autotests/globaltest.cpp
M  +25   -35   src/core/global.cpp