Commit 0ec76a92 authored by blam's avatar blam

[qtcontacts-sqlite] Allow empty sub-type for urls and anniversaries. Contributes to JB#44713

Make it possible to specify a url/anniversary without a sub-type.
parent 7b785aa5
......@@ -240,7 +240,7 @@ static void setValues(QContactAnniversary *detail, QSqlQuery *query, const int o
setValue(detail, T::FieldOriginalDate, dateValue(query->value(offset + 0)));
setValue(detail, T::FieldCalendarId , query->value(offset + 1));
setValue(detail, T::FieldSubType , QVariant::fromValue<int>(query->value(offset + 2).toString().toInt()));
setValue(detail, T::FieldSubType , QVariant::fromValue<QString>(query->value(offset + 2).toString()));
setValue(detail, T::FieldEvent , query->value(offset + 3));
}
......@@ -532,7 +532,7 @@ static void setValues(QContactUrl *detail, QSqlQuery *query, const int offset)
typedef QContactUrl T;
setValue(detail, T::FieldUrl , urlValue(query->value(offset + 0)));
setValue(detail, T::FieldSubType, QVariant::fromValue<int>(query->value(offset + 1).toString().toInt()));
setValue(detail, T::FieldSubType, QVariant::fromValue<QString>(query->value(offset + 1).toString()));
}
static const FieldInfo originMetadataFields[] =
......
......@@ -1659,7 +1659,7 @@ ContactsDatabase::Query bindDetail(ContactsDatabase &db, quint32 contactId, quin
query.addBindValue(contactId);
query.addBindValue(detailValue(detail, T::FieldOriginalDate));
query.addBindValue(detailValue(detail, T::FieldCalendarId));
query.addBindValue(QString::number(detail.subType()));
query.addBindValue(detail.hasValue(T::FieldSubType) ? QString::number(detail.subType()) : QString());
query.addBindValue(detail.value<QString>(T::FieldEvent).trimmed());
return query;
}
......@@ -2172,7 +2172,7 @@ ContactsDatabase::Query bindDetail(ContactsDatabase &db, quint32 contactId, quin
query.addBindValue(detailId);
query.addBindValue(contactId);
query.addBindValue(detail.value<QString>(T::FieldUrl).trimmed());
query.addBindValue(QString::number(detail.subType()));
query.addBindValue(detail.hasValue(T::FieldSubType) ? QString::number(detail.subType()) : QString());
return query;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment