utils: fix desktopNotify

This commit is contained in:
tobtoht 2023-03-29 10:15:33 +02:00
parent afbbeee44f
commit 6b065acdae
No known key found for this signature in database
GPG key ID: E45B10DD027D2472

View file

@ -494,8 +494,10 @@ void externalLinkWarning(QWidget *parent, const QString &url){
} }
void desktopNotify(const QString &title, const QString &message, int duration) { void desktopNotify(const QString &title, const QString &message, int duration) {
if (!Config::hideNotifications) if (config()->get(Config::hideNotifications).toBool()) {
{ return;
}
QStringList notify_send = QStringList() << title << message << "-t" << QString::number(duration); QStringList notify_send = QStringList() << title << message << "-t" << QString::number(duration);
QStringList kdialog = QStringList() << title << message; QStringList kdialog = QStringList() << title << message;
QStringList macos = QStringList() << "-e" << QString(R"(display notification "%1" with title "%2")").arg(message).arg(title); QStringList macos = QStringList() << "-e" << QString(R"(display notification "%1" with title "%2")").arg(message).arg(title);
@ -517,7 +519,6 @@ void desktopNotify(const QString &title, const QString &message, int duration) {
QString stderr = process.readAllStandardError(); QString stderr = process.readAllStandardError();
#endif #endif
} }
}
QString displayAddress(const QString& address, int sections, const QString& sep) { QString displayAddress(const QString& address, int sections, const QString& sep) {
QStringList list; QStringList list;