View File versit_urls_changed_to_uris.patch for package qt-mobility (Project devel:performance)
commit 5dcb6b8c8d77602ef967161795948075c3a96a3c
Author: Tommi Anttila <tommi.4.anttila@nokia.com>
Date: Mon May 23 13:31:13 2011 +0300
URLs changed to URIs for LOGO/PHOTO values
Versit contact importer fixed to follow RFC-2426 - URLs changed to URIs for LOGO/PHOTO values. Related tests fixed.
Change-Id: I38ee0813eb4561f91b63b6979c3039d4bced70bf
Task-number: MOBILITY-1590
Reviewed-by: Michael Goddard
diff --git a/src/versit/qversitcontactexporter_p.cpp b/src/versit/qversitcontactexporter_p.cpp
index de9612d..150ef22 100644
--- a/src/versit/qversitcontactexporter_p.cpp
+++ b/src/versit/qversitcontactexporter_p.cpp
@@ -815,7 +815,7 @@ bool QVersitContactExporterPrivate::encodeContentFromFile(const QString& resourc
if (isValidRemoteUrl( resourcePath )) {
encodeContent = true;
value.setValue(resourcePath);
- property.insertParameter(QLatin1String("VALUE"), QLatin1String("URL"));
+ property.insertParameter(QLatin1String("VALUE"), QLatin1String("uri"));
} else if (mResourceHandler
&& mResourceHandler->loadResource(resourcePath, &imageData, &mimeType)) {
value.setValue(imageData);
diff --git a/src/versit/qversitcontactimporter_p.cpp b/src/versit/qversitcontactimporter_p.cpp
index 9f6c04f..4e9e511 100644
--- a/src/versit/qversitcontactimporter_p.cpp
+++ b/src/versit/qversitcontactimporter_p.cpp
@@ -852,10 +852,11 @@ bool QVersitContactImporterPrivate::saveDataFromProperty(const QVersitProperty &
QByteArray *data) const
{
bool found = false;
- const QString valueParam = property.parameters().value(QLatin1String("VALUE"));
+ const QString valueParam = property.parameters().value(QLatin1String("VALUE")).toUpper();
QVariant variant(property.variantValue());
if (variant.type() == QVariant::String
- || valueParam == QLatin1String("URL")) {
+ || valueParam == QLatin1String("URL")
+ || valueParam == QLatin1String("URI")) {
*location = property.value();
found |= !location->isEmpty();
} else if (variant.type() == QVariant::ByteArray) {
diff --git a/tests/auto/qversitcontactexporter/tst_qversitcontactexporter.cpp b/tests/auto/qversitcontactexporter/tst_qversitcontactexporter.cpp
index c7bf3b3..14e5c68 100644
--- a/tests/auto/qversitcontactexporter/tst_qversitcontactexporter.cpp
+++ b/tests/auto/qversitcontactexporter/tst_qversitcontactexporter.cpp
@@ -755,7 +755,7 @@ void tst_QVersitContactExporter::testEncodeOrganization()
QCOMPARE(property.parameters().count(), 1);
QVERIFY(property.parameters().contains(
- QLatin1String("VALUE"), QLatin1String("URL")));
+ QLatin1String("VALUE"), QLatin1String("uri")));
//Check property value
QCOMPARE(property.value(), url);
diff --git a/tests/auto/qversitcontactimporter/tst_qversitcontactimporter.cpp b/tests/auto/qversitcontactimporter/tst_qversitcontactimporter.cpp
index e227587..bea2079 100644
--- a/tests/auto/qversitcontactimporter/tst_qversitcontactimporter.cpp
+++ b/tests/auto/qversitcontactimporter/tst_qversitcontactimporter.cpp
@@ -166,7 +166,8 @@ void tst_QVersitContactImporter::init()
void tst_QVersitContactImporter::cleanup()
{
QVERIFY(mImporter->propertyHandler() == mPropertyHandler);
- mImporter->setPropertyHandler(static_cast<QVersitContactImporterPropertyHandlerV2*>(0));
+ MyQVersitContactImporterPropertyHandler* nullPtr = NULL;
+ mImporter->setPropertyHandler(nullPtr);
delete mPropertyHandler;
QVERIFY(mImporter->resourceHandler() == mResourceHandler);
mImporter->setResourceHandler(0);