Skip to content

Indicator: create header settings if it doesn't exist - #360

Merged
danirabbit merged 3 commits into
mainfrom
danirabbit/indicator-notificationcreateheadersetting
Oct 6, 2026
Merged

danirabbit merged 3 commits into
mainfrom
danirabbit/indicator-notificationcreateheadersetting

Conversation

@danirabbit

Copy link
Copy Markdown
Member

When we get a new notification, make sure that we create visibility settings before trying to bind to it in items and headers

@danirabbit
danirabbit requested a review from a team September 11, 2026 16:43
@danirabbit danirabbit added this to OS 9 Sep 11, 2026
@danirabbit danirabbit moved this to Needs Review in OS 9 Sep 11, 2026
Comment thread src/Indicator.vala Outdated
// Create value if it doesn't exist and set true
var settings = new Settings ("io.elementary.panel.notifications");
var headers = (HashTable<string, bool>) settings.get_value ("headers");
if (!headers.contains (notification.desktop_id)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

headers can be null here I think, so we should check for nullability ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably it doesn't unless we give a key that doesn't exist?

https://valadoc.org/gio-2.0/GLib.Settings.get_value.html

Comment thread src/Indicator.vala Outdated
Co-authored-by: Ryo Nakano <ryonakaknock3@gmail.com>
@danirabbit
danirabbit requested a review from ryonakano October 6, 2026 12:48
@danirabbit
danirabbit merged commit 033715d into main Oct 6, 2026
2 of 4 checks passed
@danirabbit
danirabbit deleted the danirabbit/indicator-notificationcreateheadersetting branch October 6, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants