Commit 5e5275ff authored by Nicolas Fella's avatar Nicolas Fella

Revert "QtGui is not needed in interfaces"

It breaks icons in several places

This reverts commit 2538a6a3.
parent afe78214
Pipeline #1827 passed with stage
in 6 minutes and 32 seconds
......@@ -66,6 +66,7 @@ generate_export_header(kdeconnectinterfaces EXPORT_FILE_NAME ${CMAKE_CURRENT_BIN
target_link_libraries(kdeconnectinterfaces
LINK_PUBLIC
Qt5::Gui
Qt5::DBus
LINK_PRIVATE
KF5::ConfigCore
......
......@@ -26,6 +26,7 @@
#include <QString>
#include <QDBusInterface>
#include <QDBusPendingReply>
#include <QIcon>
#include <QDBusServiceWatcher>
#include "dbusinterfaces.h"
......@@ -252,6 +253,10 @@ QVariant DevicesModel::data(const QModelIndex& index, int role) const
switch (role) {
case Qt::SizeHintRole:
return QSize(0, 32);
case IconModelRole: {
QString icon = data(index, IconNameRole).toString();
return QIcon::fromTheme(icon);
}
case IdModelRole:
return device->id();
case NameModelRole:
......
......@@ -22,6 +22,7 @@
#define DEVICESMODEL_H
#include <QAbstractListModel>
#include <QPixmap>
#include <QList>
#include "interfaces/kdeconnectinterfaces_export.h"
......
......@@ -24,6 +24,8 @@
#include <QDebug>
#include <QDBusInterface>
#include <QIcon>
//#include "modeltest.h"
//In older Qt released, qAsConst isnt available
......@@ -182,6 +184,8 @@ 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 QIcon::fromTheme(QStringLiteral("device-notifier"));
case IdModelRole:
return notification->internalId();
case NameModelRole:
......
......@@ -23,6 +23,7 @@
#include <QAbstractItemModel>
#include <QAbstractListModel>
#include <QPixmap>
#include <QList>
#include "interfaces/dbusinterfaces.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment