Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.3:Rings:2-TestDVD
plasma5-workspace
0004-Remove-duplicated-code-from-DBusMenu-impor...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0004-Remove-duplicated-code-from-DBusMenu-importer.patch of Package plasma5-workspace
From aaa66e47d98bbf16f5a474cf6510daf6b35356e2 Mon Sep 17 00:00:00 2001 From: David Edmundson <kde@davidedmundson.co.uk> Date: Thu, 5 Jan 2017 16:33:48 +0000 Subject: [PATCH 04/44] Remove duplicated code from DBusMenu importer --- appmenu/menuimporter.cpp | 34 +--------------------------------- appmenu/menuimporter.h | 12 ------------ dataengines/CMakeLists.txt | 4 +--- 3 files changed, 2 insertions(+), 48 deletions(-) diff --git a/appmenu/menuimporter.cpp b/appmenu/menuimporter.cpp index 319c8f0b..edae0918 100644 --- a/appmenu/menuimporter.cpp +++ b/appmenu/menuimporter.cpp @@ -26,6 +26,7 @@ #include "menuimporter.h" #include "menuimporteradaptor.h" +#include "dbusmenutypes_p.h" #include <QDBusMessage> #include <QDBusObjectPath> @@ -37,39 +38,6 @@ static const char* DBUS_SERVICE = "com.canonical.AppMenu.Registrar"; static const char* DBUS_OBJECT_PATH = "/com/canonical/AppMenu/Registrar"; -// Marshalling code for DBusMenuLayoutItem -QDBusArgument &operator<<(QDBusArgument &argument, const DBusMenuLayoutItem &obj) -{ - argument.beginStructure(); - argument << obj.id << obj.properties; - argument.beginArray(qMetaTypeId<QDBusVariant>()); - Q_FOREACH(const DBusMenuLayoutItem& child, obj.children) { - argument << QDBusVariant(QVariant::fromValue<DBusMenuLayoutItem>(child)); - } - argument.endArray(); - argument.endStructure(); - return argument; -} - -const QDBusArgument &operator>>(const QDBusArgument &argument, DBusMenuLayoutItem &obj) -{ - argument.beginStructure(); - argument >> obj.id >> obj.properties; - argument.beginArray(); - while (!argument.atEnd()) { - QDBusVariant dbusVariant; - argument >> dbusVariant; - QDBusArgument childArgument = dbusVariant.variant().value<QDBusArgument>(); - - DBusMenuLayoutItem child; - childArgument >> child; - obj.children.append(child); - } - argument.endArray(); - argument.endStructure(); - return argument; -} - MenuImporter::MenuImporter(QObject* parent) : QObject(parent) , m_serviceWatcher(new QDBusServiceWatcher(this)) diff --git a/appmenu/menuimporter.h b/appmenu/menuimporter.h index d8d104e6..d0ec1e82 100644 --- a/appmenu/menuimporter.h +++ b/appmenu/menuimporter.h @@ -39,18 +39,6 @@ class QDBusPendingCallWatcher; class QDBusServiceWatcher; class QMenu; -/** - * Represents an item with its children. GetLayout() returns a - * DBusMenuLayoutItemList. - */ -struct DBusMenuLayoutItem -{ - int id; - QVariantMap properties; - QList<DBusMenuLayoutItem> children; -}; -Q_DECLARE_METATYPE(DBusMenuLayoutItem) - class MenuImporter : public QObject, protected QDBusContext { Q_OBJECT diff --git a/dataengines/CMakeLists.txt b/dataengines/CMakeLists.txt index a0b14dd3..9fcdb57a 100644 --- a/dataengines/CMakeLists.txt +++ b/dataengines/CMakeLists.txt @@ -24,9 +24,7 @@ add_subdirectory(soliddevice) add_subdirectory(time) add_subdirectory(weather) -if (TARGET dbusmenu-qt5) - add_subdirectory(statusnotifieritem) -endif () +add_subdirectory(statusnotifieritem) add_subdirectory(share) if(Boost_FOUND AND KdepimLibs_FOUND) -- 2.12.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor