Merge lp:~davispuh/libdbusmenu-qt/libdbusmenu-qt into lp:libdbusmenu-qt

Proposed by Dāvis on 2016-02-08
Status: Work in progress
Proposed branch: lp:~davispuh/libdbusmenu-qt/libdbusmenu-qt
Merge into: lp:libdbusmenu-qt
Diff against target: 64 lines (+32/-0)
3 files modified
src/dbusmenutypes_p.cpp (+25/-0)
src/dbusmenutypes_p.h (+6/-0)
tests/CMakeLists.txt (+1/-0)
To merge this branch: bzr merge lp:~davispuh/libdbusmenu-qt/libdbusmenu-qt
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) 2016-02-08 Needs Fixing on 2016-02-17
Review via email: mp+285423@code.launchpad.net

Description of the change

Add DBusMenuShortcut type overload for QDBusArgument

On Qt dev branch QList<T> overload is removed and thus this doesn't compile anymore. Also previously it worked only by luck.

See https://git.reviewboard.kde.org/r/126691/
and https://codereview.qt-project.org/144823

To post a comment you must log in.
Albert Astals Cid (aacid) wrote :

dpkg-buildpackage fails

Linking CXX executable dbusmenuexportertest
CMakeFiles/dbusmenuexportertest.dir/dbusmenuexportertest.cpp.o: In function `DBusMenuExporterTest::testMenuShortcut()':
/home/tsdgeos_work/moo/libdbusmenu-qt/tests/dbusmenuexportertest.cpp:489: undefined reference to `operator>>(QDBusArgument const&, DBusMenuShortcut&)'
collect2: error: ld returned 1 exit status

review: Needs Fixing
Albert Astals Cid (aacid) wrote :

Setting to Work in Progress, please set back to Needs Review when you fix the issue above.

Dāvis (davispuh) wrote :

Currently this isn't actually needed because commit which broke this was reverted for Qt 5.7 but it might be needed for some later release, that's not known yet...

Unmerged revisions

271. By Dāvis on 2016-08-29

merge

270. By Dāvis on 2016-08-29

Add DBusMenuShortcut type overload for QDBusArgument

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/dbusmenutypes_p.cpp'
2--- src/dbusmenutypes_p.cpp 2011-02-23 13:23:56 +0000
3+++ src/dbusmenutypes_p.cpp 2016-08-29 17:03:23 +0000
4@@ -95,6 +95,31 @@
5 return argument;
6 }
7
8+//// DBusMenuShortcut
9+QDBusArgument &operator<<(QDBusArgument &argument, const DBusMenuShortcut &obj)
10+{
11+ argument.beginArray(qMetaTypeId<QStringList>());
12+ typename QList<QStringList>::ConstIterator it = obj.constBegin();
13+ typename QList<QStringList>::ConstIterator end = obj.constEnd();
14+ for ( ; it != end; ++it)
15+ argument << *it;
16+ argument.endArray();
17+ return argument;
18+}
19+
20+const QDBusArgument &operator>>(const QDBusArgument &argument, DBusMenuShortcut &obj)
21+{
22+ argument.beginArray();
23+ obj.clear();
24+ while (!argument.atEnd()) {
25+ QStringList item;
26+ argument >> item;
27+ obj.push_back(item);
28+ }
29+ argument.endArray();
30+ return argument;
31+}
32+
33 void DBusMenuTypes_register()
34 {
35 static bool registered = false;
36
37=== modified file 'src/dbusmenutypes_p.h'
38--- src/dbusmenutypes_p.h 2011-02-23 13:23:56 +0000
39+++ src/dbusmenutypes_p.h 2016-08-29 17:03:23 +0000
40@@ -50,6 +50,12 @@
41
42 Q_DECLARE_METATYPE(DBusMenuItemList)
43
44+//// DBusMenuShortcut
45+
46+class DBusMenuShortcut;
47+
48+QDBusArgument &operator<<(QDBusArgument &argument, const DBusMenuShortcut &);
49+const QDBusArgument &operator>>(const QDBusArgument &argument, DBusMenuShortcut &);
50
51 //// DBusMenuItemKeys
52 /**
53
54=== modified file 'tests/CMakeLists.txt'
55--- tests/CMakeLists.txt 2015-03-05 14:46:16 +0000
56+++ tests/CMakeLists.txt 2016-08-29 17:03:23 +0000
57@@ -75,6 +75,7 @@
58 set(dbusmenuexportertest_SRCS
59 dbusmenuexportertest.cpp
60 testutils.cpp
61+ ${CMAKE_CURRENT_SOURCE_DIR}/../src/dbusmenutypes_p.cpp
62 )
63
64 if (NOT USE_QT5)

Subscribers

People subscribed via source and target branches

to all changes: