Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
f8fc5b85 by Fatih Uzunoglu at 2024-11-23T13:02:20+00:00
qt: set application badge number to the new error count

- - - - -


1 changed file:

- modules/gui/qt/dialogs/dialogs/dialogmodel.cpp


Changes:

=====================================
modules/gui/qt/dialogs/dialogs/dialogmodel.cpp
=====================================
@@ -125,6 +125,13 @@ void DialogErrorModel::pushError(const DialogError & error)
         repeatedNotificationCount = 1;
     }
 
+#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
+    assert(qGuiApp);
+    const int badgeNumber = qGuiApp->property("badgeNumber").toInt() + 1;
+    qGuiApp->setBadgeNumber(badgeNumber);
+    qGuiApp->setProperty("badgeNumber", badgeNumber);
+#endif
+
     emit countChanged();
 }
 
@@ -150,6 +157,12 @@ int DialogErrorModel::repeatedMessageCount() const
 void DialogErrorModel::resetRepeatedMessageCount()
 {
    repeatedNotificationCount = 0;
+#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
+    // Errors are dismissed, or error dialog is opened.
+    assert(qGuiApp);
+    qGuiApp->setBadgeNumber(0);
+    qGuiApp->setProperty("badgeNumber", 0);
+#endif
 }
 
 
//=================================================================================================



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/f8fc5b85626ff7220268347e50712dc23b276b61

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/f8fc5b85626ff7220268347e50712dc23b276b61
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to