Add support for settings portal
ClosedPublic

Authored by jgrulich on Nov 28 2018, 1:10 PM.

Details

Summary

Sandboxed applications usually don't have access to read kdeglobals configuration. For this
reason we introduced Settings portal, to be able to obtain most necessary configuration without
allowing applications access to hosts configuration. The Settings portal implementation in
xdg-desktop-portals-kde was develop mostly for plasma-integration needs so it allows to get
colors, fonts, widget theme and some other configuration from kdeglobals.

Diff Detail

Repository
R135 Integration for Qt applications in Plasma
Branch
jgrulich/portal-support
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 5468
Build 5486: arc lint + arc unit
jgrulich created this revision.Nov 28 2018, 1:10 PM
Restricted Application added a project: Plasma. · View Herald TranscriptNov 28 2018, 1:10 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
jgrulich requested review of this revision.Nov 28 2018, 1:10 PM

Good stuff!

src/platformtheme/kfontsettingsdata.cpp
81

const

131

Compare with QLatin1String

src/platformtheme/kfontsettingsdata.h
70

const

src/platformtheme/khintssettings.cpp
66

I thought Qt could de-serialize built-in types on its own?

79

Can you put that into some shared header file maybe?

357

Those aren't used as dbus interface names anywhere, right? (asking because of the space)

442

Would be lovely to add a KConfig overload to KColorScheme::createApplicationPalette

jgrulich marked 5 inline comments as done.Nov 29 2018, 9:05 AM
jgrulich added inline comments.
src/platformtheme/khintssettings.cpp
66

Nope, I think it can't. You already told me this before, but from my experience I always had to do it this way.

79

They don't seem to share any header file, should I put it into khintsettings.h for example and just include it in kfontsettings.h?

357

No, that's just a name of group or namespace. In kdeglobals "Toolbar style" is name of group, but I had to add some prefix to somehow identify it comes from kdeglobals, because the settings portal can be used also by Gtk apps or any other apps so it has to be clear. Gtk implementation of the settings portal use for example prefix made from GSettings scheme name.

442

Ok, I'll look into that.

jgrulich updated this revision to Diff 46457.Nov 29 2018, 9:06 AM
jgrulich marked 2 inline comments as done.

Minor fixes

jgrulich added inline comments.Nov 29 2018, 11:10 AM
src/platformtheme/khintssettings.cpp
442

It looks it's not that simple, this change would require other additions in order to support KConfig overload. I would leave it as it is for now.

@broulik, may I ask you for review?

broulik accepted this revision.Dec 4 2018, 10:57 AM
This revision is now accepted and ready to land.Dec 4 2018, 10:57 AM
This revision was automatically updated to reflect the committed changes.