Simpler check for flatpak
ClosedPublic

Authored by apol on Apr 25 2019, 11:47 PM.

Details

Summary

I saw it being checked like that, I think it reads a bit cleaner.

Diff Detail

Repository
R289 KNotifications
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 11244
Build 11262: arc lint + arc unit
apol created this revision.Apr 25 2019, 11:47 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 25 2019, 11:47 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
apol requested review of this revision.Apr 25 2019, 11:47 PM
broulik added inline comments.
src/knotificationmanager.cpp
94–95

Do you need this check now, even, since you're not using it anymore?

apol added a comment.Apr 26 2019, 11:17 AM

We still use it to check whether to initialise portalDBusServiceExists. I'll simplify it a bit.

apol updated this revision to Diff 57023.Apr 26 2019, 11:18 AM

No need for inSandbox to be a class member

Lookgs good to me, I'll wait for Kai to approve this since he is the maintainer. One thing to consider maybe, did /.flatpak-info always exist or is it something new? I always assumed there is just one flatpak-info file in $XDG_RUNTIME_DIR. Just to be sure it will work for older Flatpak versions.

src/knotificationmanager.cpp
94–95

I think Kai is right, since there is /.flatpak-info (which I didn't know about until now), you don't need to check $XDG_RUNTIME_DIR.

apol updated this revision to Diff 58848.May 29 2019, 2:43 PM

A more compact approach

broulik accepted this revision.May 29 2019, 2:46 PM
This revision is now accepted and ready to land.May 29 2019, 2:46 PM
This revision was automatically updated to reflect the committed changes.