[src/ioslaves/*] replace deprecated foreach with range for
ClosedPublic

Authored by ahmadsamir on Sep 25 2019, 12:16 PM.

Details

Test Plan

The code compiles and passes all unit tests

Diff Detail

Repository
R241 KIO
Branch
ahmad/foreach-ioslaves2 (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 17052
Build 17070: arc lint + arc unit
ahmadsamir created this revision.Sep 25 2019, 12:16 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptSep 25 2019, 12:16 PM
ahmadsamir requested review of this revision.Sep 25 2019, 12:16 PM
dfaure requested changes to this revision.Sep 26 2019, 7:50 AM
dfaure added inline comments.
src/ioslaves/http/http.cpp
2612–2613

need to move that function call into a const local variable

src/ioslaves/http/httpauthentication.cpp
548–549

same here

src/ioslaves/http/kcookiejar/kcookiejar.cpp
348

[that one actually returns a reference so it's actually fine.... until someone changes that...]

1413–1414

Keeps the separate variable, make it const.

Otherwise this will detach.

src/ioslaves/http/kcookiejar/kcookieserver.cpp
392

[ok, returns a ref]

src/ioslaves/trash/trashimpl.cpp
717–718

needs local var

This revision now requires changes to proceed.Sep 26 2019, 7:50 AM
ahmadsamir added inline comments.Sep 26 2019, 1:03 PM
src/ioslaves/http/http.cpp
2612–2613

Right. A temporary; but since it's a qstringlist it's implicitly shared.

dfaure added inline comments.Sep 26 2019, 1:24 PM
src/ioslaves/http/http.cpp
2612–2613

Yes it is, so non-const begin() will detach and make a full copy.

ahmadsamir updated this revision to Diff 66895.Sep 26 2019, 2:26 PM

Use const local var for implicilty shared qstringlist's to prevent detaching

dfaure accepted this revision.Sep 26 2019, 9:04 PM
This revision is now accepted and ready to land.Sep 26 2019, 9:04 PM

(Please commit this one too).

dfaure closed this revision.Sep 29 2019, 9:04 PM