1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

Preferences: Don't set icon in preview notification

This commit is contained in:
David Rosca 2017-01-21 18:29:21 +01:00
parent 224207b8d6
commit c8345df3fe
3 changed files with 6 additions and 10 deletions

View File

@ -1,6 +1,6 @@
/* ============================================================ /* ============================================================
* QupZilla - WebKit based browser * QupZilla - Qt web browser
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com> * Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -47,6 +47,7 @@ DesktopNotification::DesktopNotification(bool setPosition)
void DesktopNotification::show() void DesktopNotification::show()
{ {
ui->icon->setPixmap(m_icon); ui->icon->setPixmap(m_icon);
ui->icon->setVisible(!m_icon.isNull());
ui->heading->setText(m_heading); ui->heading->setText(m_heading);
ui->text->setText(m_text); ui->text->setText(m_text);

View File

@ -1,6 +1,6 @@
/* ============================================================ /* ============================================================
* QupZilla - WebKit based browser * QupZilla - Qt web browser
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com> * Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -101,15 +101,11 @@ void DesktopNotificationsFactory::showNotification(const QPixmap &icon, const QS
void DesktopNotificationsFactory::nativeNotificationPreview() void DesktopNotificationsFactory::nativeNotificationPreview()
{ {
#if defined(Q_OS_UNIX) && !defined(DISABLE_DBUS) #if defined(Q_OS_UNIX) && !defined(DISABLE_DBUS)
QFile tmp(DataPaths::path(DataPaths::Temp) + "/qupzilla_notif.png");
tmp.open(QFile::WriteOnly);
QPixmap(":icons/preferences/dialog-question.png").save(tmp.fileName());
QDBusInterface dbus("org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications", QDBusConnection::sessionBus()); QDBusInterface dbus("org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications", QDBusConnection::sessionBus());
QVariantList args; QVariantList args;
args.append(QLatin1String("qupzilla")); args.append(QLatin1String("qupzilla"));
args.append(m_uint); args.append(m_uint);
args.append(tmp.fileName()); args.append(QString());
args.append(QObject::tr("Native System Notification")); args.append(QObject::tr("Native System Notification"));
args.append(QString()); args.append(QString());
args.append(QStringList()); args.append(QStringList());

View File

@ -587,7 +587,6 @@ void Preferences::setNotificationPreviewVisible(bool state)
} }
m_notification = new DesktopNotification(true); m_notification = new DesktopNotification(true);
m_notification.data()->setPixmap(QPixmap(":icons/preferences/stock_dialog-question.png"));
m_notification.data()->setHeading(tr("OSD Notification")); m_notification.data()->setHeading(tr("OSD Notification"));
m_notification.data()->setText(tr("Drag it on the screen to place it where you want.")); m_notification.data()->setText(tr("Drag it on the screen to place it where you want."));
m_notification.data()->move(m_notifPosition); m_notification.data()->move(m_notifPosition);