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
|
||||
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"
|
||||
|
|
Loading…
Reference in a new issue