Review Request 126737: Fix most Clazy warnings in KItemViews.

Andrey Cygankov craftplace.ms at gmail.com
Thu Jan 14 18:21:51 UTC 2016



> On Янв. 14, 2016, 12:35 п.п., Aleix Pol Gonzalez wrote:
> > Looks good, I'll add Sergio, he maybe can explain what the warning meant in the first place.
> > 
> > Andrey, Are you sure you fixed all the warnings? I found some missing, for example:
> > `/home/kde-devel/frameworks/kitemviews/src/kwidgetitemdelegatepool.cpp:48:1: warning: KWidgetItemDelegateEventListener is missing a Q_OBJECT macro [-Wclazy-missing-qobject]`
> 
> Andrey Cygankov wrote:
>     Strangely, I had not noticed the warning in the log . I get to the PC - see the log again.
> 
> Andrey Cygankov wrote:
>     Some warnings , such as using qstringlitetal to initialize a blank line , I thought it wrong. Article Qt Weekly says that empty lines use the qstringliteral is not effective.
> 
> Sergio Martins wrote:
>     what do you mean by blank line, and can you link to that Qt weekly article ?
> 
> Andrey Cygankov wrote:
>     http://blog.qt.io/blog/2014/06/13/qt-weekly-13-qstringliteral/
>     Do not use QStringLiteral for empty strings
> 
> Sergio Martins wrote:
>     afaik clazy doesn't suggest QStringLiteral for empty QStrings, it's even unit-tested, but there might be some code path I missed.
>     can you paste the actual warning it emitted, and also the .cpp file+line number ?

/tests/ktreewidgetsearchlinetest.cpp:78:73: warning: QString(const char*) being called [-Wclazy-qstring-uneeded-heap-allocations]
    new QTreeWidgetItem(item, QStringList() << "Pickled"  << "$4.00" << "" << "Shop");
                                                                        ^
/tests/ktreewidgetsearchlinetest.cpp:77:73: warning: QString(const char*) being called [-Wclazy-qstring-uneeded-heap-allocations]
    new QTreeWidgetItem(item, QStringList() << "Decaying" << "$0.50" << "" << "Ground");
                                                                        ^
/tests/ktreewidgetsearchlinetest.cpp:76:69: warning: QString(const char*) being called [-Wclazy-qstring-uneeded-heap-allocations]
    new QTreeWidgetItem(item, QStringList() << "Ripe" << "$8.00" << "" << "Market");
                                                                    ^
/tests/ktreewidgetsearchlinetest.cpp:75:72: warning: QString(const char*) being called [-Wclazy-qstring-uneeded-heap-allocations]
    new QTreeWidgetItem(item, QStringList() << "Growing" << "$2.00" << "" << "Farmer");
                                                                       ^


- Andrey


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


On Янв. 14, 2016, 12:35 п.п., Andrey Cygankov wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126737/
> -----------------------------------------------------------
> 
> (Updated Янв. 14, 2016, 12:35 п.п.)
> 
> 
> Review request for KDE Frameworks, Aleix Pol Gonzalez and Sergio Martins.
> 
> 
> Repository: kitemviews
> 
> 
> Description
> -------
> 
> Fix Clazy warnings, except:
> /src/kwidgetitemdelegatepool.cpp:153:5: warning: Calling qDeleteAll with QHash::keys, call qDeleteAll on the container itself [-Wclazy-qdeleteall]
>     qDeleteAll(d->widgetInIndex.keys());
> 
> 
> Diffs
> -----
> 
>   autotests/klistwidgetsearchlinetest.cpp b86d62c 
>   src/kcategorizedview.cpp 185c24c 
>   src/ktreewidgetsearchline.cpp b721c58 
>   tests/kcategorizedviewtest.cpp 16dac9a 
>   tests/ktreewidgetsearchlinetest.cpp adaf246 
>   tests/kwidgetitemdelegatetest.cpp d4bba7a 
> 
> Diff: https://git.reviewboard.kde.org/r/126737/diff/
> 
> 
> Testing
> -------
> 
> Build without errors.
> Tests passed.
> 
> 
> Thanks,
> 
> Andrey Cygankov
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20160114/2132dcec/attachment.html>


More information about the Kde-frameworks-devel mailing list