Review Request 119130: Fix template discovery in KNewFileMenu (incorrect port to QStandardPaths)
Mark Gaiser
markg85 at gmail.com
Sat Jul 5 14:11:22 BST 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/119130/#review61646
-----------------------------------------------------------
src/filewidgets/knewfilemenu.cpp
<https://git.reviewboard.kde.org/r/119130/#comment42897>
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.
src/filewidgets/knewfilemenu.cpp
<https://git.reviewboard.kde.org/r/119130/#comment42898>
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? :)
- Mark Gaiser
On jul 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 jul 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/ab1de177/attachment.htm>
More information about the kde-core-devel
mailing list