service's associatedItem is a QQuickItem now

This commit is contained in:
Sebastian Kügler 2013-04-03 00:10:04 +02:00
parent 437f003387
commit 78b6fa2c81
4 changed files with 22 additions and 13 deletions

View File

@ -137,9 +137,18 @@ kconfig_add_kcfg_files(plasma_LIB_SRCS data/kconfigxt/libplasma-theme-global.kcf
kde4_add_library(plasma SHARED ${plasma_LIB_SRCS})
target_link_libraries(plasma ${QT_QTUITOOLS_LIBRARY}
${QT_QTNETWORK_LIBRARY} ${QT_QTSQL_LIBRARY}
${KDE4_KDEUI_LIBS} ${ThreadWeaver_LIBRARIES} ${KAuth_LIBRARIES} ${KWindowSystem_LIBRARIES} ${PLASMA_EXTRA_LIBS} ki18n ${kde4support_LIBRARY})
target_link_libraries(plasma
${QT_QTUITOOLS_LIBRARY}
${QT_QTNETWORK_LIBRARY} ${QT_QTSQL_LIBRARY}
${Qt5Quick_LIBRARIES}
${KDE4_KDEUI_LIBS}
${ThreadWeaver_LIBRARIES}
${KAuth_LIBRARIES}
${KWindowSystem_LIBRARIES}
${PLASMA_EXTRA_LIBS}
ki18n
${kde4support_LIBRARY}
)
#FIXME gpgme++ is in kdepimlibs, neeeds to be elsewhere
target_link_libraries(plasma kdeclarative ${KArchive_LIBRARIES})

View File

@ -103,7 +103,7 @@ public:
KConfig *dummyConfig;
DNSSD::PublicService *publicService;
QMultiHash<QWidget *, QString> associatedWidgets;
QMultiHash<QGraphicsObject *, QString> associatedItems;
QMultiHash<QQuickItem *, QString> associatedItems;
QSet<QString> disabledOperations;
};

View File

@ -23,8 +23,8 @@
#include "config-plasma.h"
#include <QFile>
#include <QGraphicsObject>
#include <QTimer>
#include <QQuickItem>
#include <kdebug.h>
#include <kservice.h>
@ -68,7 +68,7 @@ void ServicePrivate::associatedWidgetDestroyed(QObject *obj)
void ServicePrivate::associatedItemDestroyed(QObject *obj)
{
associatedItems.remove(static_cast<QGraphicsObject*>(obj));
associatedItems.remove(static_cast<QQuickItem*>(obj));
}
KConfigGroup ServicePrivate::dummyGroup()
@ -172,7 +172,7 @@ ServiceJob *Service::startOperationCall(const KConfigGroup &description, QObject
return job;
}
void Service::associateItem(QGraphicsObject *widget, const QString &operation)
void Service::associateItem(QQuickItem *widget, const QString &operation)
{
if (!widget) {
return;
@ -186,7 +186,7 @@ void Service::associateItem(QGraphicsObject *widget, const QString &operation)
widget->setEnabled(!d->disabledOperations.contains(operation));
}
void Service::disassociateItem(QGraphicsObject *widget)
void Service::disassociateItem(QQuickItem *widget)
{
if (!widget) {
return;
@ -241,7 +241,7 @@ void Service::setOperationEnabled(const QString &operation, bool enable)
}
{
QHashIterator<QGraphicsObject *, QString> it(d->associatedItems);
QHashIterator<QQuickItem *, QString> it(d->associatedItems);
while (it.hasNext()) {
it.next();
if (it.value() == operation) {
@ -278,7 +278,7 @@ void Service::setOperationsScheme(QIODevice *xml)
}
{
QHashIterator<QGraphicsObject *, QString> it(d->associatedItems);
QHashIterator<QQuickItem *, QString> it(d->associatedItems);
while (it.hasNext()) {
it.next();
it.key()->setEnabled(d->config->hasGroup(it.value()));

View File

@ -32,7 +32,7 @@
class QIODevice;
class QWidget;
class QUrl;
class QGraphicsObject;
class QQuickItem;
namespace Plasma
{
@ -166,7 +166,7 @@ public:
* @param item the QGraphicsObject to associate with the service
* @param operation the operation to associate the item with
*/
Q_INVOKABLE void associateItem(QGraphicsObject *item, const QString &operation);
Q_INVOKABLE void associateItem(QQuickItem *item, const QString &operation);
/**
* Disassociates a graphics item if it has been associated with an operation
@ -176,7 +176,7 @@ public:
*
* @param widget the QGraphicsItem to disassociate.
*/
Q_INVOKABLE void disassociateItem(QGraphicsObject *widget);
Q_INVOKABLE void disassociateItem(QQuickItem *widget);
/**
* @return a parameter map for the given description