non 0 default sound volume

This commit is contained in:
Martin Rotter 2021-09-08 07:34:06 +02:00
parent 5cad850e80
commit ba0e264ed3
3 changed files with 5 additions and 2 deletions

View File

@ -84,6 +84,7 @@
#define ENCRYPTION_FILE_NAME "key.private"
#define RELOAD_MODEL_BORDER_NUM 10
#define COOKIE_URL_IDENTIFIER ":COOKIE:"
#define DEFAULT_NOTIFICATION_VOLUME 50
#define GOOGLE_SEARCH_URL "https://www.google.com/search?q=%1&ie=utf-8&oe=utf-8"
#define GOOGLE_SUGGEST_URL "http://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q=%1"

View File

@ -5,6 +5,8 @@
#include <QString>
#include "definitions/definitions.h"
class Application;
class Notification {
@ -34,7 +36,7 @@ class Notification {
};
explicit Notification(Event event = Event::NoEvent, bool balloon = {}, const QString& sound_path = {},
int volume = 50);
int volume = DEFAULT_NOTIFICATION_VOLUME);
bool balloonEnabled() const;

View File

@ -48,7 +48,7 @@ void NotificationFactory::load(Settings* settings) {
auto data = settings->value(GROUP(Notifications), key).toStringList();
auto enabled = data.at(0).toInt() != 0;
auto sound = data.at(1);
auto volume = data.size() > 2 ? data.at(2).toInt() : 100;
auto volume = data.size() > 2 ? data.at(2).toInt() : DEFAULT_NOTIFICATION_VOLUME;
m_notifications.append(Notification(event, enabled, sound, volume));
}