Review Request 128499: KNewFileMenu: Fix suggestion of new filename when file already exist in desktop
David Faure
faure at kde.org
Fri Jul 22 09:09:49 UTC 2016
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/128499/#review97755
-----------------------------------------------------------
src/filewidgets/knewfilemenu.cpp (line 481)
<https://git.reviewboard.kde.org/r/128499/#comment65846>
Ah this is because of the setPath call, I see.
Let's make this more readable and less convoluted.
const QUrl directory = mostLocalUrl(m_popupFiles.first());
QUrl defaultFile(directory);
defaultFile.setPath(....);
if (...) {
text = KIO::suggestName(directory, text);
}
- David Faure
On July 22, 2016, 8:51 a.m., Chinmoy Ranjan Pradhan wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/128499/
> -----------------------------------------------------------
>
> (Updated July 22, 2016, 8:51 a.m.)
>
>
> Review request for KDE Frameworks and David Faure.
>
>
> Repository: kio
>
>
> Description
> -------
>
> When creating a new file, if a file with the default name already exist then a new name is suggested by KIO::suggestName. Now this works fine until the scheme of file's url is "file" but in case the scheme is "desktop" (like when the url in dolphin is set to desktop:/ or "Folder View Settings > Location" is set to desktop:/) then the check for file's existence fails because QFile::exists doesn't understand the "desktop" scheme. So KIO::suggestName is not called and no new filename is suggested in case a file with the same filename already exist. To fix this i used KNewFileMenuPrivate::mostLocalUrl in KNewFileFileMenu::executeRealFileorDir which will resolve "desktop:/" to the user's desktop path.
>
>
> Diffs
> -----
>
> src/filewidgets/knewfilemenu.cpp 2e613b1
>
> Diff: https://git.reviewboard.kde.org/r/128499/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Chinmoy Ranjan Pradhan
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20160722/96ce9452/attachment.html>
More information about the Kde-frameworks-devel
mailing list