From cf943b8c9564a0cc8d215a7bc76a147bdd027aaf Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Sat, 9 Sep 2023 08:27:33 +0200 Subject: Drop custom notification hints --- src/info-notification.vala | 3 --- src/warn-notification.vala | 5 ++--- tests/integration/indicator-sound-test-base.cpp | 10 ++-------- tests/notifications-mock.h | 4 ++-- tests/notifications-test.cc | 11 +---------- 5 files changed, 7 insertions(+), 26 deletions(-) diff --git a/src/info-notification.vala b/src/info-notification.vala index 1405dfe..4379acf 100644 --- a/src/info-notification.vala +++ b/src/info-notification.vala @@ -50,9 +50,6 @@ public class IndicatorSound.InfoNotification: Notification n.update (_("Volume"), volume_label, icon); n.clear_hints(); - n.set_hint ("x-lomiri-non-shaped-icon", "true"); - n.set_hint ("x-lomiri-private-synchronous", "true"); - n.set_hint ("x-lomiri-value-bar-tint", is_high_volume ? "true" : "false"); n.set_hint ("value", ((int32)((volume * 100.0) + 0.5)).clamp(0, 100)); show_notification (); } diff --git a/src/warn-notification.vala b/src/warn-notification.vala index 6a08431..203758e 100644 --- a/src/warn-notification.vala +++ b/src/warn-notification.vala @@ -1,5 +1,6 @@ /* * Copyright 2015 Canonical Ltd. + * Copyright 2021-2023 Robert Tari * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,6 +16,7 @@ * * Authors: * Charles Kerr + * Robert Tari */ public class IndicatorSound.WarnNotification: Notification @@ -31,9 +33,6 @@ public class IndicatorSound.WarnNotification: Notification _("Volume"), _("Allow volume above safe level?\nHigh volume can damage your hearing."), "audio-volume-high"); - n.set_hint ("x-lomiri-non-shaped-icon", "true"); - n.set_hint ("x-lomiri-snap-decisions", "true"); - n.set_hint ("x-lomiri-private-affirmative-tint", "true"); n.closed.connect ((n) => { n.clear_actions (); }); diff --git a/tests/integration/indicator-sound-test-base.cpp b/tests/integration/indicator-sound-test-base.cpp index c201e27..eb4ee8c 100644 --- a/tests/integration/indicator-sound-test-base.cpp +++ b/tests/integration/indicator-sound-test-base.cpp @@ -1,6 +1,6 @@ /* * Copyright 2015 Canonical Ltd. - * Copyright 2021 Robert Tari + * Copyright 2021-2023 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -72,7 +72,7 @@ void IndicatorSoundTestBase::SetUp() "GetCapabilities", "", "as", - "ret = ['actions', 'body', 'body-markup', 'icon-static', 'image/svg+xml', 'x-lomiri-private-synchronous', 'x-canonical-append', 'x-lomiri-private-icon-only', 'x-lomiri-truncation', 'x-canonical-truncation', 'private-synchronous', 'append', 'private-icon-only', 'truncation']" + "ret = ['actions', 'body', 'body-markup', 'icon-static', 'image/svg+xml', 'private-synchronous', 'append', 'private-icon-only', 'truncation']" ).waitForFinished(); int waitedTime = 0; @@ -647,14 +647,8 @@ void IndicatorSoundTestBase::checkVolumeNotification(double volume, QString cons QVariantMap hints; ASSERT_TRUE(qDBusArgumentToMap(args.at(6), hints)); ASSERT_TRUE(hints.contains("value")); - ASSERT_TRUE(hints.contains("x-lomiri-non-shaped-icon")); - ASSERT_TRUE(hints.contains("x-lomiri-value-bar-tint")); - ASSERT_TRUE(hints.contains("x-lomiri-private-synchronous")); EXPECT_EQ(volume*100, hints["value"]); - EXPECT_EQ(true, hints["x-lomiri-non-shaped-icon"]); - EXPECT_EQ(isLoud, hints["x-lomiri-value-bar-tint"]); - EXPECT_EQ(true, hints["x-lomiri-private-synchronous"]); } void IndicatorSoundTestBase::checkHighVolumeNotification(QVariantList call) diff --git a/tests/notifications-mock.h b/tests/notifications-mock.h index ad042d2..3ae8da5 100644 --- a/tests/notifications-mock.h +++ b/tests/notifications-mock.h @@ -1,6 +1,6 @@ /* * Copyright 2015 Canonical Ltd. - * Copyright 2021 Robert Tari + * Copyright 2021-2023 Robert Tari * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ class NotificationsMock DbusTestDbusMockObject * baseobj = nullptr; public: - NotificationsMock (const std::vector& capabilities = {"actions", "body", "body-markup", "icon-static", "image/svg+xml", "x-lomiri-private-synchronous", "x-canonical-append", "x-lomiri-private-icon-only", "x-lomiri-truncation", "x-canonical-truncation", "private-synchronous", "append", "private-icon-only", "truncation"}) { + NotificationsMock (const std::vector& capabilities = {"actions", "body", "body-markup", "icon-static", "image/svg+xml", "private-synchronous", "append", "private-icon-only", "truncation"}) { mock = dbus_test_dbus_mock_new("org.freedesktop.Notifications"); dbus_test_task_set_bus(DBUS_TEST_TASK(mock), DBUS_TEST_SERVICE_BUS_SESSION); dbus_test_task_set_name(DBUS_TEST_TASK(mock), "Notify"); diff --git a/tests/notifications-test.cc b/tests/notifications-test.cc index 7f65104..0233ca6 100644 --- a/tests/notifications-test.cc +++ b/tests/notifications-test.cc @@ -1,6 +1,6 @@ /* * Copyright 2015-2016 Canonical Ltd. - * Copyright 2021 Robert Tari + * Copyright 2021-2023 Robert Tari * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -259,7 +259,6 @@ TEST_F(NotificationsTest, VolumeChanges) { EXPECT_EQ("ayatana-indicator-sound", notev[0].app_name); EXPECT_EQ("Volume", notev[0].summary); EXPECT_EQ(0, notev[0].actions.size()); - EXPECT_GVARIANT_EQ("@s 'true'", notev[0].hints["x-lomiri-private-synchronous"]); EXPECT_GVARIANT_EQ("@i 50", notev[0].hints["value"]); /* Set a different volume */ @@ -432,7 +431,6 @@ TEST_F(NotificationsTest, DISABLED_HighVolume) { ASSERT_EQ(1, notev.size()); EXPECT_EQ("Volume", notev[0].summary); EXPECT_EQ("Speakers", notev[0].body); - EXPECT_GVARIANT_EQ("@s 'false'", notev[0].hints["x-lomiri-value-bar-tint"]); /* Set high volume with volume change */ notifications->clearNotifications(); @@ -443,7 +441,6 @@ TEST_F(NotificationsTest, DISABLED_HighVolume) { ASSERT_LT(0, notev.size()); /* This passes with one or two since it would just be an update to the first if a second was sent */ EXPECT_EQ("Volume", notev[0].summary); EXPECT_EQ("Speakers", notev[0].body); - EXPECT_GVARIANT_EQ("@s 'true'", notev[0].hints["x-lomiri-value-bar-tint"]); /* Move it back */ volume_warning_mock_set_high_volume(VOLUME_WARNING_MOCK(volumeWarning.get()), false); @@ -459,7 +456,6 @@ TEST_F(NotificationsTest, DISABLED_HighVolume) { ASSERT_EQ(1, notev.size()); EXPECT_EQ("Volume", notev[0].summary); EXPECT_EQ("Speakers", notev[0].body); - EXPECT_GVARIANT_EQ("@s 'true'", notev[0].hints["x-lomiri-value-bar-tint"]); } TEST_F(NotificationsTest, DISABLED_MenuHide) { @@ -513,7 +509,6 @@ TEST_F(NotificationsTest, DISABLED_ExtendendVolumeNotification) { EXPECT_EQ("ayatana-indicator-sound", notev[0].app_name); EXPECT_EQ("Volume", notev[0].summary); EXPECT_EQ(0, notev[0].actions.size()); - EXPECT_GVARIANT_EQ("@s 'true'", notev[0].hints["x-lomiri-private-synchronous"]); EXPECT_GVARIANT_EQ("@i 50", notev[0].hints["value"]); /* Allow an amplified volume */ @@ -628,14 +623,10 @@ TEST_F(NotificationsTest, DISABLED_TriggerWarning) { if (warning_expected) { EXPECT_TRUE(volume_warning_get_active(volumeWarning.get())); ASSERT_EQ(1, notev.size()); - EXPECT_GVARIANT_EQ("@s 'true'", notev[0].hints["x-lomiri-snap-decisions"]); - EXPECT_GVARIANT_EQ(nullptr, notev[0].hints["x-lomiri-private-synchronous"]); } else { EXPECT_FALSE(volume_warning_get_active(volumeWarning.get())); ASSERT_EQ(1, notev.size()); - EXPECT_GVARIANT_EQ(nullptr, notev[0].hints["x-lomiri-snap-decisions"]); - EXPECT_GVARIANT_EQ("@s 'true'", notev[0].hints["x-lomiri-private-synchronous"]); } } // multimedia_active -- cgit v1.2.3