diff options
author | Alex <qt-info@nokia.com> | 2009-12-31 14:08:50 +1000 |
---|---|---|
committer | Alex <qt-info@nokia.com> | 2009-12-31 14:08:50 +1000 |
commit | f6ae651aad2a343d676108ee49692e193f700d4f (patch) | |
tree | 8f9f87f2ab9ed9b46434673bcac341cb9c3b5295 | |
parent | 507676d562fd73a64af9e6cd9d0dc2a5e296d7bd (diff) |
API renaming (2)
QServiceInterfaceDescriptor::PropertyKey -> QServiceInterfaceDescriptor::Attribute
QServiceInterfaceDescriptor::property() -> QServiceInterfaceDescriptor::attribute()
QServiceInterfaceDescriptor::customPrpoerty() -> QServiceInterfaceDescriptor::customAttribute()
QServiceInterfaceDescriptor::customPropertyKeys() -> QServiceInterfaceDescriptor::customAttributes()
-rw-r--r-- | src/serviceframework/qserviceinterfacedescriptor.cpp | 48 | ||||
-rw-r--r-- | src/serviceframework/qserviceinterfacedescriptor.h | 8 | ||||
-rw-r--r-- | src/serviceframework/qserviceinterfacedescriptor_p.h | 12 | ||||
-rw-r--r-- | src/serviceframework/qservicemanager.cpp | 6 | ||||
-rw-r--r-- | src/serviceframework/servicedatabase.cpp | 60 | ||||
-rw-r--r-- | src/serviceframework/servicemetadata.cpp | 12 | ||||
-rw-r--r-- | tests/auto/databasemanager/tst_databasemanager.cpp | 18 | ||||
-rw-r--r-- | tests/auto/databasemanager/tst_databasemanager_s60.cpp | 18 | ||||
-rw-r--r-- | tests/auto/qabstractsecuritysession/tst_qabstractsecuritysession.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qserviceinterfacedescriptor/tst_qserviceinterfacedescriptor.cpp | 172 | ||||
-rw-r--r-- | tests/auto/qservicemanager/tst_qservicemanager.cpp | 78 | ||||
-rw-r--r-- | tests/auto/servicedatabase/tst_servicedatabase.cpp | 60 | ||||
-rw-r--r-- | tests/auto/servicemetadata/tst_servicemetadata.cpp | 36 | ||||
-rw-r--r-- | tools/servicefw/servicefw.cpp | 6 | ||||
-rw-r--r-- | tools/servicexmlgen/interfacewidget.cpp | 14 |
15 files changed, 276 insertions, 276 deletions
diff --git a/src/serviceframework/qserviceinterfacedescriptor.cpp b/src/serviceframework/qserviceinterfacedescriptor.cpp index 7809e8bd6b..a9b38f7723 100644 --- a/src/serviceframework/qserviceinterfacedescriptor.cpp +++ b/src/serviceframework/qserviceinterfacedescriptor.cpp @@ -85,22 +85,22 @@ QTM_BEGIN_NAMESPACE */ /*! - \enum QServiceInterfaceDescriptor::PropertyKey + \enum QServiceInterfaceDescriptor::Attribute - This enum describes the possible property types which can be attached + This enum describes the possible attribute types which can be attached to a QServiceInterfaceDescriptor. - \value Capabilities The capabilities property is a QStringList and + \value Capabilities The capabilities attribute is a QStringList and describes the capabilities that a service client would require to use the service if capability checks are enforced. - \value Location This property points to the location + \value Location This attribute points to the location where the plug-in providing this service is stored. If the service is plug-in based the location is the name and/or path of the plugin. - \value ServiceDescription This property provides a general description for + \value ServiceDescription This attribute provides a general description for the service. - \value InterfaceDescription This property provides a description for the interface + \value InterfaceDescription This attribute provides a description for the interface implementation. */ @@ -245,38 +245,38 @@ int QServiceInterfaceDescriptor::minorVersion() const } /*! - \fn QVariant QServiceInterfaceDescriptor::property(QServiceInterfaceDescriptor::PropertyKey key) const + \fn QVariant QServiceInterfaceDescriptor::attribute(QServiceInterfaceDescriptor::Attribute which) const - Returns the value for the property \a key; otherwise returns + Returns the value for the attribute \a which; otherwise returns an invalid QVariant. */ -QVariant QServiceInterfaceDescriptor::property(QServiceInterfaceDescriptor::PropertyKey key) const +QVariant QServiceInterfaceDescriptor::attribute(QServiceInterfaceDescriptor::Attribute which) const { if (d) - return d->properties.value(key); + return d->attributes.value(which); return QVariant(); } /*! - \fn QString QServiceInterfaceDescriptor::customProperty(const QString& key) const + \fn QString QServiceInterfaceDescriptor::customAttribute(const QString& which) const - Returns the value for the custom property \a key; otherwise + Returns the value for the custom attribute \a which; otherwise returns a null string. */ -QString QServiceInterfaceDescriptor::customProperty(const QString& key) const +QString QServiceInterfaceDescriptor::customAttribute(const QString& which) const { if (d) - return d->customProperties[key]; + return d->customAttributes[which]; return QString(); } /*! - Returns a list of names of the custom properties. + Returns a list of custom attributes attached to the service. */ -QStringList QServiceInterfaceDescriptor::customPropertyKeys() const +QStringList QServiceInterfaceDescriptor::customAttributes() const { if (d) - return d->customProperties.keys(); + return d->customAttributes.keys(); return QStringList(); } @@ -300,17 +300,17 @@ QDebug operator<<(QDebug dbg, const QServiceInterfaceDescriptor &desc) #ifndef QT_NO_DATASTREAM -QDataStream &operator<<(QDataStream &out, const QServiceInterfaceDescriptor::PropertyKey &k) +QDataStream &operator<<(QDataStream &out, const QServiceInterfaceDescriptor::Attribute &k) { out << qint8(k); return out; } -QDataStream &operator>>(QDataStream &in, QServiceInterfaceDescriptor::PropertyKey &k) +QDataStream &operator>>(QDataStream &in, QServiceInterfaceDescriptor::Attribute &k) { quint8 key; in >> key; - k = (QServiceInterfaceDescriptor::PropertyKey)key; + k = (QServiceInterfaceDescriptor::Attribute)key; return in; } /*! @@ -334,8 +334,8 @@ QDataStream &operator<<(QDataStream &out, const QServiceInterfaceDescriptor &dc) out << dc.d->interfaceName; out << dc.d->major; out << dc.d->minor; - out << dc.d->properties; - out << dc.d->customProperties; + out << dc.d->attributes; + out << dc.d->customAttributes; out << (qint8)dc.d->scope; } return out; @@ -378,8 +378,8 @@ QDataStream &operator>>(QDataStream &in, QServiceInterfaceDescriptor &dc) in >> dc.d->interfaceName; in >> dc.d->major; in >> dc.d->minor; - in >> dc.d->properties; - in >> dc.d->customProperties; + in >> dc.d->attributes; + in >> dc.d->customAttributes; in >> valid; dc.d->scope = (QService::Scope) valid; } else { //input stream contains invalid descriptor diff --git a/src/serviceframework/qserviceinterfacedescriptor.h b/src/serviceframework/qserviceinterfacedescriptor.h index 53f75bf019..3e657ca660 100644 --- a/src/serviceframework/qserviceinterfacedescriptor.h +++ b/src/serviceframework/qserviceinterfacedescriptor.h @@ -67,7 +67,7 @@ class QServiceInterfaceDescriptorPrivate; class Q_SERVICEFW_EXPORT QServiceInterfaceDescriptor { public: - enum PropertyKey { + enum Attribute { Capabilities = 0, Location, ServiceDescription, @@ -92,9 +92,9 @@ public: QService::Scope scope() const; - QVariant property(QServiceInterfaceDescriptor::PropertyKey key) const; - QString customProperty(const QString& key) const; - QStringList customPropertyKeys() const; + QVariant attribute(QServiceInterfaceDescriptor::Attribute which) const; + QString customAttribute(const QString& which) const; + QStringList customAttributes() const; private: QServiceInterfaceDescriptorPrivate* d; diff --git a/src/serviceframework/qserviceinterfacedescriptor_p.h b/src/serviceframework/qserviceinterfacedescriptor_p.h index 68f1f48a1c..0ef54c977d 100644 --- a/src/serviceframework/qserviceinterfacedescriptor_p.h +++ b/src/serviceframework/qserviceinterfacedescriptor_p.h @@ -76,8 +76,8 @@ public: && minor == other.minor && interfaceName == other.interfaceName && serviceName == other.serviceName - && properties == other.properties - && customProperties == other.customProperties + && attributes == other.attributes + && customAttributes == other.customAttributes && scope == other.scope) return true; return false; @@ -89,8 +89,8 @@ public: interfaceName = other.interfaceName; minor = other.minor; major = other.major; - properties = other.properties; - customProperties = other.customProperties; + attributes = other.attributes; + customAttributes = other.customAttributes; scope = other.scope; return *this; @@ -113,8 +113,8 @@ public: QString serviceName; QString interfaceName; - QHash<QServiceInterfaceDescriptor::PropertyKey, QVariant> properties; - QHash<QString, QString> customProperties; + QHash<QServiceInterfaceDescriptor::Attribute, QVariant> attributes; + QHash<QString, QString> customAttributes; int major; int minor; QService::Scope scope; diff --git a/src/serviceframework/qservicemanager.cpp b/src/serviceframework/qservicemanager.cpp index 90c6fa15b5..bbe93610e3 100644 --- a/src/serviceframework/qservicemanager.cpp +++ b/src/serviceframework/qservicemanager.cpp @@ -387,14 +387,14 @@ QObject* QServiceManager::loadInterface(const QServiceInterfaceDescriptor& descr return 0; } - const QStringList serviceCaps = descriptor.property(QServiceInterfaceDescriptor::Capabilities).toStringList(); + const QStringList serviceCaps = descriptor.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList(); if ( session && !session->isAllowed(serviceCaps) ) { d->setError(ServiceCapabilityDenied); return 0; } QString serviceFilePath = qservicemanager_resolveLibraryPath( - descriptor.property(QServiceInterfaceDescriptor::Location).toString()); + descriptor.attribute(QServiceInterfaceDescriptor::Location).toString()); if (serviceFilePath.isEmpty()) { d->setError(InvalidServiceLocation); return 0; @@ -568,7 +568,7 @@ bool QServiceManager::removeService(const QString& serviceName) QSet<QString> pluginPathsSet; QList<QServiceInterfaceDescriptor> descriptors = findInterfaces(serviceName); for (int i=0; i<descriptors.count(); i++) - pluginPathsSet << descriptors[i].property(QServiceInterfaceDescriptor::Location).toString(); + pluginPathsSet << descriptors[i].attribute(QServiceInterfaceDescriptor::Location).toString(); QList<QString> pluginPaths = pluginPathsSet.toList(); for (int i=0; i<pluginPaths.count(); i++) { diff --git a/src/serviceframework/servicedatabase.cpp b/src/serviceframework/servicedatabase.cpp index 4ca3e54871..7368368d8b 100644 --- a/src/serviceframework/servicedatabase.cpp +++ b/src/serviceframework/servicedatabase.cpp @@ -618,11 +618,11 @@ bool ServiceDatabase::insertInterfaceData(QSqlQuery *query,const QServiceInterfa } statement = "INSERT INTO InterfaceProperty(InterfaceID, Key, Value) VALUES(?,?,?)"; - QHash<QServiceInterfaceDescriptor::PropertyKey, QVariant>::const_iterator iter = interface.d->properties.constBegin(); + QHash<QServiceInterfaceDescriptor::Attribute, QVariant>::const_iterator iter = interface.d->attributes.constBegin(); bool isValidInterfaceProperty; QString capabilities; QString interfaceDescription; - while (iter != interface.d->properties.constEnd()) { + while (iter != interface.d->attributes.constEnd()) { isValidInterfaceProperty = true; bindValues.clear(); @@ -630,7 +630,7 @@ bool ServiceDatabase::insertInterfaceData(QSqlQuery *query,const QServiceInterfa switch (iter.key()) { case (QServiceInterfaceDescriptor::Capabilities): bindValues.append(INTERFACE_CAPABILITY_KEY); - capabilities = interface.property(QServiceInterfaceDescriptor::Capabilities).toStringList().join(","); + capabilities = interface.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList().join(","); if (capabilities.isNull()) capabilities = ""; bindValues.append(capabilities); @@ -643,7 +643,7 @@ bool ServiceDatabase::insertInterfaceData(QSqlQuery *query,const QServiceInterfa break; case(QServiceInterfaceDescriptor::InterfaceDescription): bindValues.append(INTERFACE_DESCRIPTION_KEY); - interfaceDescription = interface.property(QServiceInterfaceDescriptor::InterfaceDescription).toString(); + interfaceDescription = interface.attribute(QServiceInterfaceDescriptor::InterfaceDescription).toString(); if (interfaceDescription.isNull()) interfaceDescription = ""; bindValues.append(interfaceDescription); @@ -665,9 +665,9 @@ bool ServiceDatabase::insertInterfaceData(QSqlQuery *query,const QServiceInterfa ++iter; } - //add custom properties - QHash<QString, QString>::const_iterator customIter = interface.d->customProperties.constBegin(); - while(customIter!=interface.d->customProperties.constEnd()) { + //add custom attributes + QHash<QString, QString>::const_iterator customIter = interface.d->customAttributes.constBegin(); + while(customIter!=interface.d->customAttributes.constEnd()) { bindValues.clear(); bindValues.append(interfaceID); //to avoid key clashes use separate c_ namespace ->is this sufficient? @@ -855,14 +855,14 @@ QList<QServiceInterfaceDescriptor> ServiceDatabase::getInterfaces(const QService while(query.next()){ difference.clear(); - interface.d->customProperties.clear(); - interface.d->properties.clear(); + interface.d->customAttributes.clear(); + interface.d->attributes.clear(); interface.d->interfaceName =query.value(EBindIndex).toString(); interface.d->serviceName = query.value(EBindIndex1).toString(); interface.d->major = query.value(EBindIndex2).toInt(); interface.d->minor = query.value(EBindIndex3).toInt(); - interface.d->properties[QServiceInterfaceDescriptor::Location] + interface.d->attributes[QServiceInterfaceDescriptor::Location] = query.value(EBindIndex4).toString(); serviceID = query.value(EBindIndex5).toString(); @@ -883,7 +883,7 @@ QList<QServiceInterfaceDescriptor> ServiceDatabase::getInterfaces(const QService return interfaces; } - const QSet<QString> ifaceCaps = interface.d->properties.value(QServiceInterfaceDescriptor::Capabilities).toStringList().toSet(); + const QSet<QString> ifaceCaps = interface.d->attributes.value(QServiceInterfaceDescriptor::Capabilities).toStringList().toSet(); difference = ((filter.capabilityMatchRule() == QServiceFilter::MatchAll) ? (filterCaps-ifaceCaps) : (ifaceCaps-filterCaps)); if (!difference.isEmpty()) continue; @@ -891,12 +891,12 @@ QList<QServiceInterfaceDescriptor> ServiceDatabase::getInterfaces(const QService //only return those interfaces that comply with set custom filters if (filter.customPropertyKeys().size() > 0) { QSet<QString> keyDiff = filter.customPropertyKeys().toSet(); - keyDiff.subtract(interface.d->customProperties.uniqueKeys().toSet()); + keyDiff.subtract(interface.d->customAttributes.uniqueKeys().toSet()); if (keyDiff.isEmpty()) { //target descriptor has same custom keys as filter bool isMatch = true; const QStringList keys = filter.customPropertyKeys(); for(int i = 0; i<keys.count(); i++) { - if (interface.d->customProperties.value(keys[i]) != + if (interface.d->customAttributes.value(keys[i]) != filter.customProperty(keys[i])) { isMatch = false; break; @@ -983,7 +983,7 @@ QServiceInterfaceDescriptor ServiceDatabase::getInterface(const QString &interfa interface.d->serviceName = query.value(EBindIndex1).toString(); interface.d->major = query.value(EBindIndex2).toInt(); interface.d->minor = query.value(EBindIndex3).toInt(); - interface.d->properties[QServiceInterfaceDescriptor::Location] + interface.d->attributes[QServiceInterfaceDescriptor::Location] = query.value(EBindIndex4).toString(); QString serviceID = query.value(EBindIndex5).toString(); @@ -1173,7 +1173,7 @@ QServiceInterfaceDescriptor ServiceDatabase::interfaceDefault(const QString &int interface.d->major = query.value(EBindIndex2).toInt(); interface.d->minor = query.value(EBindIndex3).toInt(); - interface.d->properties[QServiceInterfaceDescriptor::Location] + interface.d->attributes[QServiceInterfaceDescriptor::Location] = query.value(EBindIndex4).toString(); QString serviceID = query.value(EBindIndex5).toString(); @@ -2015,7 +2015,7 @@ bool ServiceDatabase::rollbackTransaction(QSqlQuery *query) /* Helper function that populates a service \a interface descriptor - with interface related properties corresponding to the interface + with interface related attributes corresponding to the interface represented by \a interfaceID It is already assumed that a transaction has been started by the time @@ -2041,24 +2041,24 @@ bool ServiceDatabase::populateInterfaceProperties(QServiceInterfaceDescriptor *i } bool isFound = false; - QString propertyKey; + QString attribute; while (query.next()) { isFound = true; - propertyKey = query.value(EBindIndex).toString(); - if (propertyKey == INTERFACE_CAPABILITY_KEY) { + attribute = query.value(EBindIndex).toString(); + if (attribute == INTERFACE_CAPABILITY_KEY) { const QStringList capabilities = query.value(EBindIndex1).toString().split(","); if (capabilities.count() == 1 && capabilities[0].isEmpty()) { - interface->d->properties[QServiceInterfaceDescriptor::Capabilities] + interface->d->attributes[QServiceInterfaceDescriptor::Capabilities] = QStringList(); } else { - interface->d->properties[QServiceInterfaceDescriptor::Capabilities] + interface->d->attributes[QServiceInterfaceDescriptor::Capabilities] = capabilities; } - } else if (propertyKey == INTERFACE_DESCRIPTION_KEY) { - interface->d->properties[QServiceInterfaceDescriptor::InterfaceDescription] + } else if (attribute == INTERFACE_DESCRIPTION_KEY) { + interface->d->attributes[QServiceInterfaceDescriptor::InterfaceDescription] = query.value(EBindIndex1).toString(); - } else if (propertyKey.startsWith("c_")) { - interface->d->customProperties[propertyKey.mid(2)] + } else if (attribute.startsWith("c_")) { + interface->d->customAttributes[attribute.mid(2)] = query.value(EBindIndex1).toString(); } } @@ -2078,7 +2078,7 @@ bool ServiceDatabase::populateInterfaceProperties(QServiceInterfaceDescriptor *i /* Helper function that populates a service \a interface descriptor - with service related properties corresponding to the service + with service related attributes corresponding to the service represented by \a serviceID It is already assumed that a transaction has been started by the time @@ -2104,12 +2104,12 @@ bool ServiceDatabase::populateServiceProperties(QServiceInterfaceDescriptor *int } bool isFound = false; - QString propertyKey; + QString attribute; while (query.next()) { isFound = true; - propertyKey = query.value(EBindIndex).toString(); - if (propertyKey == SERVICE_DESCRIPTION_KEY) { - interface->d->properties[QServiceInterfaceDescriptor::ServiceDescription] + attribute = query.value(EBindIndex).toString(); + if (attribute == SERVICE_DESCRIPTION_KEY) { + interface->d->attributes[QServiceInterfaceDescriptor::ServiceDescription] = query.value(EBindIndex1).toString(); } } diff --git a/src/serviceframework/servicemetadata.cpp b/src/serviceframework/servicemetadata.cpp index 823b0d354a..abf2c2cef6 100644 --- a/src/serviceframework/servicemetadata.cpp +++ b/src/serviceframework/servicemetadata.cpp @@ -326,8 +326,8 @@ bool ServiceMetaData::processServiceElement(QXmlStreamReader &aXMLReader) } for (int i = 0; i<icount; i++) { serviceInterfaces.at(i).d->serviceName = serviceName; - serviceInterfaces.at(i).d->properties[QServiceInterfaceDescriptor::Location] = serviceLocation; - serviceInterfaces.at(i).d->properties[QServiceInterfaceDescriptor::ServiceDescription] = serviceDescription; + serviceInterfaces.at(i).d->attributes[QServiceInterfaceDescriptor::Location] = serviceLocation; + serviceInterfaces.at(i).d->attributes[QServiceInterfaceDescriptor::ServiceDescription] = serviceDescription; } if (parseError) { @@ -363,7 +363,7 @@ bool ServiceMetaData::processInterfaceElement(QXmlStreamReader &aXMLReader) //Found <name> tag for interface } else if (aXMLReader.isStartElement() && aXMLReader.name() == DESCRIPTION_TAG) { //Found <description> tag - aInterface.d->properties[QServiceInterfaceDescriptor::InterfaceDescription] = aXMLReader.readElementText(); + aInterface.d->attributes[QServiceInterfaceDescriptor::InterfaceDescription] = aXMLReader.readElementText(); dupITags[3]++; //Found </interface>, leave the loop } else if (aXMLReader.isStartElement() && aXMLReader.name() == INTERFACE_VERSION) { @@ -386,21 +386,21 @@ bool ServiceMetaData::processInterfaceElement(QXmlStreamReader &aXMLReader) } else if (aXMLReader.isStartElement() && aXMLReader.name() == INTERFACE_CAPABILITY) { tmp.clear(); tmp= aXMLReader.readElementText(); - aInterface.d->properties[QServiceInterfaceDescriptor::Capabilities] = tmp.split(",", QString::SkipEmptyParts); + aInterface.d->attributes[QServiceInterfaceDescriptor::Capabilities] = tmp.split(",", QString::SkipEmptyParts); dupITags[2]++; } else if (aXMLReader.isStartElement() && aXMLReader.name() == INTERFACE_CUSTOM_PROPERTY) { parseError = true; if (aXMLReader.attributes().hasAttribute("key")) { const QString ref = aXMLReader.attributes().value("key").toString(); if (!ref.isEmpty()) { - if (aInterface.d->customProperties.contains(ref)) { + if (aInterface.d->customAttributes.contains(ref)) { latestError = SFW_ERROR_DUPLICATED_CUSTOM_KEY; continue; } else { QString value = aXMLReader.readElementText(); if (value.isNull()) value = QString(""); - aInterface.d->customProperties[ref] = value; + aInterface.d->customAttributes[ref] = value; parseError = false; } } diff --git a/tests/auto/databasemanager/tst_databasemanager.cpp b/tests/auto/databasemanager/tst_databasemanager.cpp index 224e2ed3f8..f38855a850 100644 --- a/tests/auto/databasemanager/tst_databasemanager.cpp +++ b/tests/auto/databasemanager/tst_databasemanager.cpp @@ -426,7 +426,7 @@ bool tst_DatabaseManager::compareDescriptor(QServiceInterfaceDescriptor interfac { if (interface.d == NULL ) return false; - interface.d->properties[QServiceInterfaceDescriptor::Capabilities] = QStringList(); + interface.d->attributes[QServiceInterfaceDescriptor::Capabilities] = QStringList(); return compareDescriptor(interface, interfaceName, serviceName, majorVersion, minorVersion, QStringList()); @@ -462,9 +462,9 @@ bool tst_DatabaseManager::compareDescriptor(QServiceInterfaceDescriptor interfac return false; } - if (capabilities.count() != 0 || interface.property(QServiceInterfaceDescriptor::Capabilities).toStringList().count() != 0 ) { + if (capabilities.count() != 0 || interface.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList().count() != 0 ) { QStringList securityCapabilities; - securityCapabilities = interface.property(QServiceInterfaceDescriptor::Capabilities).toStringList(); + securityCapabilities = interface.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList(); if(securityCapabilities.count() != capabilities.count()) { qWarning() << "Capabilities count mismatch: expected =" << capabilities.count() @@ -484,23 +484,23 @@ bool tst_DatabaseManager::compareDescriptor(QServiceInterfaceDescriptor interfac } if (!filePath.isEmpty()) { - if (interface.property(QServiceInterfaceDescriptor::Location).toString() != filePath) { + if (interface.attribute(QServiceInterfaceDescriptor::Location).toString() != filePath) { qWarning() << "File path mismatch: expected =" << filePath - << " actual =" << interface.property(QServiceInterfaceDescriptor::Location).toString(); + << " actual =" << interface.attribute(QServiceInterfaceDescriptor::Location).toString(); return false; } } if (!serviceDescription.isEmpty()) { - if (interface.property(QServiceInterfaceDescriptor::ServiceDescription).toString() != serviceDescription) { + if (interface.attribute(QServiceInterfaceDescriptor::ServiceDescription).toString() != serviceDescription) { qWarning() << "Service Description mismatch: expected =" << serviceDescription - << " actual=" << interface.property(QServiceInterfaceDescriptor::ServiceDescription).toString(); + << " actual=" << interface.attribute(QServiceInterfaceDescriptor::ServiceDescription).toString(); return false; } } if (!interfaceDescription.isEmpty()) { - if (interface.property(QServiceInterfaceDescriptor::InterfaceDescription).toString() != interfaceDescription) { + if (interface.attribute(QServiceInterfaceDescriptor::InterfaceDescription).toString() != interfaceDescription) { qWarning() << "Interface Description mismatch: expected =" << interfaceDescription - << " actual =" << interface.property(QServiceInterfaceDescriptor::InterfaceDescription).toString(); + << " actual =" << interface.attribute(QServiceInterfaceDescriptor::InterfaceDescription).toString(); return false; } diff --git a/tests/auto/databasemanager/tst_databasemanager_s60.cpp b/tests/auto/databasemanager/tst_databasemanager_s60.cpp index eb45ceb43e..eca0897946 100644 --- a/tests/auto/databasemanager/tst_databasemanager_s60.cpp +++ b/tests/auto/databasemanager/tst_databasemanager_s60.cpp @@ -432,7 +432,7 @@ bool tst_DatabaseManager::compareDescriptor(QServiceInterfaceDescriptor interfac if (interface.d == NULL ) return false; - interface.d->properties[QServiceInterfaceDescriptor::Capabilities] = QStringList(); + interface.d->attributes[QServiceInterfaceDescriptor::Capabilities] = QStringList(); return compareDescriptor(interface, interfaceName, serviceName, majorVersion, minorVersion, QStringList()); @@ -468,9 +468,9 @@ bool tst_DatabaseManager::compareDescriptor(QServiceInterfaceDescriptor interfac return false; } - if (capabilities.count() != 0 || interface.property(QServiceInterfaceDescriptor::Capabilities).toStringList().count() != 0 ) { + if (capabilities.count() != 0 || interface.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList().count() != 0 ) { QStringList securityCapabilities; - securityCapabilities = interface.property(QServiceInterfaceDescriptor::Capabilities).toStringList(); + securityCapabilities = interface.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList(); if(securityCapabilities.count() != capabilities.count()) { qWarning() << "Capabilities count mismatch: expected =" << capabilities.count() @@ -490,23 +490,23 @@ bool tst_DatabaseManager::compareDescriptor(QServiceInterfaceDescriptor interfac } if (!filePath.isEmpty()) { - if (interface.property(QServiceInterfaceDescriptor::Location).toString() != filePath) { + if (interface.attribute(QServiceInterfaceDescriptor::Location).toString() != filePath) { qWarning() << "File path mismatch: expected =" << filePath - << " actual =" << interface.property(QServiceInterfaceDescriptor::Location).toString(); + << " actual =" << interface.attribute(QServiceInterfaceDescriptor::Location).toString(); return false; } } if (!serviceDescription.isEmpty()) { - if (interface.property(QServiceInterfaceDescriptor::ServiceDescription).toString() != serviceDescription) { + if (interface.attribute(QServiceInterfaceDescriptor::ServiceDescription).toString() != serviceDescription) { qWarning() << "Service Description mismatch: expected =" << serviceDescription - << " actual=" << interface.property(QServiceInterfaceDescriptor::ServiceDescription).toString(); + << " actual=" << interface.attribute(QServiceInterfaceDescriptor::ServiceDescription).toString(); return false; } } if (!interfaceDescription.isEmpty()) { - if (interface.property(QServiceInterfaceDescriptor::InterfaceDescription).toString() != interfaceDescription) { + if (interface.attribute(QServiceInterfaceDescriptor::InterfaceDescription).toString() != interfaceDescription) { qWarning() << "Interface Description mismatch: expected =" << interfaceDescription - << " actual =" << interface.property(QServiceInterfaceDescriptor::InterfaceDescription).toString(); + << " actual =" << interface.attribute(QServiceInterfaceDescriptor::InterfaceDescription).toString(); return false; } diff --git a/tests/auto/qabstractsecuritysession/tst_qabstractsecuritysession.cpp b/tests/auto/qabstractsecuritysession/tst_qabstractsecuritysession.cpp index eddea3ea13..c08f7f8b16 100644 --- a/tests/auto/qabstractsecuritysession/tst_qabstractsecuritysession.cpp +++ b/tests/auto/qabstractsecuritysession/tst_qabstractsecuritysession.cpp @@ -127,7 +127,7 @@ void tst_QAbstractSecuritySession::testSecSessionHandling() QVERIFY(simpleDesc.majorVersion() == 1); QVERIFY(simpleDesc.minorVersion() == 0); QVERIFY(simpleDesc.interfaceName() == QString("com.nokia.qt.ISimpleTypeTest")); - QCOMPARE(simpleDesc.property(QServiceInterfaceDescriptor::Capabilities).toStringList(), + QCOMPARE(simpleDesc.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList(), QStringList() << "simple"); QServiceFilter complexFilter; @@ -139,7 +139,7 @@ void tst_QAbstractSecuritySession::testSecSessionHandling() QVERIFY(complexDesc.majorVersion() == 2); QVERIFY(complexDesc.minorVersion() == 3); QVERIFY(complexDesc.interfaceName() == QString("com.nokia.qt.IComplexTypeTest")); - QCOMPARE(complexDesc.property(QServiceInterfaceDescriptor::Capabilities).toStringList(), + QCOMPARE(complexDesc.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList(), QStringList() << "complex" << "simple"); //no QAbstractSecuritySession object diff --git a/tests/auto/qserviceinterfacedescriptor/tst_qserviceinterfacedescriptor.cpp b/tests/auto/qserviceinterfacedescriptor/tst_qserviceinterfacedescriptor.cpp index f0d6bfb5a5..144b718e8a 100644 --- a/tests/auto/qserviceinterfacedescriptor/tst_qserviceinterfacedescriptor.cpp +++ b/tests/auto/qserviceinterfacedescriptor/tst_qserviceinterfacedescriptor.cpp @@ -75,10 +75,10 @@ void tst_QServiceInterfaceDescriptor::comparison() QVERIFY(desc.minorVersion() == -1); QVERIFY(desc.serviceName().isEmpty()); QVERIFY(desc.interfaceName().isEmpty()); - QVERIFY(!desc.property(QServiceInterfaceDescriptor::Capabilities).isValid()); - QVERIFY(!desc.property(QServiceInterfaceDescriptor::Location).isValid()); - QVERIFY(!desc.property(QServiceInterfaceDescriptor::InterfaceDescription).isValid()); - QVERIFY(!desc.property(QServiceInterfaceDescriptor::ServiceDescription).isValid()); + QVERIFY(!desc.attribute(QServiceInterfaceDescriptor::Capabilities).isValid()); + QVERIFY(!desc.attribute(QServiceInterfaceDescriptor::Location).isValid()); + QVERIFY(!desc.attribute(QServiceInterfaceDescriptor::InterfaceDescription).isValid()); + QVERIFY(!desc.attribute(QServiceInterfaceDescriptor::ServiceDescription).isValid()); QVERIFY(desc.scope() == QService::UserScope); QVERIFY(!desc.isValid()); @@ -87,10 +87,10 @@ void tst_QServiceInterfaceDescriptor::comparison() QVERIFY(copy.minorVersion() == -1); QVERIFY(copy.serviceName().isEmpty()); QVERIFY(copy.interfaceName().isEmpty()); - QVERIFY(!copy.property(QServiceInterfaceDescriptor::Capabilities).isValid()); - QVERIFY(!copy.property(QServiceInterfaceDescriptor::Location).isValid()); - QVERIFY(!copy.property(QServiceInterfaceDescriptor::InterfaceDescription).isValid()); - QVERIFY(!copy.property(QServiceInterfaceDescriptor::ServiceDescription).isValid()); + QVERIFY(!copy.attribute(QServiceInterfaceDescriptor::Capabilities).isValid()); + QVERIFY(!copy.attribute(QServiceInterfaceDescriptor::Location).isValid()); + QVERIFY(!copy.attribute(QServiceInterfaceDescriptor::InterfaceDescription).isValid()); + QVERIFY(!copy.attribute(QServiceInterfaceDescriptor::ServiceDescription).isValid()); QVERIFY(copy.scope() == QService::UserScope); QVERIFY(!copy.isValid()); @@ -103,17 +103,17 @@ void tst_QServiceInterfaceDescriptor::comparison() d->interfaceName = "interface"; d->major = 3; d->minor = 1; - d->properties.insert(QServiceInterfaceDescriptor::ServiceDescription, QString("mydescription")); - d->customProperties.insert(QString("ckey"), QString("cvalue")); + d->attributes.insert(QServiceInterfaceDescriptor::ServiceDescription, QString("mydescription")); + d->customAttributes.insert(QString("ckey"), QString("cvalue")); d->scope = QService::SystemScope; QCOMPARE(valid.interfaceName(), QString("interface")); QCOMPARE(valid.serviceName(), QString("name")); QCOMPARE(valid.majorVersion(), 3); QCOMPARE(valid.minorVersion(), 1); - QCOMPARE(valid.customProperty("ckey"), QString("cvalue")); - QCOMPARE(valid.property(QServiceInterfaceDescriptor::ServiceDescription).toString(), QString("mydescription")); - QCOMPARE(valid.property(QServiceInterfaceDescriptor::Location).toString(), QString("")); + QCOMPARE(valid.customAttribute("ckey"), QString("cvalue")); + QCOMPARE(valid.attribute(QServiceInterfaceDescriptor::ServiceDescription).toString(), QString("mydescription")); + QCOMPARE(valid.attribute(QServiceInterfaceDescriptor::Location).toString(), QString("")); QCOMPARE(valid.scope(), QService::SystemScope); QVERIFY(valid.isValid()); @@ -125,7 +125,7 @@ void tst_QServiceInterfaceDescriptor::comparison() QVERIFY(valid==validCopy); QVERIFY(validCopy==valid); - QServiceInterfaceDescriptorPrivate::getPrivate(&validCopy)->properties.insert(QServiceInterfaceDescriptor::Location, QString("myValue")); + QServiceInterfaceDescriptorPrivate::getPrivate(&validCopy)->attributes.insert(QServiceInterfaceDescriptor::Location, QString("myValue")); QVERIFY(valid!=validCopy); QVERIFY(validCopy!=valid); @@ -133,9 +133,9 @@ void tst_QServiceInterfaceDescriptor::comparison() QCOMPARE(validCopy.serviceName(), QString("name")); QCOMPARE(validCopy.majorVersion(), 3); QCOMPARE(validCopy.minorVersion(), 1); - QCOMPARE(validCopy.property(QServiceInterfaceDescriptor::Location).toString(), QString("myValue")); - QCOMPARE(validCopy.property(QServiceInterfaceDescriptor::ServiceDescription).toString(), QString("mydescription")); - QCOMPARE(validCopy.customProperty("ckey"),QString("cvalue")); + QCOMPARE(validCopy.attribute(QServiceInterfaceDescriptor::Location).toString(), QString("myValue")); + QCOMPARE(validCopy.attribute(QServiceInterfaceDescriptor::ServiceDescription).toString(), QString("mydescription")); + QCOMPARE(validCopy.customAttribute("ckey"),QString("cvalue")); QCOMPARE(validCopy.scope(), QService::SystemScope); QVERIFY(validCopy.isValid()); @@ -144,7 +144,7 @@ void tst_QServiceInterfaceDescriptor::comparison() QVERIFY(valid==validCopy2); QVERIFY(validCopy2==valid); - QServiceInterfaceDescriptorPrivate::getPrivate(&validCopy2)->properties.insert(QServiceInterfaceDescriptor::Location, QString("myValue2")); + QServiceInterfaceDescriptorPrivate::getPrivate(&validCopy2)->attributes.insert(QServiceInterfaceDescriptor::Location, QString("myValue2")); QVERIFY(valid!=validCopy2); QVERIFY(validCopy2!=valid); @@ -152,21 +152,21 @@ void tst_QServiceInterfaceDescriptor::comparison() QCOMPARE(validCopy2.serviceName(), QString("name")); QCOMPARE(validCopy2.majorVersion(), 3); QCOMPARE(validCopy2.minorVersion(), 1); - QCOMPARE(validCopy2.property(QServiceInterfaceDescriptor::Location).toString(), QString("myValue2")); - QCOMPARE(validCopy2.customProperty("ckey"),QString("cvalue")); - QCOMPARE(validCopy2.property(QServiceInterfaceDescriptor::ServiceDescription).toString(), QString("mydescription")); + QCOMPARE(validCopy2.attribute(QServiceInterfaceDescriptor::Location).toString(), QString("myValue2")); + QCOMPARE(validCopy2.customAttribute("ckey"),QString("cvalue")); + QCOMPARE(validCopy2.attribute(QServiceInterfaceDescriptor::ServiceDescription).toString(), QString("mydescription")); QCOMPARE(validCopy2.scope(), QService::SystemScope); QVERIFY(validCopy2.isValid()); - //test customPropertyKeys - d->customProperties.insert(QString("ckey"), QString("cvalue")); - d->customProperties.insert(QString("ckey1"), QString("cvalue1")); - d->customProperties.insert(QString("ckey2"), QString("cvalue2")); - QStringList customPropertyKeys = valid.customPropertyKeys(); - QVERIFY(customPropertyKeys.contains("ckey")); - QVERIFY(customPropertyKeys.contains("ckey1")); - QVERIFY(customPropertyKeys.contains("ckey2")); - QCOMPARE(customPropertyKeys.count(), 3); + //test customAttributes + d->customAttributes.insert(QString("ckey"), QString("cvalue")); + d->customAttributes.insert(QString("ckey1"), QString("cvalue1")); + d->customAttributes.insert(QString("ckey2"), QString("cvalue2")); + QStringList customAttributes = valid.customAttributes(); + QVERIFY(customAttributes.contains("ckey")); + QVERIFY(customAttributes.contains("ckey1")); + QVERIFY(customAttributes.contains("ckey2")); + QCOMPARE(customAttributes.count(), 3); } #ifndef QT_NO_DATASTREAM @@ -199,13 +199,13 @@ void tst_QServiceInterfaceDescriptor::testStreamOperators() d->interfaceName = "interface"; d->major = 3; d->minor = 1; - d->properties.insert(QServiceInterfaceDescriptor::Location, QString("myValue")); - d->properties.insert(QServiceInterfaceDescriptor::Capabilities, QStringList() << "val1" << "val2"); - d->properties.insert(QServiceInterfaceDescriptor::ServiceDescription, QString("This is the service description")); - d->properties.insert(QServiceInterfaceDescriptor::InterfaceDescription, QString("This is the interface description")); - d->customProperties.insert(QString("key1"), QString("value1")); - d->customProperties.insert(QString("abcd"), QString("efgh")); - d->customProperties.insert(QString("empty"), QString("")); + d->attributes.insert(QServiceInterfaceDescriptor::Location, QString("myValue")); + d->attributes.insert(QServiceInterfaceDescriptor::Capabilities, QStringList() << "val1" << "val2"); + d->attributes.insert(QServiceInterfaceDescriptor::ServiceDescription, QString("This is the service description")); + d->attributes.insert(QServiceInterfaceDescriptor::InterfaceDescription, QString("This is the interface description")); + d->customAttributes.insert(QString("key1"), QString("value1")); + d->customAttributes.insert(QString("abcd"), QString("efgh")); + d->customAttributes.insert(QString("empty"), QString("")); d->scope = QService::SystemScope; QVERIFY(valid.isValid()); QServiceInterfaceDescriptor validref = valid; @@ -239,18 +239,18 @@ void tst_QServiceInterfaceDescriptor::testStreamOperators() QVERIFY(invalid2.serviceName() == QString("name")); QVERIFY(invalid2.majorVersion() == 3); QVERIFY(invalid2.minorVersion() == 1); - QVERIFY(invalid2.property(QServiceInterfaceDescriptor::Location).toString() == QString("myValue")); - QVERIFY(invalid2.property(QServiceInterfaceDescriptor::Capabilities).toStringList() == (QStringList() << "val1" << "val2")); - QVERIFY(invalid2.property(QServiceInterfaceDescriptor::ServiceDescription).toString() == QString("This is the service description")); - QVERIFY(invalid2.property(QServiceInterfaceDescriptor::InterfaceDescription).toString() == QString("This is the interface description")); - QCOMPARE(invalid2.customProperty("key1"), QString("value1")); - QCOMPARE(invalid2.customProperty("abcd"), QString("efgh")); - QCOMPARE(invalid2.customProperty("notvalid"), QString()); - QVERIFY(invalid2.customProperty("notvalid").isEmpty()); - QVERIFY(invalid2.customProperty("notvalid").isNull()); - QCOMPARE(invalid2.customProperty("empty"), QString("")); - QVERIFY(invalid2.customProperty("empty").isEmpty()); - QVERIFY(!invalid2.customProperty("empty").isNull()); + QVERIFY(invalid2.attribute(QServiceInterfaceDescriptor::Location).toString() == QString("myValue")); + QVERIFY(invalid2.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList() == (QStringList() << "val1" << "val2")); + QVERIFY(invalid2.attribute(QServiceInterfaceDescriptor::ServiceDescription).toString() == QString("This is the service description")); + QVERIFY(invalid2.attribute(QServiceInterfaceDescriptor::InterfaceDescription).toString() == QString("This is the interface description")); + QCOMPARE(invalid2.customAttribute("key1"), QString("value1")); + QCOMPARE(invalid2.customAttribute("abcd"), QString("efgh")); + QCOMPARE(invalid2.customAttribute("notvalid"), QString()); + QVERIFY(invalid2.customAttribute("notvalid").isEmpty()); + QVERIFY(invalid2.customAttribute("notvalid").isNull()); + QCOMPARE(invalid2.customAttribute("empty"), QString("")); + QVERIFY(invalid2.customAttribute("empty").isEmpty()); + QVERIFY(!invalid2.customAttribute("empty").isNull()); QCOMPARE(invalid2.scope(), QService::SystemScope); //stream valid into valid @@ -261,23 +261,23 @@ void tst_QServiceInterfaceDescriptor::testStreamOperators() d2->interfaceName = "interface2"; d2->major = 5; d2->minor = 6; - d2->properties.insert(QServiceInterfaceDescriptor::Location, QString("myValue1")); - d2->properties.insert(QServiceInterfaceDescriptor::Capabilities, QStringList() << "val3" << "val4"); - d2->properties.insert(QServiceInterfaceDescriptor::ServiceDescription, QString("This is the second service description")); - d2->properties.insert(QServiceInterfaceDescriptor::InterfaceDescription, QString("This is the second interface description")); - d2->customProperties.insert(QString("key1"), QString("value2")); - d2->customProperties.insert(QString("abcd1"), QString("efgh")); - d2->customProperties.insert(QString("empty"), QString("")); + d2->attributes.insert(QServiceInterfaceDescriptor::Location, QString("myValue1")); + d2->attributes.insert(QServiceInterfaceDescriptor::Capabilities, QStringList() << "val3" << "val4"); + d2->attributes.insert(QServiceInterfaceDescriptor::ServiceDescription, QString("This is the second service description")); + d2->attributes.insert(QServiceInterfaceDescriptor::InterfaceDescription, QString("This is the second interface description")); + d2->customAttributes.insert(QString("key1"), QString("value2")); + d2->customAttributes.insert(QString("abcd1"), QString("efgh")); + d2->customAttributes.insert(QString("empty"), QString("")); d2->scope = QService::UserScope; QVERIFY(valid2.isValid()); - QCOMPARE(valid2.customProperty("key1"), QString("value2")); - QCOMPARE(valid2.customProperty("abcd1"), QString("efgh")); - QCOMPARE(valid2.customProperty("abcd"), QString()); - QVERIFY(valid2.customProperty("abcd").isEmpty()); - QVERIFY(valid2.customProperty("abcd").isNull()); - QCOMPARE(valid2.customProperty("empty"), QString("")); - QVERIFY(valid2.customProperty("empty").isEmpty()); - QVERIFY(!valid2.customProperty("empty").isNull()); + QCOMPARE(valid2.customAttribute("key1"), QString("value2")); + QCOMPARE(valid2.customAttribute("abcd1"), QString("efgh")); + QCOMPARE(valid2.customAttribute("abcd"), QString()); + QVERIFY(valid2.customAttribute("abcd").isEmpty()); + QVERIFY(valid2.customAttribute("abcd").isNull()); + QCOMPARE(valid2.customAttribute("empty"), QString("")); + QVERIFY(valid2.customAttribute("empty").isEmpty()); + QVERIFY(!valid2.customAttribute("empty").isNull()); QVERIFY(valid2 != valid); @@ -294,19 +294,19 @@ void tst_QServiceInterfaceDescriptor::testStreamOperators() QVERIFY(valid2.serviceName() == QString("name")); QVERIFY(valid2.majorVersion() == 3); QVERIFY(valid2.minorVersion() == 1); - QVERIFY(valid2.property(QServiceInterfaceDescriptor::Location).toString() == QString("myValue")); - QVERIFY(valid2.property(QServiceInterfaceDescriptor::Capabilities).toStringList() == (QStringList() << "val1" << "val2")); - QVERIFY(valid2.property(QServiceInterfaceDescriptor::ServiceDescription).toString() == QString("This is the service description")); - QVERIFY(valid2.property(QServiceInterfaceDescriptor::InterfaceDescription).toString() == QString("This is the interface description")); - QCOMPARE(valid2.customProperty("key1"), QString("value1")); - QCOMPARE(valid2.customProperty("abcd"), QString("efgh")); - QCOMPARE(valid2.customProperty("notvalid"), QString()); - QVERIFY(valid2.customProperty("notvalid").isEmpty()); - QVERIFY(valid2.customProperty("notvalid").isNull()); - QCOMPARE(valid2.customProperty("empty"), QString("")); - QVERIFY(valid2.customProperty("empty").isEmpty()); - QVERIFY(!valid2.customProperty("empty").isNull()); - QCOMPARE(valid2.customProperty("abcd1"), QString()); + QVERIFY(valid2.attribute(QServiceInterfaceDescriptor::Location).toString() == QString("myValue")); + QVERIFY(valid2.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList() == (QStringList() << "val1" << "val2")); + QVERIFY(valid2.attribute(QServiceInterfaceDescriptor::ServiceDescription).toString() == QString("This is the service description")); + QVERIFY(valid2.attribute(QServiceInterfaceDescriptor::InterfaceDescription).toString() == QString("This is the interface description")); + QCOMPARE(valid2.customAttribute("key1"), QString("value1")); + QCOMPARE(valid2.customAttribute("abcd"), QString("efgh")); + QCOMPARE(valid2.customAttribute("notvalid"), QString()); + QVERIFY(valid2.customAttribute("notvalid").isEmpty()); + QVERIFY(valid2.customAttribute("notvalid").isNull()); + QCOMPARE(valid2.customAttribute("empty"), QString("")); + QVERIFY(valid2.customAttribute("empty").isEmpty()); + QVERIFY(!valid2.customAttribute("empty").isNull()); + QCOMPARE(valid2.customAttribute("abcd1"), QString()); QCOMPARE(valid2.scope(), QService::SystemScope); } #endif //QT_NO_DATASTREAM @@ -331,10 +331,10 @@ void tst_QServiceInterfaceDescriptor::testDebugStream() d2->interfaceName = "interface2"; d2->major = 5; d2->minor = 6; - d2->properties.insert(QServiceInterfaceDescriptor::Location, QString("myValue1")); - d2->properties.insert(QServiceInterfaceDescriptor::Capabilities, QStringList() << "val3" << "val4"); - d2->properties.insert(QServiceInterfaceDescriptor::ServiceDescription, QString("This is the second service description")); - d2->properties.insert(QServiceInterfaceDescriptor::InterfaceDescription, QString("This is the second interface description")); + d2->attributes.insert(QServiceInterfaceDescriptor::Location, QString("myValue1")); + d2->attributes.insert(QServiceInterfaceDescriptor::Capabilities, QStringList() << "val3" << "val4"); + d2->attributes.insert(QServiceInterfaceDescriptor::ServiceDescription, QString("This is the second service description")); + d2->attributes.insert(QServiceInterfaceDescriptor::InterfaceDescription, QString("This is the second interface description")); QVERIFY(valid2.isValid()); QServiceInterfaceDescriptor invalid; @@ -361,11 +361,11 @@ void tst_QServiceInterfaceDescriptor::destructor() d->interfaceName = "interface"; d->major = 3; d->minor = 1; - d->properties.insert(QServiceInterfaceDescriptor::Location, QString("myValue")); - d->properties.insert(QServiceInterfaceDescriptor::Capabilities, QStringList() << "val1" << "val2"); - d->properties.insert(QServiceInterfaceDescriptor::ServiceDescription, QString("This is the service description")); - d->properties.insert(QServiceInterfaceDescriptor::InterfaceDescription, QString("This is the interface description")); - d->customProperties.insert("ckey", "cvalue"); + d->attributes.insert(QServiceInterfaceDescriptor::Location, QString("myValue")); + d->attributes.insert(QServiceInterfaceDescriptor::Capabilities, QStringList() << "val1" << "val2"); + d->attributes.insert(QServiceInterfaceDescriptor::ServiceDescription, QString("This is the service description")); + d->attributes.insert(QServiceInterfaceDescriptor::InterfaceDescription, QString("This is the interface description")); + d->customAttributes.insert("ckey", "cvalue"); QVERIFY(valid->isValid()); delete valid; } diff --git a/tests/auto/qservicemanager/tst_qservicemanager.cpp b/tests/auto/qservicemanager/tst_qservicemanager.cpp index e522bea5cb..d13bcc9c7b 100644 --- a/tests/auto/qservicemanager/tst_qservicemanager.cpp +++ b/tests/auto/qservicemanager/tst_qservicemanager.cpp @@ -78,7 +78,7 @@ Q_DECLARE_METATYPE(QList<QByteArray>) Q_DECLARE_METATYPE(QtMobility::QService::Scope) QTM_BEGIN_NAMESPACE -typedef QHash<QtMobility::QServiceInterfaceDescriptor::PropertyKey, QVariant> DescriptorProperties; +typedef QHash<QtMobility::QServiceInterfaceDescriptor::Attribute, QVariant> DescriptorAttributes; inline uint qHash(const QtMobility::QServiceInterfaceDescriptor &desc) { @@ -87,16 +87,16 @@ inline uint qHash(const QtMobility::QServiceInterfaceDescriptor &desc) QTM_END_NAMESPACE QTM_USE_NAMESPACE -static DescriptorProperties defaultDescriptorProperties() +static DescriptorAttributes defaultDescriptorAttributes() { - DescriptorProperties props; + DescriptorAttributes props; //props[QServiceInterfaceDescriptor::Capabilities] = QStringList(); props[QServiceInterfaceDescriptor::Location] = ""; props[QServiceInterfaceDescriptor::ServiceDescription] = ""; props[QServiceInterfaceDescriptor::InterfaceDescription] = ""; return props; } -static const DescriptorProperties DEFAULT_DESCRIPTOR_PROPERTIES = defaultDescriptorProperties(); +static const DescriptorAttributes DEFAULT_DESCRIPTOR_PROPERTIES = defaultDescriptorAttributes(); static QStringList validPluginFiles() { @@ -169,8 +169,8 @@ private: { Q_ASSERT(descriptors.count() > 0); return createServiceXml(serviceName, createInterfaceXml(descriptors), - descriptors[0].property(QServiceInterfaceDescriptor::Location).toString(), - descriptors[0].property(QServiceInterfaceDescriptor::ServiceDescription).toString()); + descriptors[0].attribute(QServiceInterfaceDescriptor::Location).toString(), + descriptors[0].attribute(QServiceInterfaceDescriptor::ServiceDescription).toString()); } QByteArray createInterfaceXml(const QList<QServiceInterfaceDescriptor> &descriptors) const @@ -179,7 +179,7 @@ private: foreach (const QServiceInterfaceDescriptor &desc, descriptors) { QString version = QString("%1.%2").arg(desc.majorVersion()).arg(desc.minorVersion()); interfacesXml += createInterfaceXml(desc.interfaceName(), version, - desc.property(QServiceInterfaceDescriptor::InterfaceDescription).toString()); + desc.attribute(QServiceInterfaceDescriptor::InterfaceDescription).toString()); } return interfacesXml; } @@ -195,7 +195,7 @@ private: } - QServiceInterfaceDescriptor createDescriptor(const QString &interfaceName, int major, int minor, const QString &serviceName, const DescriptorProperties &properties = DescriptorProperties(), QService::Scope scope = QService::UserScope) const + QServiceInterfaceDescriptor createDescriptor(const QString &interfaceName, int major, int minor, const QString &serviceName, const DescriptorAttributes &attributes = DescriptorAttributes(), QService::Scope scope = QService::UserScope) const { QString version = QString("%1.%2").arg(major).arg(minor); @@ -206,10 +206,10 @@ private: priv->minor = minor; priv->scope = scope; - priv->properties = properties; - foreach (QServiceInterfaceDescriptor::PropertyKey key, DEFAULT_DESCRIPTOR_PROPERTIES.keys()) { - if (!priv->properties.contains(key)) - priv->properties[key] = DEFAULT_DESCRIPTOR_PROPERTIES[key]; + priv->attributes = attributes; + foreach (QServiceInterfaceDescriptor::Attribute key, DEFAULT_DESCRIPTOR_PROPERTIES.keys()) { + if (!priv->attributes.contains(key)) + priv->attributes[key] = DEFAULT_DESCRIPTOR_PROPERTIES[key]; } QServiceInterfaceDescriptor desc; @@ -475,14 +475,14 @@ void tst_QServiceManager::findInterfaces_filter_data() QTest::addColumn<ServiceInterfaceDescriptorList>("expectedInterfaces"); QString serviceName = "SomeTestService"; - DescriptorProperties properties; - properties[QServiceInterfaceDescriptor::Location] = VALID_PLUGIN_FILES.first(); + DescriptorAttributes attributes; + attributes[QServiceInterfaceDescriptor::Location] = VALID_PLUGIN_FILES.first(); QList<QServiceInterfaceDescriptor> descriptors; - descriptors << createDescriptor("com.nokia.qt.TestInterfaceA", 1, 0, serviceName, properties); - descriptors << createDescriptor("com.nokia.qt.TestInterfaceB", 1, 0, serviceName, properties); - descriptors << createDescriptor("com.nokia.qt.TestInterfaceB", 2, 0, serviceName, properties); - descriptors << createDescriptor("com.nokia.qt.TestInterfaceB", 2, 3, serviceName, properties); + descriptors << createDescriptor("com.nokia.qt.TestInterfaceA", 1, 0, serviceName, attributes); + descriptors << createDescriptor("com.nokia.qt.TestInterfaceB", 1, 0, serviceName, attributes); + descriptors << createDescriptor("com.nokia.qt.TestInterfaceB", 2, 0, serviceName, attributes); + descriptors << createDescriptor("com.nokia.qt.TestInterfaceB", 2, 3, serviceName, attributes); QByteArray serviceXml = createServiceXml(serviceName, descriptors); QServiceFilter filter; @@ -802,7 +802,7 @@ void tst_QServiceManager::loadInterface_descriptor_data() lib.setFileName(QCoreApplication::applicationDirPath() + "/plugins/tst_sfw_sampleserviceplugin"); QVERIFY(lib.load()); QVERIFY(lib.unload()); - priv->properties[QServiceInterfaceDescriptor::Location] = lib.fileName(); + priv->attributes[QServiceInterfaceDescriptor::Location] = lib.fileName(); QServiceInterfaceDescriptorPrivate::setPrivate(&descriptor, priv); QTest::newRow("tst_sfw_sampleserviceplugin") << descriptor @@ -811,7 +811,7 @@ void tst_QServiceManager::loadInterface_descriptor_data() lib.setFileName(QCoreApplication::applicationDirPath() + "/plugins/tst_sfw_testservice2plugin"); QVERIFY(lib.load()); QVERIFY(lib.unload()); - priv->properties[QServiceInterfaceDescriptor::Location] = lib.fileName(); + priv->attributes[QServiceInterfaceDescriptor::Location] = lib.fileName(); qDebug() << lib.fileName(); QServiceInterfaceDescriptorPrivate::setPrivate(&descriptor, priv); QTest::newRow("tst_sfw2_sampleserviceplugin") @@ -828,7 +828,7 @@ void tst_QServiceManager::loadInterface_testLoadedObjectAttributes() QServiceInterfaceDescriptor descriptor; QServiceInterfaceDescriptorPrivate *priv = new QServiceInterfaceDescriptorPrivate; priv->interfaceName = "com.nokia.qt.TestInterfaceA"; // needed by service plugin implementation - priv->properties[QServiceInterfaceDescriptor::Location] = lib.fileName(); + priv->attributes[QServiceInterfaceDescriptor::Location] = lib.fileName(); QServiceInterfaceDescriptorPrivate::setPrivate(&descriptor, priv); QServiceManager mgr; @@ -840,7 +840,7 @@ void tst_QServiceManager::loadInterface_testLoadedObjectAttributes() bool invokeOk = false; QString name; - // check properties + // check attributes QMetaProperty nameProperty = obj->metaObject()->property(obj->metaObject()->indexOfProperty("name")); QVERIFY(nameProperty.isValid()); QVERIFY(nameProperty.write(obj, "A service name")); @@ -897,7 +897,7 @@ void tst_QServiceManager::getInterface() QServiceInterfaceDescriptor descriptor; QServiceInterfaceDescriptorPrivate *priv = new QServiceInterfaceDescriptorPrivate; priv->interfaceName = "com.nokia.qt.TestInterfaceA"; // needed by service plugin implementation - priv->properties[QServiceInterfaceDescriptor::Location] = lib.fileName(); + priv->attributes[QServiceInterfaceDescriptor::Location] = lib.fileName(); QServiceInterfaceDescriptorPrivate::setPrivate(&descriptor, priv); //use manual descriptor -> avoid database involvement @@ -1113,15 +1113,15 @@ void tst_QServiceManager::setInterfaceDefault_strings() { QServiceManager mgr; QString interfaceName = "com.nokia.qt.serviceframework.tests.AnInterface"; - DescriptorProperties properties; + DescriptorAttributes attributes; QServiceInterfaceDescriptor descriptor; QByteArray xml; - properties[QServiceInterfaceDescriptor::Location] = VALID_PLUGIN_FILES[0]; - descriptor = createDescriptor(interfaceName, 1, 0, "ServiceA", properties); + attributes[QServiceInterfaceDescriptor::Location] = VALID_PLUGIN_FILES[0]; + descriptor = createDescriptor(interfaceName, 1, 0, "ServiceA", attributes); xml = createServiceXml("ServiceA", createInterfaceXml(QList<QServiceInterfaceDescriptor>() << descriptor), - properties[QServiceInterfaceDescriptor::Location].toString()); + attributes[QServiceInterfaceDescriptor::Location].toString()); QBuffer buffer(&xml); // fails if the specified interface hasn't been registered @@ -1133,11 +1133,11 @@ void tst_QServiceManager::setInterfaceDefault_strings() QCOMPARE(mgr.interfaceDefault(interfaceName), descriptor); // replace the default with another service - properties[QServiceInterfaceDescriptor::Location] = VALID_PLUGIN_FILES[1]; - descriptor = createDescriptor(interfaceName, 1, 0, "ServiceB", properties); + attributes[QServiceInterfaceDescriptor::Location] = VALID_PLUGIN_FILES[1]; + descriptor = createDescriptor(interfaceName, 1, 0, "ServiceB", attributes); xml = createServiceXml("ServiceB", createInterfaceXml(QList<QServiceInterfaceDescriptor>() << descriptor), - properties[QServiceInterfaceDescriptor::Location].toString()); + attributes[QServiceInterfaceDescriptor::Location].toString()); buffer.close(); buffer.setData(xml); QVERIFY2(mgr.addService(&buffer), PRINT_ERR(mgr)); @@ -1154,18 +1154,18 @@ void tst_QServiceManager::setInterfaceDefault_strings_multipleInterfaces() { QServiceManager mgr; QString interfaceName = "com.nokia.qt.serviceframework.tests.AnInterface"; - DescriptorProperties properties; + DescriptorAttributes attributes; QServiceInterfaceDescriptor descriptor; QByteArray xml; // if there are multiple interfaces, the default should be the latest version - properties[QServiceInterfaceDescriptor::Location] = VALID_PLUGIN_FILES[0]; + attributes[QServiceInterfaceDescriptor::Location] = VALID_PLUGIN_FILES[0]; QList<QServiceInterfaceDescriptor> descriptorList; - descriptorList << createDescriptor(interfaceName, 1, 0, "ServiceC", properties) - << createDescriptor(interfaceName, 1, 8, "ServiceC", properties) - << createDescriptor(interfaceName, 1, 3, "ServiceC", properties); + descriptorList << createDescriptor(interfaceName, 1, 0, "ServiceC", attributes) + << createDescriptor(interfaceName, 1, 8, "ServiceC", attributes) + << createDescriptor(interfaceName, 1, 3, "ServiceC", attributes); xml = createServiceXml("ServiceC", createInterfaceXml(descriptorList), - properties[QServiceInterfaceDescriptor::Location].toString()); + attributes[QServiceInterfaceDescriptor::Location].toString()); QBuffer buffer(&xml); QVERIFY2(mgr.addService(&buffer), PRINT_ERR(mgr)); QCOMPARE(mgr.setInterfaceDefault("ServiceC", interfaceName), true); @@ -1182,12 +1182,12 @@ void tst_QServiceManager::setInterfaceDefault_descriptor() QServiceInterfaceDescriptor desc; QString interfaceName = "com.nokia.qt.serviceframework.TestInterface"; - DescriptorProperties properties; - properties[QServiceInterfaceDescriptor::Location] = VALID_PLUGIN_FILES.first(); + DescriptorAttributes attributes; + attributes[QServiceInterfaceDescriptor::Location] = VALID_PLUGIN_FILES.first(); QCOMPARE(mgr.setInterfaceDefault(desc), false); - desc = createDescriptor(interfaceName, 1, 0, "SomeService", properties, + desc = createDescriptor(interfaceName, 1, 0, "SomeService", attributes, scope_add); // fails if the specified interface hasn't been registered diff --git a/tests/auto/servicedatabase/tst_servicedatabase.cpp b/tests/auto/servicedatabase/tst_servicedatabase.cpp index d6ac5f9cd6..0bef8dfe34 100644 --- a/tests/auto/servicedatabase/tst_servicedatabase.cpp +++ b/tests/auto/servicedatabase/tst_servicedatabase.cpp @@ -62,9 +62,9 @@ private slots: void getInterfaces(); void searchByInterfaceName(); void searchByInterfaceAndService(); - void searchByCustomProperty(); + void searchByCustomAttribute(); void searchByCapability(); - void properties(); + void attributes(); void getServiceNames(); void defaultExternalIfaceIDs(); void interfaceDefault(); @@ -595,7 +595,7 @@ void ServiceDatabaseUnitTest::searchByCapability() QCOMPARE(interfaces.count(), 14); //show all services which don't require any caps } -void ServiceDatabaseUnitTest::searchByCustomProperty() +void ServiceDatabaseUnitTest::searchByCustomAttribute() { QServiceFilter filter; QList<QServiceInterfaceDescriptor> interfaces; @@ -687,7 +687,7 @@ void ServiceDatabaseUnitTest::searchByCustomProperty() filter.removeCustomProperty("extension"); QCOMPARE(filter.customPropertyKeys().length(), 0); - //test clearing of custom properties + //test clearing of custom attributes filter.setCustomProperty("bot", "automatic"); filter.setCustomProperty("extension", "multidrive"); QCOMPARE(filter.customPropertyKeys().length(),2); @@ -744,7 +744,7 @@ void ServiceDatabaseUnitTest::searchByCustomProperty() QVERIFY(database.close()); } -void ServiceDatabaseUnitTest::properties() +void ServiceDatabaseUnitTest::attributes() { QVERIFY(database.open()); @@ -757,7 +757,7 @@ void ServiceDatabaseUnitTest::properties() QCOMPARE(database.lastError().code(), DBError::NoError); QCOMPARE(interfaces.count(), 1); QServiceInterfaceDescriptor interface = interfaces[0]; - QCOMPARE(interface.property(QServiceInterfaceDescriptor::Capabilities).toStringList(), QStringList()); + QCOMPARE(interface.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList(), QStringList()); //get empty list of capabilites from an interface registered without a //capabilities attribute @@ -766,7 +766,7 @@ void ServiceDatabaseUnitTest::properties() interfaces = database.getInterfaces(filter); QCOMPARE(interfaces.count(), 1); interface = interfaces[0]; - QCOMPARE(interface.property(QServiceInterfaceDescriptor::Capabilities).toStringList(), QStringList()); + QCOMPARE(interface.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList(), QStringList()); //get a list of capabilites from an interface with only 1 capability filter.setServiceName("Omni"); @@ -776,7 +776,7 @@ void ServiceDatabaseUnitTest::properties() interface = interfaces[0]; QStringList capabilities; capabilities << "SurroundingsDD"; - QCOMPARE(interface.property(QServiceInterfaceDescriptor::Capabilities).toStringList(), capabilities); + QCOMPARE(interface.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList(), capabilities); //get a list of capabilites from an interface with multiple capabilities filter.setServiceName("Omni"); @@ -786,13 +786,13 @@ void ServiceDatabaseUnitTest::properties() interface = interfaces[0]; capabilities.clear(); capabilities << "MultimediaDD" << "NetworkServices" << "ReadUserData" << "WriteUserData"; - QCOMPARE(interface.property(QServiceInterfaceDescriptor::Capabilities).toStringList(), capabilities); + QCOMPARE(interface.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList(), capabilities); //get a list of capabilities from a default service interface = database.interfaceDefault("com.cyberdyne.terminator"); capabilities.clear(); capabilities << "NetworkServices"; - QCOMPARE(interface.property(QServiceInterfaceDescriptor::Capabilities).toStringList(), capabilities); + QCOMPARE(interface.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList(), capabilities); // == Interface Description Property == //get the interface description off an interface registered without a description tag @@ -801,7 +801,7 @@ void ServiceDatabaseUnitTest::properties() interfaces = database.getInterfaces(filter); QCOMPARE(interfaces.count(), 1); interface = interfaces[0]; - QCOMPARE(interface.property(QServiceInterfaceDescriptor::InterfaceDescription).toString(), QString()); + QCOMPARE(interface.attribute(QServiceInterfaceDescriptor::InterfaceDescription).toString(), QString()); //get the interface description off an interface registered with an //empty description tag @@ -810,7 +810,7 @@ void ServiceDatabaseUnitTest::properties() interfaces = database.getInterfaces(filter); QCOMPARE(interfaces.count(), 1); interface = interfaces[0]; - QCOMPARE(interface.property(QServiceInterfaceDescriptor::InterfaceDescription).toString(), QString()); + QCOMPARE(interface.attribute(QServiceInterfaceDescriptor::InterfaceDescription).toString(), QString()); //get the interface description of an interface filter.setServiceName("Skynet"); @@ -818,12 +818,12 @@ void ServiceDatabaseUnitTest::properties() interfaces = database.getInterfaces(filter); QCOMPARE(interfaces.count(), 1); interface = interfaces[0]; - QCOMPARE(interface.property(QServiceInterfaceDescriptor::InterfaceDescription).toString(), + QCOMPARE(interface.attribute(QServiceInterfaceDescriptor::InterfaceDescription).toString(), QString("Remote communications interface for the T-800v1.5")); //get a description from a default service interface = database.interfaceDefault("com.omni.device.Accelerometer"); - QCOMPARE(interface.property(QServiceInterfaceDescriptor::InterfaceDescription).toString(), + QCOMPARE(interface.attribute(QServiceInterfaceDescriptor::InterfaceDescription).toString(), QString("Interface that provides accelerometer readings(omni)")); QVERIFY(database.close()); @@ -881,7 +881,7 @@ void ServiceDatabaseUnitTest::getServiceNames() bool ServiceDatabaseUnitTest::compareDescriptor(QServiceInterfaceDescriptor interface, QString interfaceName, QString serviceName, int majorVersion, int minorVersion) { - interface.d->properties[QServiceInterfaceDescriptor::Capabilities] = QStringList(); + interface.d->attributes[QServiceInterfaceDescriptor::Capabilities] = QStringList(); QHash<QString,QString> customs; return compareDescriptor(interface, interfaceName, serviceName, majorVersion, minorVersion, @@ -918,9 +918,9 @@ bool ServiceDatabaseUnitTest::compareDescriptor(QServiceInterfaceDescriptor inte return false; } - if (capabilities.count() != 0 || interface.property(QServiceInterfaceDescriptor::Capabilities).toStringList().count() != 0 ) { + if (capabilities.count() != 0 || interface.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList().count() != 0 ) { QStringList securityCapabilities; - securityCapabilities = interface.property(QServiceInterfaceDescriptor::Capabilities).toStringList(); + securityCapabilities = interface.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList(); if(securityCapabilities.count() != capabilities.count()) { qWarning() << "Capabilities count mismatch: expected =" << capabilities.count() @@ -940,41 +940,41 @@ bool ServiceDatabaseUnitTest::compareDescriptor(QServiceInterfaceDescriptor inte } if (!filePath.isEmpty()) { - if (interface.property(QServiceInterfaceDescriptor::Location).toString() != filePath) { + if (interface.attribute(QServiceInterfaceDescriptor::Location).toString() != filePath) { qWarning() << "File path mismatch: expected =" << filePath - << " actual =" << interface.property(QServiceInterfaceDescriptor::Location).toString(); + << " actual =" << interface.attribute(QServiceInterfaceDescriptor::Location).toString(); return false; } } if (!serviceDescription.isEmpty()) { - if (interface.property(QServiceInterfaceDescriptor::ServiceDescription).toString() != serviceDescription) { + if (interface.attribute(QServiceInterfaceDescriptor::ServiceDescription).toString() != serviceDescription) { qWarning() << "Service Description mismatch: expected =" << serviceDescription - << " actual=" << interface.property(QServiceInterfaceDescriptor::ServiceDescription).toString(); + << " actual=" << interface.attribute(QServiceInterfaceDescriptor::ServiceDescription).toString(); return false; } } if (!interfaceDescription.isEmpty()) { - if (interface.property(QServiceInterfaceDescriptor::InterfaceDescription).toString() != interfaceDescription) { + if (interface.attribute(QServiceInterfaceDescriptor::InterfaceDescription).toString() != interfaceDescription) { qWarning() << "Interface Description mismatch: expected =" << interfaceDescription - << " actual =" << interface.property(QServiceInterfaceDescriptor::InterfaceDescription).toString(); + << " actual =" << interface.attribute(QServiceInterfaceDescriptor::InterfaceDescription).toString(); return false; } } - if (interface.d->customProperties.size() != customProps.size()) { - qWarning() << "Number of Interface custom properties don't match. expected: " - <<customProps.size() << "actual: " << interface.d->customProperties.size(); + if (interface.d->customAttributes.size() != customProps.size()) { + qWarning() << "Number of Interface custom attributes don't match. expected: " + <<customProps.size() << "actual: " << interface.d->customAttributes.size(); ; - qWarning() << "expected:" << customProps << "actual:" << interface.d->customProperties; + qWarning() << "expected:" << customProps << "actual:" << interface.d->customAttributes; return false; } QHash<QString, QString>::const_iterator i; for (i = customProps.constBegin(); i!=customProps.constEnd(); i++) { - if (interface.customProperty(i.key()) != i.value()) { + if (interface.customAttribute(i.key()) != i.value()) { qWarning() << "Interface custom property mismatch: expected =" << i.key() <<"("<<i.value()<<")" - << " actual =" << i.key() << "(" << interface.customProperty(i.key()) << ")"; + << " actual =" << i.key() << "(" << interface.customAttribute(i.key()) << ")"; return false; } } @@ -1250,7 +1250,7 @@ void ServiceDatabaseUnitTest::unregister() interface = database.interfaceDefault("com.omni.service.Video"); QVERIFY(interface.serviceName() == "OMNI");//no other services implmement this interface - //confirm that interface and service properties exist for the service + //confirm that interface and service attributes exist for the service QStringList serviceIDs = getServiceIDs("omni"); foreach(const QString &serviceID, serviceIDs) QVERIFY(existsInServicePropertyTable(serviceID)); diff --git a/tests/auto/servicemetadata/tst_servicemetadata.cpp b/tests/auto/servicemetadata/tst_servicemetadata.cpp index 49c3295256..5dd6dd7ac3 100644 --- a/tests/auto/servicemetadata/tst_servicemetadata.cpp +++ b/tests/auto/servicemetadata/tst_servicemetadata.cpp @@ -108,57 +108,57 @@ void ServiceMetadataTest::parseValidServiceXML() QCOMPARE(aInterface.interfaceName(),QString("com.nokia.qt.tests.IDownloader")); QCOMPARE(aInterface.majorVersion(), 1); QCOMPARE(aInterface.minorVersion(), 4); - QVERIFY(aInterface.property(QServiceInterfaceDescriptor::Capabilities).toStringList().count() == 0); - QCOMPARE(aInterface.property(QServiceInterfaceDescriptor::InterfaceDescription).toString(), QString("Interface that provides download support")); + QVERIFY(aInterface.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList().count() == 0); + QCOMPARE(aInterface.attribute(QServiceInterfaceDescriptor::InterfaceDescription).toString(), QString("Interface that provides download support")); aInterface = allInterfaces.at(1); QCOMPARE(aInterface.interfaceName(),QString("com.nokia.qt.tests.ILocation")); QCOMPARE(aInterface.majorVersion(), 1); QCOMPARE(aInterface.minorVersion(), 4); - QVERIFY(aInterface.property(QServiceInterfaceDescriptor::Capabilities).toStringList().count() == 0); - QCOMPARE(aInterface.property(QServiceInterfaceDescriptor::InterfaceDescription).toString(), QString("Interface that provides location support")); + QVERIFY(aInterface.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList().count() == 0); + QCOMPARE(aInterface.attribute(QServiceInterfaceDescriptor::InterfaceDescription).toString(), QString("Interface that provides location support")); aInterface = allInterfaces.at(2); QCOMPARE(aInterface.interfaceName(),QString("com.nokia.qt.tests.ISysInfo")); QCOMPARE(aInterface.majorVersion(), 2); QCOMPARE(aInterface.minorVersion(), 3); - QVERIFY(aInterface.property(QServiceInterfaceDescriptor::Capabilities).toStringList().count() == 1); - QVERIFY(aInterface.property(QServiceInterfaceDescriptor::Capabilities).toStringList().contains("ReadUserData")); - QCOMPARE(aInterface.property(QServiceInterfaceDescriptor::InterfaceDescription).toString(), QString("Interface that provides system information support")); + QVERIFY(aInterface.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList().count() == 1); + QVERIFY(aInterface.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList().contains("ReadUserData")); + QCOMPARE(aInterface.attribute(QServiceInterfaceDescriptor::InterfaceDescription).toString(), QString("Interface that provides system information support")); aInterface = allInterfaces.at(3); QCOMPARE(aInterface.interfaceName(),QString("com.nokia.qt.tests.ISendMessage")); QCOMPARE(aInterface.majorVersion(), 3); QCOMPARE(aInterface.minorVersion(), 0); - QStringList capabilities = aInterface.property(QServiceInterfaceDescriptor::Capabilities).toStringList(); + QStringList capabilities = aInterface.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList(); QVERIFY(capabilities.count() == 2); QVERIFY(capabilities.contains("ReadUserData")); QVERIFY(capabilities.contains("WriteUserData")); - QCOMPARE(aInterface.property(QServiceInterfaceDescriptor::InterfaceDescription).toString(), QString("Interface that provides message sending support")); + QCOMPARE(aInterface.attribute(QServiceInterfaceDescriptor::InterfaceDescription).toString(), QString("Interface that provides message sending support")); aInterface = allInterfaces.at(4); QCOMPARE(aInterface.interfaceName(), QString("com.nokia.qt.tests.IReceiveMessage")); QCOMPARE(aInterface.majorVersion(), 1); QCOMPARE(aInterface.minorVersion(), 1); - capabilities = aInterface.property(QServiceInterfaceDescriptor::Capabilities).toStringList(); + capabilities = aInterface.attribute(QServiceInterfaceDescriptor::Capabilities).toStringList(); QVERIFY(capabilities.count() == 3); QVERIFY(capabilities.contains("ReadUserData")); QVERIFY(capabilities.contains("WriteUserData")); QVERIFY(capabilities.contains("ExecUserData")); - QCOMPARE(aInterface.property(QServiceInterfaceDescriptor::InterfaceDescription).toString(), QString("Interface that provides message receiving support")); - QCOMPARE(aInterface.customProperty("key1"), QString("value1")); - QCOMPARE(aInterface.customProperty("key2"), QString("value2")); - QCOMPARE(aInterface.customProperty("key3"), QString("")); - QCOMPARE(aInterface.customProperty("key4"), QString()); + QCOMPARE(aInterface.attribute(QServiceInterfaceDescriptor::InterfaceDescription).toString(), QString("Interface that provides message receiving support")); + QCOMPARE(aInterface.customAttribute("key1"), QString("value1")); + QCOMPARE(aInterface.customAttribute("key2"), QString("value2")); + QCOMPARE(aInterface.customAttribute("key3"), QString("")); + QCOMPARE(aInterface.customAttribute("key4"), QString()); ServiceMetaData parser1(dir.absoluteFilePath("WrongOrder.xml")); QCOMPARE(parser1.extractMetadata(),true); QList<QServiceInterfaceDescriptor> allInterfacesWrongOrder = parser1.parseResults().interfaces; foreach(const QServiceInterfaceDescriptor d, allInterfacesWrongOrder) { QCOMPARE(d.serviceName(), QString("ovi")); - QCOMPARE(d.property(QServiceInterfaceDescriptor::Location).toString(), QString("C:/Nokia/ovi.dll")); - QCOMPARE(d.property(QServiceInterfaceDescriptor::ServiceDescription).toString(), QString("Ovi Services")); + QCOMPARE(d.attribute(QServiceInterfaceDescriptor::Location).toString(), QString("C:/Nokia/ovi.dll")); + QCOMPARE(d.attribute(QServiceInterfaceDescriptor::ServiceDescription).toString(), QString("Ovi Services")); } } @@ -325,7 +325,7 @@ void ServiceMetadataTest::latestInterfaceVersion() QServiceInterfaceDescriptor interface = parser.latestInterfaceVersion("com.nokia.service.contacts"); QCOMPARE(interface.majorVersion(), major); QCOMPARE(interface.minorVersion(), minor); - QCOMPARE(interface.property(QServiceInterfaceDescriptor::InterfaceDescription).toString(), + QCOMPARE(interface.attribute(QServiceInterfaceDescriptor::InterfaceDescription).toString(), QString("Contacts management service")); //make sure we're getting the right interface } diff --git a/tools/servicefw/servicefw.cpp b/tools/servicefw/servicefw.cpp index 89a2df30f8..5cab5ad34e 100644 --- a/tools/servicefw/servicefw.cpp +++ b/tools/servicefw/servicefw.cpp @@ -289,15 +289,15 @@ void CommandProcessor::showServiceInfo(const QString &service) return; } - QString description = descriptors[0].property( + QString description = descriptors[0].attribute( QServiceInterfaceDescriptor::ServiceDescription).toString(); - QStringList capabilities = descriptors[0].property( + QStringList capabilities = descriptors[0].attribute( QServiceInterfaceDescriptor::Capabilities).toStringList(); *stdoutStream << service << ":\n"; if (!description.isEmpty()) *stdoutStream << '\t' << description << '\n'; - *stdoutStream << "\tLibrary: " << descriptors[0].property( + *stdoutStream << "\tLibrary: " << descriptors[0].attribute( QServiceInterfaceDescriptor::Location).toString() << '\n' << "\tCapabilities: " << (capabilities.isEmpty() ? "" : capabilities.join(", ")) << '\n' << "\tImplements:\n"; diff --git a/tools/servicexmlgen/interfacewidget.cpp b/tools/servicexmlgen/interfacewidget.cpp index 9598cc03fe..f3bff0c373 100644 --- a/tools/servicexmlgen/interfacewidget.cpp +++ b/tools/servicexmlgen/interfacewidget.cpp @@ -354,7 +354,7 @@ InterfaceWidget::InterfaceWidget(QWidget *parent) form->addRow(tr("* Version"), versions); form->addRow(tr("Description"), m_desc); form->addRow(tr("Capabilities"), m_capWidget); - form->addRow(tr("Custom properties"), m_customPropWidget); + form->addRow(tr("Custom attributes"), m_customPropWidget); setLayout(form); connect(m_name, SIGNAL(textEdited(QString)), SLOT(changedNameOrVersion())); @@ -380,13 +380,13 @@ void InterfaceWidget::load(const QServiceInterfaceDescriptor &info) m_name->setText(p->interfaceName); m_verMajor->setValue(p->major); m_verMinor->setValue(p->minor); - if (p->properties.contains(QServiceInterfaceDescriptor::InterfaceDescription)) - m_desc->setText(p->properties[QServiceInterfaceDescriptor::InterfaceDescription].toString()); + if (p->attributes.contains(QServiceInterfaceDescriptor::InterfaceDescription)) + m_desc->setText(p->attributes[QServiceInterfaceDescriptor::InterfaceDescription].toString()); - if (p->properties.contains(QServiceInterfaceDescriptor::Capabilities)) - m_capWidget->setCapabilities(p->properties[QServiceInterfaceDescriptor::Capabilities].toStringList()); - if (!p->customProperties.isEmpty()) - m_customPropWidget->setProperties(p->customProperties); + if (p->attributes.contains(QServiceInterfaceDescriptor::Capabilities)) + m_capWidget->setCapabilities(p->attributes[QServiceInterfaceDescriptor::Capabilities].toStringList()); + if (!p->customAttributes.isEmpty()) + m_customPropWidget->setProperties(p->customAttributes); } void InterfaceWidget::validate(ErrorCollector *errors) |