Port away from deprecated KIO::UDSEntry::insert()
ClosedPublic

Authored by kossebau on Jan 31 2019, 5:25 PM.

Details

Summary

Using replace for DesktopProtocol::prepareUDSEntry(), as we have
no guarantee that certain fields are not set elsewhere in the call chain

Test Plan

Both kio-slave still work

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Jan 31 2019, 5:25 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 31 2019, 5:25 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
kossebau requested review of this revision.Jan 31 2019, 5:25 PM
chinmoyr added inline comments.
kioslave/desktop/kio_desktop.cpp
183

A doubt, why are you using replace here? Is UDS_TARGET_URL set somewhere before coming here?

chinmoyr added inline comments.Feb 5 2019, 3:53 PM
kioslave/desktop/kio_desktop.cpp
183

My bad! I didn't read the summary properly. But it seems UDS_TARGET_URL is not set anywhere prior to this (a year ago I think I fixed a bug involving this line and UDS_TARGET_URL wasn't set at that time :- ).

kossebau added inline comments.Feb 5 2019, 3:57 PM
kioslave/desktop/kio_desktop.cpp
183

:)

Well, I would rather be safe then sorry. We have no control over what other code might do to the entry object, also is there nothing noted in any API contracts.
And it's not very performance critical code here, so I propose future-proof code for now.

chinmoyr accepted this revision.Feb 5 2019, 4:32 PM

LGTM

kioslave/desktop/kio_desktop.cpp
183

I agree with you here.

This revision is now accepted and ready to land.Feb 5 2019, 4:32 PM
This revision was automatically updated to reflect the committed changes.