Revert "QtGui is not needed in interfaces"
It breaks icons in several places
This reverts commit 2538a6a3e6
.
This commit is contained in:
parent
afe78214ac
commit
5e5275ffb8
5 changed files with 12 additions and 0 deletions
|
@ -66,6 +66,7 @@ generate_export_header(kdeconnectinterfaces EXPORT_FILE_NAME ${CMAKE_CURRENT_BIN
|
||||||
|
|
||||||
target_link_libraries(kdeconnectinterfaces
|
target_link_libraries(kdeconnectinterfaces
|
||||||
LINK_PUBLIC
|
LINK_PUBLIC
|
||||||
|
Qt5::Gui
|
||||||
Qt5::DBus
|
Qt5::DBus
|
||||||
LINK_PRIVATE
|
LINK_PRIVATE
|
||||||
KF5::ConfigCore
|
KF5::ConfigCore
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QDBusInterface>
|
#include <QDBusInterface>
|
||||||
#include <QDBusPendingReply>
|
#include <QDBusPendingReply>
|
||||||
|
#include <QIcon>
|
||||||
#include <QDBusServiceWatcher>
|
#include <QDBusServiceWatcher>
|
||||||
|
|
||||||
#include "dbusinterfaces.h"
|
#include "dbusinterfaces.h"
|
||||||
|
@ -252,6 +253,10 @@ QVariant DevicesModel::data(const QModelIndex& index, int role) const
|
||||||
switch (role) {
|
switch (role) {
|
||||||
case Qt::SizeHintRole:
|
case Qt::SizeHintRole:
|
||||||
return QSize(0, 32);
|
return QSize(0, 32);
|
||||||
|
case IconModelRole: {
|
||||||
|
QString icon = data(index, IconNameRole).toString();
|
||||||
|
return QIcon::fromTheme(icon);
|
||||||
|
}
|
||||||
case IdModelRole:
|
case IdModelRole:
|
||||||
return device->id();
|
return device->id();
|
||||||
case NameModelRole:
|
case NameModelRole:
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#define DEVICESMODEL_H
|
#define DEVICESMODEL_H
|
||||||
|
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
|
#include <QPixmap>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
|
||||||
#include "interfaces/kdeconnectinterfaces_export.h"
|
#include "interfaces/kdeconnectinterfaces_export.h"
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDBusInterface>
|
#include <QDBusInterface>
|
||||||
|
|
||||||
|
#include <QIcon>
|
||||||
|
|
||||||
//#include "modeltest.h"
|
//#include "modeltest.h"
|
||||||
|
|
||||||
//In older Qt released, qAsConst isnt available
|
//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?
|
//FIXME: This function gets called lots of times, producing lots of dbus calls. Add a cache?
|
||||||
switch (role) {
|
switch (role) {
|
||||||
|
case IconModelRole:
|
||||||
|
return QIcon::fromTheme(QStringLiteral("device-notifier"));
|
||||||
case IdModelRole:
|
case IdModelRole:
|
||||||
return notification->internalId();
|
return notification->internalId();
|
||||||
case NameModelRole:
|
case NameModelRole:
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
#include <QAbstractItemModel>
|
#include <QAbstractItemModel>
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
|
#include <QPixmap>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
|
||||||
#include "interfaces/dbusinterfaces.h"
|
#include "interfaces/dbusinterfaces.h"
|
||||||
|
|
Loading…
Reference in a new issue