Port from KIcon to QIcon

Executed kcm and some notifications, icons are still shown.
This commit is contained in:
Àlex Fiestas 2014-09-13 01:04:48 +02:00
parent 21712668ee
commit 42269a9dda
10 changed files with 17 additions and 19 deletions

View file

@ -33,7 +33,7 @@
#include <KPluginSelector>
#include <KServiceTypeTrader>
#include <KNotification>
#include <KIcon>
#include <QIcon>
#include <KGlobal>
#include <KComponentData>
@ -359,7 +359,7 @@ void Device::privateReceivedPackage(const NetworkPackage& np)
kDebug(debugArea()) << "Pair request";
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->setTitle("KDE Connect");
notification->setText(i18n("Pairing request from %1", m_deviceName));

View file

@ -29,7 +29,7 @@
#include <QMessageBox>
#include <QVariantList>
#include <KIcon>
#include <QIcon>
#include <KPluginFactory>
#include <KPluginLoader>

View file

@ -24,7 +24,7 @@
#include <KSharedConfig>
#include <KConfigGroup>
#include <KIcon>
#include <QIcon>
#include <core/kdebugnamespace.h>
@ -151,7 +151,7 @@ QVariant DevicesModel::data(const QModelIndex& index, int role) const
bool paired = device->isPaired();
bool reachable = device->isReachable();
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:
return QString(device->id());

View file

@ -24,7 +24,7 @@
#include <KSharedConfig>
#include <KConfigGroup>
#include <KIcon>
#include <QIcon>
#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.
switch (role) {
case IconModelRole:
return KIcon("device-notifier").pixmap(32, 32);
return QIcon::fromTheme("device-notifier").pixmap(32, 32);
case IdModelRole:
return notification->internalId();
case NameModelRole:

View file

@ -21,7 +21,7 @@
#include "batteryplugin.h"
#include <KNotification>
#include <KIcon>
#include <QIcon>
#include <KLocalizedString>
#include <core/kdebugnamespace.h>
@ -72,7 +72,7 @@ bool BatteryPlugin::receivePackage(const NetworkPackage& np)
if ( thresholdEvent == ThresholdBatteryLow && !isCharging ) {
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->setTitle(i18nc("device name: low battery", "%1: low battery", device()->name()));
notification->setText(i18n("Battery at %1%", currentCharge));

View file

@ -23,7 +23,7 @@
#include <QDBusConnection>
#include <KNotification>
#include <KIcon>
#include <QIcon>
#include <KMD5>
#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
if (!mInternalIdToPublicId.contains(noti->internalId()) && !np.get<bool>("requestAnswer", false)) {
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->setTitle(mDevice->name());
notification->setText(noti->appName() + ": " + noti->ticker());

View file

@ -20,8 +20,6 @@
#include "notificationsplugin.h"
#include <KIcon>
#include <core/kdebugnamespace.h>
#include "notificationsdbusinterface.h"

View file

@ -21,7 +21,7 @@
#include "pingplugin.h"
#include <KNotification>
#include <KIcon>
#include <QIcon>
#include <KLocalizedString>
#include <core/kdebugnamespace.h>
@ -45,7 +45,7 @@ PingPlugin::~PingPlugin()
bool PingPlugin::receivePackage(const NetworkPackage& np)
{
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->setTitle(device()->name());
notification->setText(np.get<QString>("message",i18n("Ping!"))); //This can be a source of spam

View file

@ -21,7 +21,7 @@
#include "shareplugin.h"
#include <KGlobalSettings>
#include <KIcon>
#include <QIcon>
#include <KLocalizedString>
#include <KStandardDirs>
#include <KSharedConfig>
@ -130,7 +130,7 @@ void SharePlugin::finished(KJob* job)
FileTransferJob* transferJob = (FileTransferJob*)job;
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->setTitle(i18n("Transfer finished"));
notification->setText(transferJob->destination().fileName());

View file

@ -21,7 +21,7 @@
#include "telephonyplugin.h"
#include <KLocalizedString>
#include <KIcon>
#include <QIcon>
#include <core/kdebugnamespace.h>
@ -69,7 +69,7 @@ KNotification* TelephonyPlugin::createNotification(const NetworkPackage& np)
kDebug(debugArea()) << "Creating notification with type:" << type;
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->setTitle(title);
notification->setText(content);