Review Request 121461: Fix for bug 341773 and minor changes

Arjun AK arjunak234 at gmail.com
Mon Dec 29 06:32:31 UTC 2014



> On Dec. 26, 2014, 1:44 p.m., David Faure wrote:
> > This has been reverted for now, it broke the kio_trash unittest, because it doesn't preserve extensions anymore. Please revisit.
> 
> Arjun AK wrote:
>     Like i said in the ML, what should be done with the following files:
>     `.txt`
>     `..txt`
>     `...`
> 
> David Faure wrote:
>     With the goal of "preserving extensions", I would say:
>     
>     .txt -> 1.txt
>     ..txt -> 1..txt or .1.txt (don't really care which one)
>     ... -> whatever
>     
>     What the patch broke was much more severe:   file.foo became file.foo1 (for any unknown extension).
> 
> Arjun AK wrote:
>     >.txt -> 1.txt
>     >..txt -> 1..txt or .1.txt (don't really care which one)
>     
>     But the problem with that is `.txt` is a hidden file, If you change it to `1.txt`, it becomes visible. The user most likely doesn't want that.
>     
>     >What the patch broke was much more severe:   file.foo became file.foo1 (for any unknown extension).
>     
>     That indeed was wrong, i didn't handle the else part of `!db.suffixForFileName(oldName).isEmpty()`
> 
> David Faure wrote:
>     Ah right. Then let's try to meet both goals:
>     
>     .txt -> .1.txt  (special case, adding '.' in front again so it stays hidden)
>     ..txt -> .1.txt
>     ... -> ..1.
>     
>     It seems to me that this is easy to achieve: with the old (current) algorithm, just add
>        if (oldName.startsWith('.') && !newName.startsWith('.')) {
>            newName.prepend('.');
>        }

>.1.txt

Shouldn't there be a space before 1 (ie ". 1.txt") else the second file will be ".1 1.txt" instead of ". 2.txt"

>..txt -> .1.txt

Shouldn't that be "..1.txt" ?


- Arjun


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121461/#review72518
-----------------------------------------------------------


On Dec. 23, 2014, 11:26 p.m., Arjun AK wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121461/
> -----------------------------------------------------------
> 
> (Updated Dec. 23, 2014, 11:26 p.m.)
> 
> 
> Review request for KDE Frameworks and David Faure.
> 
> 
> Bugs: 341773
>     https://bugs.kde.org/show_bug.cgi?id=341773
> 
> 
> Repository: kio
> 
> 
> Description
> -------
> 
> 1.Fix bug 341773 (Replace dialog suggests incorrect filename when it contains dots). Make use of `QMimeDatabase::suffixForFileName` for calculating the extension.
> 2. Rename `.foo` and `..foo` into `.foo 1` and `..foo 1` respectively, instead of `1.foo` and `.1.foo`, since they are hidden files and we shouldn't be changing that.
> 
> 
> Diffs
> -----
> 
>   autotests/globaltest.cpp 06cb500 
>   src/core/global.cpp f18ac10 
> 
> Diff: https://git.reviewboard.kde.org/r/121461/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Arjun AK
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20141229/802b9c39/attachment.html>


More information about the Kde-frameworks-devel mailing list