Avoid a double emitResult()
ClosedPublic

Authored by jtamate on Feb 18 2018, 10:16 AM.

Details

Summary

ServiceJob::setResult already does a emitResult.
Discovered with the assert created in https://phabricator.kde.org/D9862

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.
jtamate created this revision.Feb 18 2018, 10:16 AM
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 18 2018, 10:16 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
jtamate requested review of this revision.Feb 18 2018, 10:16 AM
broulik accepted this revision.Feb 18 2018, 4:45 PM
broulik added a subscriber: broulik.

A quick search through plasma codebase reveals that setResult followed by emitResult is done quite often. Care to fix these, too? :)

This revision is now accepted and ready to land.Feb 18 2018, 4:45 PM
jtamate updated this revision to Diff 27523.Feb 19 2018, 9:29 AM

I haven't found more instances of setResult followed by emitResult.

dataengines/places/setupdevicejob.cpp
dataengines/mpris2/playeractionjob.cpp
dataengines/applicationjobs/jobaction.cpp

I did a objdump -d to be sure:

dataengines/places/setupdevicejob.cpp

setError is from KJob and it only sets a member value (d->error = errorCode;)

dataengines/mpris2/playeractionjob.cpp

setErrorText is from KJob also and it only sets a member value (d->errorText = errorText;)

dataengines/applicationjobs/jobaction.cpp

The same as the other two.

Okay, nevermind. Go for it then!

This revision was automatically updated to reflect the committed changes.