VOOZH about

URL: https://phabricator.kde.org/D28367

⇱ ⚙ D28367 KServiceAction: store parent service


Differential D28367

KServiceAction: store parent service
ClosedPublic

Authored by dfaure on Mar 27 2020, 10:40 PM.

Details

Summary

This allows KIO::ApplicationLauncherJob to find the icon and name of
the parent service when executing a KServiceAction.

Test Plan

test passes, kio port works

Diff Detail

Repository
R309 KService
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 24361
Build 24379: arc lint + arc unit
dfaure created this revision.Mar 27 2020, 10:40 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 27 2020, 10:40 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
dfaure requested review of this revision.Mar 27 2020, 10:40 PM
broulik accepted this revision.Mar 29 2020, 10:29 AM
broulik added inline comments.
src/services/kserviceaction.cpp
50

You can just delegate to the new constructor

This revision is now accepted and ready to land.Mar 29 2020, 10:29 AM
dfaure closed this revision.Mar 29 2020, 10:40 AM
zzag added a subscriber: zzag.Jul 3 2025, 12:59 PM
Comment Actions

is leaked because both and hold strong references to each other. In other words, when you destroy a with actions, you always leak a bit of memory. At the moment, I'm not sure how to resolve the issue without breaking the API compatibility.

dfaure added a comment.Jul 4 2025, 1:51 PM
Comment Actions

Hmm, turn into a raw pointer? Not sure the action can outlive its parent service?

zzag added a comment.Jul 4 2025, 1:59 PM
Comment Actions

Hmm, turn into a raw pointer? Not sure the action can outlive its parent service?

Not sure about it either. Given the current API, you can pass KServiceAction around and be able to access the corresponding KService.

zzag added a comment.Jul 4 2025, 2:04 PM
Comment Actions

KDesktopFileAction solves such a problem by storing the desktop file path instead.

Revision Contents

CommitTreeParentsAuthorSummaryDate
b87f19a1794560f4d7eb4d3d36933c59d558David Faure
KServiceAction: store parent service (Show More…)
Mar 27 2020, 10:39 PM

Diff 78709

autotests/kservicetest.cpp

Loading...

src/services/kservice.cpp

Loading...

src/services/kserviceaction.h

Loading...

src/services/kserviceaction.cpp

Loading...