[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498
Maximiliano Curia
maxy at moszumanska.debian.org
Fri Oct 14 14:28:43 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=7d6912c
The following commit has been merged in the master branch:
commit 7d6912c11f06935202446915e3211dd8f698f958
Author: Aleix Pol <aleixpol at kde.org>
Date: Sat Jun 27 20:53:25 2015 +0200
Revert "Drop NetworkPackage QObject heritage"
It makes us depend on unreleased Qt 5.5. Will un-revert it
when Qt 5.5 is a dependency we can take.
CCMAIL: kdeconnect at kde.org
This reverts commit 1a2f569a4797c325e18b2f2fecd2bfa6d854707e.
---
core/networkpackage.cpp | 20 +++++++++-----------
core/networkpackage.h | 5 +++--
2 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/core/networkpackage.cpp b/core/networkpackage.cpp
index eed65b2..64cfab7 100644
--- a/core/networkpackage.cpp
+++ b/core/networkpackage.cpp
@@ -65,14 +65,13 @@ void NetworkPackage::createIdentityPackage(NetworkPackage* np)
//qCDebug(KDECONNECT_CORE) << "createIdentityPackage" << np->serialize();
}
-template<class T>
-QVariantMap qobject2qvariant(const T* object)
+QVariantMap qobject2qvariant(const QObject* object)
{
QVariantMap map;
- auto metaObject = T::staticMetaObject;
- for(int i = metaObject.propertyOffset(); i < metaObject.propertyCount(); ++i) {
- QMetaProperty prop = metaObject.property(i);
- map.insert(QString::fromLatin1(prop.name()), prop.readOnGadget(object));
+ auto metaObject = object->metaObject();
+ for(int i = metaObject->propertyOffset(); i < metaObject->propertyCount(); ++i) {
+ const char *name = metaObject->property(i).name();
+ map.insert(QString::fromLatin1(name), object->property(name));
}
return map;
@@ -108,19 +107,18 @@ QByteArray NetworkPackage::serialize() const
return json;
}
-template <class T>
-void qvariant2qobject(const QVariantMap& variant, T* object)
+void qvariant2qobject(const QVariantMap& variant, QObject* object)
{
for ( QVariantMap::const_iterator iter = variant.begin(); iter != variant.end(); ++iter )
{
- const int propertyIndex = T::staticMetaObject.indexOfProperty(iter.key().toLatin1());
+ const int propertyIndex = object->metaObject()->indexOfProperty(iter.key().toLatin1());
if (propertyIndex < 0) {
qCWarning(KDECONNECT_CORE) << "missing property" << object << iter.key();
continue;
}
- QMetaProperty property = T::staticMetaObject.property(propertyIndex);
- bool ret = property.writeOnGadget(object, *iter);
+ QMetaProperty property = object->metaObject()->property(propertyIndex);
+ bool ret = property.write(object, *iter);
if (!ret) {
qCWarning(KDECONNECT_CORE) << "couldn't set" << object << "->" << property.name() << '=' << *iter;
}
diff --git a/core/networkpackage.h b/core/networkpackage.h
index 909bb6e..6a0bf9c 100644
--- a/core/networkpackage.h
+++ b/core/networkpackage.h
@@ -37,9 +37,10 @@
class FileTransferJob;
-class KDECONNECTCORE_EXPORT NetworkPackage
+// TODO: investigate if we can turn into Q_GADGET, drop QObject
+class KDECONNECTCORE_EXPORT NetworkPackage : public QObject
{
- Q_GADGET
+ Q_OBJECT
Q_PROPERTY( QString id READ id WRITE setId )
Q_PROPERTY( QString type READ type WRITE setType )
Q_PROPERTY( QVariantMap body READ body WRITE setBody )
--
kdeconnect packaging
More information about the pkg-kde-commits
mailing list