Port from KIcon to QIcon
Executed kcm and some notifications, icons are still shown.
This commit is contained in:
parent
21712668ee
commit
42269a9dda
10 changed files with 17 additions and 19 deletions
|
@ -33,7 +33,7 @@
|
||||||
#include <KPluginSelector>
|
#include <KPluginSelector>
|
||||||
#include <KServiceTypeTrader>
|
#include <KServiceTypeTrader>
|
||||||
#include <KNotification>
|
#include <KNotification>
|
||||||
#include <KIcon>
|
#include <QIcon>
|
||||||
#include <KGlobal>
|
#include <KGlobal>
|
||||||
#include <KComponentData>
|
#include <KComponentData>
|
||||||
|
|
||||||
|
@ -359,7 +359,7 @@ void Device::privateReceivedPackage(const NetworkPackage& np)
|
||||||
kDebug(debugArea()) << "Pair request";
|
kDebug(debugArea()) << "Pair request";
|
||||||
|
|
||||||
KNotification* notification = new KNotification("pingReceived"); //KNotification::Persistent
|
KNotification* notification = new KNotification("pingReceived"); //KNotification::Persistent
|
||||||
notification->setPixmap(KIcon("dialog-information").pixmap(48, 48));
|
notification->setPixmap(QIcon::fromTheme("dialog-information").pixmap(48, 48));
|
||||||
notification->setComponentName("kdeconnect");
|
notification->setComponentName("kdeconnect");
|
||||||
notification->setTitle("KDE Connect");
|
notification->setTitle("KDE Connect");
|
||||||
notification->setText(i18n("Pairing request from %1", m_deviceName));
|
notification->setText(i18n("Pairing request from %1", m_deviceName));
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QVariantList>
|
#include <QVariantList>
|
||||||
|
|
||||||
#include <KIcon>
|
#include <QIcon>
|
||||||
#include <KPluginFactory>
|
#include <KPluginFactory>
|
||||||
#include <KPluginLoader>
|
#include <KPluginLoader>
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include <KSharedConfig>
|
#include <KSharedConfig>
|
||||||
#include <KConfigGroup>
|
#include <KConfigGroup>
|
||||||
#include <KIcon>
|
#include <QIcon>
|
||||||
|
|
||||||
#include <core/kdebugnamespace.h>
|
#include <core/kdebugnamespace.h>
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ QVariant DevicesModel::data(const QModelIndex& index, int role) const
|
||||||
bool paired = device->isPaired();
|
bool paired = device->isPaired();
|
||||||
bool reachable = device->isReachable();
|
bool reachable = device->isReachable();
|
||||||
QString icon = reachable? (paired? "user-online" : "user-busy") : "user-offline";
|
QString icon = reachable? (paired? "user-online" : "user-busy") : "user-offline";
|
||||||
return KIcon(icon).pixmap(32, 32);
|
return QIcon::fromTheme(icon).pixmap(32, 32);
|
||||||
}
|
}
|
||||||
case IdModelRole:
|
case IdModelRole:
|
||||||
return QString(device->id());
|
return QString(device->id());
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include <KSharedConfig>
|
#include <KSharedConfig>
|
||||||
#include <KConfigGroup>
|
#include <KConfigGroup>
|
||||||
#include <KIcon>
|
#include <QIcon>
|
||||||
|
|
||||||
#include <core/kdebugnamespace.h>
|
#include <core/kdebugnamespace.h>
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ QVariant NotificationsModel::data(const QModelIndex& index, int role) const
|
||||||
//FIXME: This function gets called lots of times, producing lots of dbus calls. Add a cache.
|
//FIXME: This function gets called lots of times, producing lots of dbus calls. Add a cache.
|
||||||
switch (role) {
|
switch (role) {
|
||||||
case IconModelRole:
|
case IconModelRole:
|
||||||
return KIcon("device-notifier").pixmap(32, 32);
|
return QIcon::fromTheme("device-notifier").pixmap(32, 32);
|
||||||
case IdModelRole:
|
case IdModelRole:
|
||||||
return notification->internalId();
|
return notification->internalId();
|
||||||
case NameModelRole:
|
case NameModelRole:
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include "batteryplugin.h"
|
#include "batteryplugin.h"
|
||||||
|
|
||||||
#include <KNotification>
|
#include <KNotification>
|
||||||
#include <KIcon>
|
#include <QIcon>
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
|
|
||||||
#include <core/kdebugnamespace.h>
|
#include <core/kdebugnamespace.h>
|
||||||
|
@ -72,7 +72,7 @@ bool BatteryPlugin::receivePackage(const NetworkPackage& np)
|
||||||
|
|
||||||
if ( thresholdEvent == ThresholdBatteryLow && !isCharging ) {
|
if ( thresholdEvent == ThresholdBatteryLow && !isCharging ) {
|
||||||
KNotification* notification = new KNotification("batteryLow");
|
KNotification* notification = new KNotification("batteryLow");
|
||||||
notification->setPixmap(KIcon("battery-040").pixmap(48, 48));
|
notification->setPixmap(QIcon::fromTheme("battery-040").pixmap(48, 48));
|
||||||
notification->setComponentName("kdeconnect");
|
notification->setComponentName("kdeconnect");
|
||||||
notification->setTitle(i18nc("device name: low battery", "%1: low battery", device()->name()));
|
notification->setTitle(i18nc("device name: low battery", "%1: low battery", device()->name()));
|
||||||
notification->setText(i18n("Battery at %1%", currentCharge));
|
notification->setText(i18n("Battery at %1%", currentCharge));
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include <QDBusConnection>
|
#include <QDBusConnection>
|
||||||
|
|
||||||
#include <KNotification>
|
#include <KNotification>
|
||||||
#include <KIcon>
|
#include <QIcon>
|
||||||
#include <KMD5>
|
#include <KMD5>
|
||||||
|
|
||||||
#include <core/device.h>
|
#include <core/device.h>
|
||||||
|
@ -77,7 +77,7 @@ void NotificationsDbusInterface::processPackage(const NetworkPackage& np)
|
||||||
//Do not show updates to existent notification nor answers to a initialization request
|
//Do not show updates to existent notification nor answers to a initialization request
|
||||||
if (!mInternalIdToPublicId.contains(noti->internalId()) && !np.get<bool>("requestAnswer", false)) {
|
if (!mInternalIdToPublicId.contains(noti->internalId()) && !np.get<bool>("requestAnswer", false)) {
|
||||||
KNotification* notification = new KNotification("notification", KNotification::CloseOnTimeout, this);
|
KNotification* notification = new KNotification("notification", KNotification::CloseOnTimeout, this);
|
||||||
notification->setPixmap(KIcon("preferences-desktop-notification").pixmap(48, 48));
|
notification->setPixmap(QIcon::fromTheme("preferences-desktop-notification").pixmap(48, 48));
|
||||||
notification->setComponentName("kdeconnect");
|
notification->setComponentName("kdeconnect");
|
||||||
notification->setTitle(mDevice->name());
|
notification->setTitle(mDevice->name());
|
||||||
notification->setText(noti->appName() + ": " + noti->ticker());
|
notification->setText(noti->appName() + ": " + noti->ticker());
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
|
|
||||||
#include "notificationsplugin.h"
|
#include "notificationsplugin.h"
|
||||||
|
|
||||||
#include <KIcon>
|
|
||||||
|
|
||||||
#include <core/kdebugnamespace.h>
|
#include <core/kdebugnamespace.h>
|
||||||
#include "notificationsdbusinterface.h"
|
#include "notificationsdbusinterface.h"
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include "pingplugin.h"
|
#include "pingplugin.h"
|
||||||
|
|
||||||
#include <KNotification>
|
#include <KNotification>
|
||||||
#include <KIcon>
|
#include <QIcon>
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
|
|
||||||
#include <core/kdebugnamespace.h>
|
#include <core/kdebugnamespace.h>
|
||||||
|
@ -45,7 +45,7 @@ PingPlugin::~PingPlugin()
|
||||||
bool PingPlugin::receivePackage(const NetworkPackage& np)
|
bool PingPlugin::receivePackage(const NetworkPackage& np)
|
||||||
{
|
{
|
||||||
KNotification* notification = new KNotification("pingReceived"); //KNotification::Persistent
|
KNotification* notification = new KNotification("pingReceived"); //KNotification::Persistent
|
||||||
notification->setPixmap(KIcon("dialog-ok").pixmap(48, 48));
|
notification->setPixmap(QIcon::fromTheme("dialog-ok").pixmap(48, 48));
|
||||||
notification->setComponentName("kdeconnect");
|
notification->setComponentName("kdeconnect");
|
||||||
notification->setTitle(device()->name());
|
notification->setTitle(device()->name());
|
||||||
notification->setText(np.get<QString>("message",i18n("Ping!"))); //This can be a source of spam
|
notification->setText(np.get<QString>("message",i18n("Ping!"))); //This can be a source of spam
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include "shareplugin.h"
|
#include "shareplugin.h"
|
||||||
|
|
||||||
#include <KGlobalSettings>
|
#include <KGlobalSettings>
|
||||||
#include <KIcon>
|
#include <QIcon>
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KStandardDirs>
|
#include <KStandardDirs>
|
||||||
#include <KSharedConfig>
|
#include <KSharedConfig>
|
||||||
|
@ -130,7 +130,7 @@ void SharePlugin::finished(KJob* job)
|
||||||
|
|
||||||
FileTransferJob* transferJob = (FileTransferJob*)job;
|
FileTransferJob* transferJob = (FileTransferJob*)job;
|
||||||
KNotification* notification = new KNotification("pingReceived"); //KNotification::Persistent
|
KNotification* notification = new KNotification("pingReceived"); //KNotification::Persistent
|
||||||
notification->setPixmap(KIcon(error? "edit-delete" : "dialog-ok").pixmap(48, 48));
|
notification->setPixmap(QIcon::fromTheme(error? "edit-delete" : "dialog-ok").pixmap(48, 48));
|
||||||
notification->setComponentName("kdeconnect");
|
notification->setComponentName("kdeconnect");
|
||||||
notification->setTitle(i18n("Transfer finished"));
|
notification->setTitle(i18n("Transfer finished"));
|
||||||
notification->setText(transferJob->destination().fileName());
|
notification->setText(transferJob->destination().fileName());
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include "telephonyplugin.h"
|
#include "telephonyplugin.h"
|
||||||
|
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KIcon>
|
#include <QIcon>
|
||||||
|
|
||||||
#include <core/kdebugnamespace.h>
|
#include <core/kdebugnamespace.h>
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ KNotification* TelephonyPlugin::createNotification(const NetworkPackage& np)
|
||||||
kDebug(debugArea()) << "Creating notification with type:" << type;
|
kDebug(debugArea()) << "Creating notification with type:" << type;
|
||||||
|
|
||||||
KNotification* notification = new KNotification(type, KNotification::CloseOnTimeout, this); //, KNotification::Persistent
|
KNotification* notification = new KNotification(type, KNotification::CloseOnTimeout, this); //, KNotification::Persistent
|
||||||
notification->setPixmap(KIcon(icon).pixmap(48, 48));
|
notification->setPixmap(QIcon::fromTheme(icon).pixmap(48, 48));
|
||||||
notification->setComponentName("kdeconnect");
|
notification->setComponentName("kdeconnect");
|
||||||
notification->setTitle(title);
|
notification->setTitle(title);
|
||||||
notification->setText(content);
|
notification->setText(content);
|
||||||
|
|
Loading…
Reference in a new issue