not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / solid / networkmanager-0.7 / nmpropertyhelper.cpp
blob350a5674f2a00e078c43b902be689c1a182d2568
1 #include "nmpropertyhelper.h"
3 NMPropertyHelper::NMPropertyHelper(QObject *master) : mMaster(master)
7 NMPropertyHelper::~NMPropertyHelper()
11 void NMPropertyHelper::registerProperty(const QString & nmPropertyName, QPair<char*, char*> propSpec)
13 mRegisteredProperties.insert(nmPropertyName, propSpec);
16 void NMPropertyHelper::deserializeProperties(const QVariantMap& propertiesMap)
18 QMapIterator<QString,QVariant> i(propertiesMap);
19 while (i.hasNext()) {
20 i.next();
21 if (mRegisteredProperties.contains(i.key())) {
22 QPair<char*,char*> spec = mRegisteredProperties[i.key()];
23 mMaster->setProperty(spec.first, i.value());
24 //spec.deserializer->deserialize( spec.propertyName, i.value(), mMaster);
25 // emit signal if one was registered
26 if ( spec.second != 0 )
27 QMetaObject::invokeMethod( mMaster, spec.second );
32 NMPropertyDeserializer::~NMPropertyDeserializer()
36 void GenericDeserializer::deserialize(const QString & propertyName, const QVariant & value, QObject * recipient)
39 recipient->setProperty(propertyName, value);
40 QMetaObject::invokeMethod(recipient, signalName);
41 emit recipient->propertyChanged(propertyName);*/