Review Request 119130: Fix template discovery in KNewFileMenu (incorrect port to QStandardPaths)
Eike Hein
hein at kde.org
Sat Jul 5 14:25:20 BST 2014
> On July 5, 2014, 1:11 p.m., Mark Gaiser wrote:
> > src/filewidgets/knewfilemenu.cpp, line 874
> > <https://git.reviewboard.kde.org/r/119130/diff/1/?file=287354#file287354line874>
> >
> > There is no need for this check since QStandardPaths::locateAll only returns paths that exist: https://qt.gitorious.org/qt/qtbase/source/76371c4d560c5a13f54f1ed9078fb68a393aa1bd:src/corelib/io/qstandardpaths.cpp#L380
> >
> > Or that's how i read the code.
Yeah, this can be dropped - it's habitual sanity-checking paranoia.
> On July 5, 2014, 1:11 p.m., Mark Gaiser wrote:
> > src/filewidgets/knewfilemenu.cpp, lines 875-878
> > <https://git.reviewboard.kde.org/r/119130/diff/1/?file=287354#file287354line875>
> >
> > You should be able to replace this with:
> > files.append(dir.entryList(QStringList() << "*.desktop", QDir::Files));
> >
> > Yes, append also takes a QList<T> container type. If that doesn't work then you also have the option of doing:
> > files += dir.entryList(QStringList() << "*.desktop", QDir::Files);
> >
> > Cool huh, one liners? :)
entryList() doesn't return full absolute paths, only file names, so your one liner isn't actually functionally equivalent (and full paths are needed there).
- Eike
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/119130/#review61646
-----------------------------------------------------------
On July 5, 2014, 12:50 p.m., Eike Hein wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/119130/
> -----------------------------------------------------------
>
> (Updated July 5, 2014, 12:50 p.m.)
>
>
> Review request for kdelibs and David Faure.
>
>
> Repository: kio
>
>
> Description
> -------
>
> KNewFileMenu was incorrectly ported to QStandardPaths, listing directories where it actually wants to collect template files within them. This patch fixes it.
>
>
> Diffs
> -----
>
> src/filewidgets/knewfilemenu.cpp 4f1ca10
>
> Diff: https://git.reviewboard.kde.org/r/119130/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Eike Hein
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20140705/03f1ef80/attachment.htm>
More information about the kde-core-devel
mailing list