-
Notifications
You must be signed in to change notification settings - Fork 50
core/desktopentry: fix hidden entires and locale matching #246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
4130467
to
84c4146
Compare
c044b6f
to
5d3555d
Compare
e170d91
to
1d94144
Compare
auto lowerId = data.id.toLower(); | ||
|
||
if (data.hidden) { | ||
if (auto* victim = newEntries.take(data.id)) victim->deleteLater(); | ||
newLowercaseEntries.remove(lowerId); | ||
|
||
if (auto it = oldEntries.find(data.id); it != oldEntries.end()) { | ||
it.value()->deleteLater(); | ||
oldEntries.erase(it); | ||
} | ||
|
||
qCDebug(logDesktopEntry) << "Masking hidden desktop entry" << data.id; | ||
continue; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Why deleteLater?
- Is hidden supposed to match only things lower than it in the path, or things higher than it as well? Because this looks like its only matching things lower than it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I just thought it's safer, if the object has any signals connected to ir and what not.
- Lower than it is the intention, that is my understanding of the specification
I mean my understanding of it is that only the highest priority desktop entry should be considered - so it shouldnt treat higher-prio entries as deleted.
5d3555d
to
f904284
Compare
Hidden desktop entries currently get parsed out, however all lower-ranked entires remain. So for example if I:
~/.local/share/applications/org.mozilla.Thunderbird.desktop
withHidden=true
, it gets ignored by the parser. However the entry in/usr/share/applications/org.mozilla.Thunderbird.desktop
does not get ignored.This fixes it by:
hidden
through the parsing stageAlso it fixes the locale matching, by disqualifying mismatching modifies.
An example if evolution, which matched
Name[en@shaw]=·𐑧𐑝𐑩𐑤𐑵𐑖𐑩𐑯
when the locale wasen_US
even though the territory modifier was missing from the locale.Per the spec: https://specifications.freedesktop.org/desktop-entry-spec/latest/localized-keys.html