Review Request 126672: Fix most of Clazy warnings in plasma-framework

Aleix Pol Gonzalez aleixpol at kde.org
Mon Jan 11 13:02:45 UTC 2016



> On Jan. 11, 2016, 1:38 p.m., Sebastian Kügler wrote:
> > autotests/coronatest.cpp, line 182
> > <https://git.reviewboard.kde.org/r/126672/diff/1/?file=429035#file429035line182>
> >
> >     Why is clazy complaining here? I think the .first() API is actually quite nice, don't see anything wrong with it.

.first() returns a reference, so the container has to detach.

Newer Qt versions have a .constFirst() method to solve that, but that's not acceptable for KF5.


> On Jan. 11, 2016, 1:38 p.m., Sebastian Kügler wrote:
> > autotests/coronatest.cpp, line 215
> > <https://git.reviewboard.kde.org/r/126672/diff/1/?file=429035#file429035line215>
> >
> >     Do we really not want the C++11 for here? If we don't, I'd prefer Q_FOREACH as replacement, the Q_ macros seem safer in the long run.

It also detaches.

http://www.dvratil.cz/2015/06/qt-containers-and-c11-range-based-loops/


> On Jan. 11, 2016, 1:38 p.m., Sebastian Kügler wrote:
> > autotests/fallbackpackagetest.cpp, line 46
> > <https://git.reviewboard.kde.org/r/126672/diff/1/?file=429037#file429037line46>
> >
> >     Why wrap the file in QStringLiteral, but not "ui"?

Because it's a QByteArray.


> On Jan. 11, 2016, 1:38 p.m., Sebastian Kügler wrote:
> > autotests/packagestructuretest.cpp, line 39
> > <https://git.reviewboard.kde.org/r/126672/diff/1/?file=429038#file429038line39>
> >
> >     Why not wrap the first argument as well?

It's a QByteArray.


> On Jan. 11, 2016, 1:38 p.m., Sebastian Kügler wrote:
> > src/declarativeimports/calendar/daysmodel.cpp, line 135
> > <https://git.reviewboard.kde.org/r/126672/diff/1/?file=429043#file429043line135>
> >
> >     Why would we not want to pass by ref here?

Clazy checks whether that the tuple is actually bigger than the pointer. Otherwise we're taking a reference when the value is just as fast to pass around.


> On Jan. 11, 2016, 1:38 p.m., Sebastian Kügler wrote:
> > src/declarativeimports/core/corebindingsplugin.cpp, line 77
> > <https://git.reviewboard.kde.org/r/126672/diff/1/?file=429044#file429044line77>
> >
> >     QString()?

+1


- Aleix


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


