Support multiple entries in XDG_DATA_DIRS
ClosedPublic

Authored by dfaure on May 10 2020, 10:10 PM.

Details

Summary

Multiple themes named "Default" were inserted into the QMap,
one for my prefix and then one for /usr/share, which replaced it.
What we want is this to be a single theme with multiple search paths.

Test Plan

This fixes the "Kontact introduction" in my developer
setup where everything is installed into a custom prefix.
Before this fix, only /usr/share/messageviewer/about was looked at,
and I don't have kontact installed there.

Diff Detail

Repository
R77 PIM: Grantlee Theme
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 27049
Build 27067: arc lint + arc unit
dfaure created this revision.May 10 2020, 10:10 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptMay 10 2020, 10:10 PM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
dfaure requested review of this revision.May 10 2020, 10:10 PM
dvratil requested changes to this revision.May 21 2020, 6:45 AM

Why not simply ignore the theme if it's already in alreayLoadedThemeName, or at least if themes.contains(dirName)? No need to collect the additional theme paths, if they are not used?

src/grantleethememanager.cpp
147

Coding style: braces

This revision now requires changes to proceed.May 21 2020, 6:45 AM

They are used. But indeed I don't actually need that to fix my use case. I thought proper cascading was better than just fixing my use case?

In my use case, <customprefix> has everything, /usr/share has some duplicates. So obviously stopping at <customprefix> would be good enough.
But if someone installs only *one* application in <customprefix> and it adds some things to the default grantlee theme, we still want the rest of the theme to be found in /usr, no?

src/grantleetheme.cpp
78

They *are* used. Here.

193

Here however we have a problem.
AFAICS this is only used by ThemeManager::pathFromThemes().
Not really sure what this bug impacts.

dfaure updated this revision to Diff 83099.May 21 2020, 8:55 AM

add missing braces

dvratil accepted this revision.May 21 2020, 10:04 AM

Ok. I did not notice it's used in the ThemeLoader.

This revision is now accepted and ready to land.May 21 2020, 10:04 AM
dfaure closed this revision.May 21 2020, 10:41 AM