On Jan. 8, 2016, 2:34 a.m., Sergey Popov wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126672/
> -----------------------------------------------------------
> 
> (Updated Jan. 8, 2016, 2:34 a.m.)
> 
> 
> Review request for KDE Frameworks, Plasma and Aleix Pol Gonzalez.
> 
> 
> Repository: plasma-framework
> 
> 
> Description
> -------
> 
> Fix almost all the Clazy warnings in plasma-framework.
> 
> Related GCI-2015 task: [https://codein.withgoogle.com/tasks/6272625345036288/](https://codein.withgoogle.com/tasks/6272625345036288/)
> 
> 
> Diffs
> -----
> 
>   autotests/coronatest.cpp 378a4b7 
>   autotests/dialogqmltest.cpp 618e64d 
>   autotests/fallbackpackagetest.cpp 91bc6e9 
>   autotests/packagestructuretest.cpp 67cdb4f 
>   autotests/pluginloadertest.cpp 868d5f8 
>   autotests/sortfiltermodeltest.cpp 6ee0e35 
>   autotests/storagetest.cpp 8a7dbd0 
>   src/declarativeimports/calendar/calendar.cpp 5515550 
>   src/declarativeimports/calendar/daysmodel.cpp 0f81b5a 
>   src/declarativeimports/core/corebindingsplugin.cpp adfdc29 
>   src/declarativeimports/core/datamodel.cpp 4449f30 
>   src/declarativeimports/core/datasource.cpp 4fe5dc5 
>   src/declarativeimports/core/tooltip.cpp a5e223b 
>   src/declarativeimports/core/tooltipdialog.cpp 6c3712e 
>   src/declarativeimports/core/units.cpp 1798727 
>   src/declarativeimports/core/windowthumbnail.cpp 21e655e 
>   src/declarativeimports/plasmacomponents/plasmacomponentsplugin.cpp 9e924b3 
>   src/declarativeimports/plasmacomponents/qmenuitem.cpp 287e9b3 
>   src/declarativeimports/plasmaextracomponents/plasmaextracomponentsplugin.cpp 1a25f06 
>   src/plasma/applet.cpp 4ce2d28 
>   src/plasma/containment.cpp 0beb196 
>   src/plasma/containmentactions.cpp f42807f 
>   src/plasma/corona.cpp bae9244 
>   src/plasma/datacontainer.cpp 396bc6d 
>   src/plasma/dataengine.cpp dd56807 
>   src/plasma/dataengineconsumer.cpp 7c9b5f9 
>   src/plasma/framesvg.cpp 81187dc 
>   src/plasma/package.cpp 09f36f3 
>   src/plasma/packagestructure.cpp 09ea698 
>   src/plasma/pluginloader.cpp d7c49f2 
>   src/plasma/private/applet_p.cpp 949c92e 
>   src/plasma/private/associatedapplicationmanager.cpp e1620e9 
>   src/plasma/private/componentinstaller.cpp 8fbef24 
>   src/plasma/private/containment_p.cpp 09ed2cd 
>   src/plasma/private/dataenginemanager.cpp 7862171 
>   src/plasma/private/packages.cpp 1edd55a 
>   src/plasma/private/service_p.h 8a48487 
>   src/plasma/private/storage.cpp bc6992e 
>   src/plasma/private/storagethread.cpp 91b490b 
>   src/plasma/private/svg_p.h 1d1000d 
>   src/plasma/private/theme_p.cpp 18419bb 
>   src/plasma/private/timetracker.cpp cdfe94b 
>   src/plasma/scripting/scriptengine.cpp b9f43fe 
>   src/plasma/service.cpp d603cf2 
>   src/plasma/svg.cpp 28abd00 
>   src/plasma/theme.cpp e9420e6 
>   src/plasmapkg/main.cpp 336b14e 
>   src/plasmapkg/plasmapkg.cpp 4626323 
>   src/plasmaquick/appletquickitem.cpp ec2ed24 
>   src/plasmaquick/configmodel.cpp df537c1 
>   src/plasmaquick/configview.cpp c4ab518 
>   src/plasmaquick/dialog.cpp 8f4ee57 
>   src/plasmaquick/dialogshadows.cpp db408ae 
>   src/plasmaquick/dialogshadows_p.h 7e17c12 
>   src/plasmaquick/packageurlinterceptor.cpp 5e349d2 
>   src/plasmaquick/private/packages.h aa08b11 
>   src/plasmaquick/private/packages.cpp 5275848 
>   src/scriptengines/qml/plasmoid/appletinterface.cpp 8e4979a 
>   src/scriptengines/qml/plasmoid/containmentinterface.cpp 31285a2 
>   src/scriptengines/qml/plasmoid/declarativeappletscript.cpp b15695b 
>   src/scriptengines/qml/plasmoid/wallpaperinterface.cpp 9ecd62b 
>   tests/dpi/main.cpp 6767b2d 
>   tests/kplugins/main.cpp 421e3fb 
>   tests/kplugins/plugintest.h a99701a 
>   tests/kplugins/plugintest.cpp 3d98dec 
>   tests/testengine/testengine.cpp 76947c3 
> 
> Diff: https://git.reviewboard.kde.org/r/126672/diff/
> 
> 
> Testing
> -------
> 
> Tests passed
> 
> 
> Thanks,
> 
> Sergey Popov
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20160111/3a0b7457/attachment-0001.html>


More information about the Plasma-devel mailing list