Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Update to latest qtpim #1
Open
Commits
Jump to file or symbol
Failed to load files and symbols.
Update to latest qtpim
The patch delta is greatly reduced, and we get the new collections API.
- Loading branch information...
commit c41708bcde351ebbdd7d3e4fedbc4d48c399d24b
mardy
committed
Nov 10, 2017
Large diffs are not rendered by default.
Oops, something went wrong.
| @@ -1,86 +0,0 @@ | ||
| -From c444286c2a9aee6f98ec4219378afb90db03c709 Mon Sep 17 00:00:00 2001 | ||
| -From: Renato Araujo Oliveira Filho <renato.filho@canonical.com> | ||
| -Date: Thu, 26 Mar 2015 11:49:19 -0300 | ||
| -Subject: [PATCH] Added 'detailTypesHint' property to | ||
| - QDeclarativeOrganizerItemFetchHint. | ||
| - | ||
| -Allow filter OrganizerItem details fetched on a qml model query. | ||
| - | ||
| -Change-Id: I169cf511cd3073dbc0162e6228b900efb1e98250 | ||
| ---- | ||
| - .../qdeclarativeorganizeritemfetchhint.cpp | 29 ++++++++++++++++++++++ | ||
| - .../qdeclarativeorganizeritemfetchhint_p.h | 4 +++ | ||
| - 2 files changed, 33 insertions(+) | ||
| - | ||
| -diff --git a/src/imports/organizer/qdeclarativeorganizeritemfetchhint.cpp b/src/imports/organizer/qdeclarativeorganizeritemfetchhint.cpp | ||
| -index 0de4f82..ce01d5a 100644 | ||
| ---- a/src/imports/organizer/qdeclarativeorganizeritemfetchhint.cpp | ||
| -+++ b/src/imports/organizer/qdeclarativeorganizeritemfetchhint.cpp | ||
| -@@ -41,6 +41,8 @@ | ||
| - | ||
| - #include "qdeclarativeorganizeritemfetchhint_p.h" | ||
| - | ||
| -+#include <QtCore/qset.h> | ||
| -+ | ||
| - QTORGANIZER_USE_NAMESPACE | ||
| - | ||
| - QT_BEGIN_NAMESPACE | ||
| -@@ -100,6 +102,33 @@ void QDeclarativeOrganizerItemFetchHint::setOptimizationHints(OptimizationHints | ||
| - } | ||
| - | ||
| - /*! | ||
| -+ \qmlproperty list<int> FetchHint::detailTypesHint | ||
| -+ | ||
| -+ This property holds a list of organizer item detail types | ||
| -+ the manager should (at a minimum) retrieve when fetching contacts. | ||
| -+ */ | ||
| -+QList<int> QDeclarativeOrganizerItemFetchHint::detailTypesHint() const | ||
| -+{ | ||
| -+ QList<int> savedList; | ||
| -+ foreach (const QOrganizerItemDetail::DetailType &detailTypeHint, d.detailTypesHint()) | ||
| -+ savedList << static_cast<int>(detailTypeHint); | ||
| -+ | ||
| -+ return savedList; | ||
| -+} | ||
| -+ | ||
| -+void QDeclarativeOrganizerItemFetchHint::setDetailTypesHint(const QList<int> &detailTypes) | ||
| -+{ | ||
| -+ if (detailTypes.toSet() != detailTypesHint().toSet()) { | ||
| -+ QList<QOrganizerItemDetail::DetailType> convertedDetailTypes; | ||
| -+ foreach (const int detailType, detailTypes) | ||
| -+ convertedDetailTypes << static_cast<QOrganizerItemDetail::DetailType>(detailType); | ||
| -+ | ||
| -+ d.setDetailTypesHint(convertedDetailTypes); | ||
| -+ emit fetchHintChanged(); | ||
| -+ } | ||
| -+} | ||
| -+ | ||
| -+/*! | ||
| - \internal | ||
| - */ | ||
| - QOrganizerItemFetchHint QDeclarativeOrganizerItemFetchHint::fetchHint() const | ||
| -diff --git a/src/imports/organizer/qdeclarativeorganizeritemfetchhint_p.h b/src/imports/organizer/qdeclarativeorganizeritemfetchhint_p.h | ||
| -index 42d44cc..fa4d64e 100644 | ||
| ---- a/src/imports/organizer/qdeclarativeorganizeritemfetchhint_p.h | ||
| -+++ b/src/imports/organizer/qdeclarativeorganizeritemfetchhint_p.h | ||
| -@@ -54,6 +54,7 @@ class QDeclarativeOrganizerItemFetchHint : public QObject | ||
| - { | ||
| - Q_OBJECT | ||
| - | ||
| -+ Q_PROPERTY(QList<int> detailTypesHint READ detailTypesHint WRITE setDetailTypesHint NOTIFY fetchHintChanged ) | ||
| - Q_PROPERTY(OptimizationHints optimizationHints READ optimizationHints WRITE setOptimizationHints NOTIFY fetchHintChanged) | ||
| - | ||
| - Q_ENUMS(OptimizationHint) | ||
| -@@ -72,6 +73,9 @@ public: | ||
| - OptimizationHints optimizationHints() const; | ||
| - void setOptimizationHints(OptimizationHints hints); | ||
| - | ||
| -+ QList<int> detailTypesHint() const; | ||
| -+ void setDetailTypesHint(const QList<int> &detailTypes); | ||
| -+ | ||
| - QOrganizerItemFetchHint fetchHint() const; | ||
| - void setFetchHint(const QOrganizerItemFetchHint &fetchHint); | ||
| - | ||
| --- | ||
| -2.1.4 | ||
| - |
| @@ -1,225 +0,0 @@ | ||
| -From 4c0b26cf7fa81c04aba5a1874a8f700a3acbe2ce Mon Sep 17 00:00:00 2001 | ||
| -From: Renato Araujo Oliveira Filho <renato.filho@canonical.com> | ||
| -Date: Fri, 22 Aug 2014 18:50:30 -0300 | ||
| -Subject: [PATCH] Added list of imported ids as argument for importItems. | ||
| - | ||
| -The ids can be used to know which items was successful imported/inserted into the model. | ||
| - | ||
| -Change-Id: I3fd66377d53844dfd8ad377304893c7f3413ad1a | ||
| -Reviewed-by: Alex Blasche <alexander.blasche@digia.com> | ||
| ---- | ||
| - src/imports/contacts/qdeclarativecontactmodel.cpp | 40 ++++++++++++++++++++-- | ||
| - src/imports/contacts/qdeclarativecontactmodel_p.h | 2 +- | ||
| - .../organizer/qdeclarativeorganizermodel.cpp | 28 ++++++++++----- | ||
| - .../organizer/qdeclarativeorganizermodel_p.h | 2 +- | ||
| - .../tst_contacts_export_import_signaling_e2e.qml | 4 +++ | ||
| - .../tst_organizer_versit_export_import_e2e.qml | 4 +++ | ||
| - 6 files changed, 67 insertions(+), 13 deletions(-) | ||
| - | ||
| -diff --git a/src/imports/contacts/qdeclarativecontactmodel.cpp b/src/imports/contacts/qdeclarativecontactmodel.cpp | ||
| -index cefd716..43a2cea 100644 | ||
| ---- a/src/imports/contacts/qdeclarativecontactmodel.cpp | ||
| -+++ b/src/imports/contacts/qdeclarativecontactmodel.cpp | ||
| -@@ -306,6 +306,35 @@ static QString urlToLocalFileName(const QUrl& url) | ||
| - } | ||
| - | ||
| - /*! | ||
| -+ \qmlproperty enumeration ContactModel::ImportError | ||
| -+ | ||
| -+ Defines the errors cases for \l ContactModel::importContacts() -function. | ||
| -+ | ||
| -+ \list | ||
| -+ \li ContactModel::ImportNoError Completed successfully, no error. | ||
| -+ \li ContactModel::ImportUnspecifiedError Unspecified error. | ||
| -+ \li ContactModel::ImportIOError Input/output error. | ||
| -+ \li ContactModel::ImportOutOfMemoryError Out of memory error. | ||
| -+ \li ContactModel::ImportNotReadyError Not ready for importing. Only one import operation can be active at a time. | ||
| -+ \li ContactModel::ImportParseError Error during parsing. | ||
| -+ \endlist | ||
| -+*/ | ||
| -+ | ||
| -+/*! | ||
| -+ \qmlsignal ContactModel::onImportCompleted(ImportError error, URL url, list<string> ids) | ||
| -+ | ||
| -+ This signal is emitted, when \l ContactModel::importContacts() completes. The success of operation | ||
| -+ can be seen on \a error which is defined in \l ContactModel::ImportError. \a url indicates the | ||
| -+ file, which was imported. \a ids contains the imported contacts ids. | ||
| -+ | ||
| -+ If the operation was successful, contacts are now imported to backend. If \l ContactModel::autoUpdate | ||
| -+ is enabled, \l ContactModel::modelChanged will be emitted when imported contacts are also visible on | ||
| -+ \l ContactModel's data model. | ||
| -+ | ||
| -+ \sa ContactModel::importContacts | ||
| -+ */ | ||
| -+ | ||
| -+/*! | ||
| - \qmlmethod void ContactModel::importContacts(url url, list<string> profiles) | ||
| - | ||
| - Import contacts from a vcard by the given \a url and optional \a profiles. | ||
| -@@ -344,7 +373,7 @@ void QDeclarativeContactModel::importContacts(const QUrl& url, const QStringList | ||
| - importError = ImportIOError; | ||
| - } | ||
| - } | ||
| -- emit importCompleted(importError, url); | ||
| -+ emit importCompleted(importError, url, QStringList()); | ||
| - } | ||
| - | ||
| - /*! | ||
| -@@ -551,15 +580,22 @@ void QDeclarativeContactModel::startImport(QVersitReader::State state) | ||
| - delete d->m_reader.device(); | ||
| - d->m_reader.setDevice(0); | ||
| - | ||
| -+ QStringList ids; | ||
| -+ | ||
| - if (d->m_manager) { | ||
| - if (!d->m_manager->saveContacts(&contacts)) { | ||
| - if (d->m_error != d->m_manager->error()) { | ||
| - d->m_error = d->m_manager->error(); | ||
| - emit errorChanged(); | ||
| - } | ||
| -+ } else { | ||
| -+ foreach (const QContact &c, contacts) { | ||
| -+ ids << c.id().toString(); | ||
| -+ } | ||
| - } | ||
| - } | ||
| -- emit importCompleted(QDeclarativeContactModel::ImportError(d->m_reader.error()), d->m_lastImportUrl); | ||
| -+ | ||
| -+ emit importCompleted(QDeclarativeContactModel::ImportError(d->m_reader.error()), d->m_lastImportUrl, ids); | ||
| - } | ||
| - } | ||
| - | ||
| -diff --git a/src/imports/contacts/qdeclarativecontactmodel_p.h b/src/imports/contacts/qdeclarativecontactmodel_p.h | ||
| -index 89ef912..a3acdf8 100644 | ||
| ---- a/src/imports/contacts/qdeclarativecontactmodel_p.h | ||
| -+++ b/src/imports/contacts/qdeclarativecontactmodel_p.h | ||
| -@@ -156,7 +156,7 @@ signals: | ||
| - void sortOrdersChanged(); | ||
| - void autoUpdateChanged(); | ||
| - void exportCompleted(ExportError error, QUrl url); | ||
| -- void importCompleted(ImportError error, QUrl url); | ||
| -+ void importCompleted(ImportError error, QUrl url, const QStringList &ids); | ||
| - void contactsFetched(int requestId, const QVariantList &fetchedContacts); | ||
| - | ||
| - public slots: | ||
| -diff --git a/src/imports/organizer/qdeclarativeorganizermodel.cpp b/src/imports/organizer/qdeclarativeorganizermodel.cpp | ||
| -index 8df7bf7..83c5b50 100644 | ||
| ---- a/src/imports/organizer/qdeclarativeorganizermodel.cpp | ||
| -+++ b/src/imports/organizer/qdeclarativeorganizermodel.cpp | ||
| -@@ -421,7 +421,7 @@ void QDeclarativeOrganizerModel::setEndPeriod(const QDateTime& end) | ||
| - Defines the errors cases for \l OrganizerModel::importItems() -function. | ||
| - | ||
| - \list | ||
| -- \li OrganizerModel::ImportNoError Completed succesfully, no error. | ||
| -+ \li OrganizerModel::ImportNoError Completed successfully, no error. | ||
| - \li OrganizerModel::ImportUnspecifiedError Unspecified error. | ||
| - \li OrganizerModel::ImportIOError Input/output error. | ||
| - \li OrganizerModel::ImportOutOfMemoryError Out of memory error. | ||
| -@@ -431,15 +431,17 @@ void QDeclarativeOrganizerModel::setEndPeriod(const QDateTime& end) | ||
| - */ | ||
| - | ||
| - /*! | ||
| -- \qmlsignal OrganizerModel::onImportCompleted() | ||
| -+ \qmlsignal OrganizerModel::onImportCompleted(ImportError error, URL url, list<string> ids) | ||
| - | ||
| - This signal is emitted, when \l OrganizerModel::importItems() completes. The success of operation | ||
| - can be seen on \a error which is defined in \l OrganizerModel::ImportError. \a url indicates the | ||
| -- file, which was imported. | ||
| -+ file, which was imported. \a ids contains the imported items ids. | ||
| - | ||
| -- If the operation was succesful, items are now imported to backend. If \l OrganizerModel::autoUpdate | ||
| -+ If the operation was successful, items are now imported to backend. If \l OrganizerModel::autoUpdate | ||
| - is enabled, \l OrganizerModel::modelChanged will be emitted when imported items are also visible on | ||
| - \l OrganizerModel's data model. | ||
| -+ | ||
| -+ \sa OrganizerModel::importItems | ||
| - */ | ||
| - | ||
| - /*! | ||
| -@@ -479,7 +481,7 @@ void QDeclarativeOrganizerModel::importItems(const QUrl& url, const QStringList | ||
| - } | ||
| - | ||
| - // If cannot startReading because already running then report the import error now | ||
| -- emit importCompleted(importError, url); | ||
| -+ emit importCompleted(importError, url, QStringList()); | ||
| - } | ||
| - | ||
| - /*! | ||
| -@@ -730,6 +732,8 @@ void QDeclarativeOrganizerModel::startImport(QVersitReader::State state) | ||
| - { | ||
| - Q_D(QDeclarativeOrganizerModel); | ||
| - if (state == QVersitReader::FinishedState || state == QVersitReader::CanceledState) { | ||
| -+ QStringList ids; | ||
| -+ | ||
| - if (!d->m_reader->results().isEmpty()) { | ||
| - QVersitOrganizerImporter importer; | ||
| - importer.importDocument(d->m_reader->results().at(0)); | ||
| -@@ -737,12 +741,18 @@ void QDeclarativeOrganizerModel::startImport(QVersitReader::State state) | ||
| - delete d->m_reader->device(); | ||
| - d->m_reader->setDevice(0); | ||
| - | ||
| -- if (d->m_manager && !d->m_manager->saveItems(&items) && d->m_error != d->m_manager->error()) { | ||
| -- d->m_error = d->m_manager->error(); | ||
| -- emit errorChanged(); | ||
| -+ if (d->m_manager && !d->m_manager->saveItems(&items)) { | ||
| -+ if (d->m_error != d->m_manager->error()) { | ||
| -+ d->m_error = d->m_manager->error(); | ||
| -+ emit errorChanged(); | ||
| -+ } | ||
| -+ } else { | ||
| -+ foreach (const QOrganizerItem i, items) { | ||
| -+ ids << i.id().toString(); | ||
| -+ } | ||
| - } | ||
| - } | ||
| -- emit importCompleted(QDeclarativeOrganizerModel::ImportError(d->m_reader->error()), d->m_lastImportUrl); | ||
| -+ emit importCompleted(QDeclarativeOrganizerModel::ImportError(d->m_reader->error()), d->m_lastImportUrl, ids); | ||
| - } | ||
| - } | ||
| - | ||
| -diff --git a/src/imports/organizer/qdeclarativeorganizermodel_p.h b/src/imports/organizer/qdeclarativeorganizermodel_p.h | ||
| -index ee8407e..e240dd4 100644 | ||
| ---- a/src/imports/organizer/qdeclarativeorganizermodel_p.h | ||
| -+++ b/src/imports/organizer/qdeclarativeorganizermodel_p.h | ||
| -@@ -187,7 +187,7 @@ signals: | ||
| - void collectionsChanged(); | ||
| - void itemsFetched(int requestId, const QVariantList &fetchedItems); | ||
| - void exportCompleted(ExportError error, QUrl url); | ||
| -- void importCompleted(ImportError error, QUrl url); | ||
| -+ void importCompleted(ImportError error, QUrl url, const QStringList &ids); | ||
| - | ||
| - public slots: | ||
| - void update(); | ||
| -diff --git a/tests/auto/contacts/qmlcontacts/testcases/tst_contacts_export_import_signaling_e2e.qml b/tests/auto/contacts/qmlcontacts/testcases/tst_contacts_export_import_signaling_e2e.qml | ||
| -index 5e711ff..ff35799 100644 | ||
| ---- a/tests/auto/contacts/qmlcontacts/testcases/tst_contacts_export_import_signaling_e2e.qml | ||
| -+++ b/tests/auto/contacts/qmlcontacts/testcases/tst_contacts_export_import_signaling_e2e.qml | ||
| -@@ -172,6 +172,10 @@ ContactsSavingTestCase { | ||
| - waitForTargetSignal(signalSpy2); | ||
| - compare(importErrorCode, ContactModel.ImportNoError, 'signal finished state error'); | ||
| - compare(importFileName, vcardFilePath, 'signal finished state filename'); | ||
| -+ | ||
| -+ // Check if importComplete contains the correct contactId | ||
| -+ var importedIds = signalSpy2.signalArguments[0][2] | ||
| -+ compare(importedIds[0], model.contacts[model.contacts.length - 1].contactId) | ||
| - } | ||
| - | ||
| - | ||
| -diff --git a/tests/auto/organizer/qmlorganizer/testcases/tst_organizer_versit_export_import_e2e.qml b/tests/auto/organizer/qmlorganizer/testcases/tst_organizer_versit_export_import_e2e.qml | ||
| -index d182cc6..4ecfb6c 100644 | ||
| ---- a/tests/auto/organizer/qmlorganizer/testcases/tst_organizer_versit_export_import_e2e.qml | ||
| -+++ b/tests/auto/organizer/qmlorganizer/testcases/tst_organizer_versit_export_import_e2e.qml | ||
| -@@ -190,6 +190,10 @@ TestCase { | ||
| - "imported description different from the exported description.") | ||
| - compare(importedEvent.displayLabel, "Event 1", | ||
| - "imported event label different to exported label.") | ||
| -+ | ||
| -+ // Check if importComplete contains the correct itemId | ||
| -+ var importedIds = importModelChangedSpy.signalArguments[0][2] | ||
| -+ compare(importedIds[0], importedEvent.itemId) | ||
| - } | ||
| - | ||
| - function test_overlappingExportEmitsSignalWithError_data() { | ||
| --- | ||
| -2.6.2 | ||
| - |
| @@ -1,17 +0,0 @@ | ||
| -Description: Fix declarative contact model crash while reload contacts | ||
| - While moving contacts check the list size to see if is a valid position. | ||
| - | ||
| ---- qtpim-opensource-src-5.0~git20140515~29475884.orig/src/imports/contacts/qdeclarativecontactmodel.cpp | ||
| -+++ qtpim-opensource-src-5.0~git20140515~29475884/src/imports/contacts/qdeclarativecontactmodel.cpp | ||
| -@@ -853,8 +853,9 @@ void QDeclarativeContactModel::fetchRequ | ||
| - | ||
| - int pos = d->m_contacts.indexOf(contact); | ||
| - if (pos != i) { | ||
| -- beginMoveRows(QModelIndex(), pos, pos, QModelIndex(), i); | ||
| -- d->m_contacts.move(pos, i); | ||
| -+ int targetPos = i < d->m_contacts.size() ? i : d->m_contacts.size() - 1; | ||
| -+ beginMoveRows(QModelIndex(), pos, pos, QModelIndex(), targetPos); | ||
| -+ d->m_contacts.move(pos, targetPos); | ||
| - endMoveRows(); | ||
| - } | ||
| - } |
| @@ -1,53 +0,0 @@ | ||
| -From 8f8c830c36c6839acb9d570189f64b42853ed02b Mon Sep 17 00:00:00 2001 | ||
| -From: Renato Araujo Oliveira Filho <renato.filho@canonical.com> | ||
| -Date: Mon, 30 Jun 2014 11:16:19 -0300 | ||
| -Subject: [PATCH] Fixed DisplayName conversion to vcard. | ||
| - | ||
| -Based on VCARD spec "FN" field is only one string, the old implementation store a string list | ||
| -and does not change the property type, that causes the following error: | ||
| - | ||
| -Variant value is a QStringList but the property's value type is neither CompoundType or ListType | ||
| - | ||
| -Changing the property to store a single string fixes the problem. | ||
| - | ||
| -Change-Id: I7a7857fb2c498518d7940410d0bb65558e230fec | ||
| -Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au> | ||
| -Reviewed-by: Christopher Adams <chris.adams@jollamobile.com> | ||
| ---- | ||
| - src/versit/qvcard30writer.cpp | 4 ++-- | ||
| - src/versit/qversitcontactexporter_p.cpp | 4 +--- | ||
| - 2 files changed, 3 insertions(+), 5 deletions(-) | ||
| - | ||
| -diff --git a/src/versit/qvcard30writer.cpp b/src/versit/qvcard30writer.cpp | ||
| -index 924ef69..20d01aa 100644 | ||
| ---- a/src/versit/qvcard30writer.cpp | ||
| -+++ b/src/versit/qvcard30writer.cpp | ||
| -@@ -108,8 +108,8 @@ void QVCard30Writer::encodeVersitProperty(const QVersitProperty& property) | ||
| - separator = QStringLiteral(";"); | ||
| - } else { | ||
| - if (property.valueType() != QVersitProperty::ListType) { | ||
| -- qWarning("Variant value is a QStringList but the property's value type is neither " | ||
| -- "CompoundType or ListType"); | ||
| -+ qWarning("Property: %s, variant value is a QStringList but the property's value type is neither " | ||
| -+ "CompoundType or ListType", property.name().toLatin1().constData()); | ||
| - } | ||
| - // Assume it's a ListType | ||
| - separator = QStringLiteral(","); | ||
| -diff --git a/src/versit/qversitcontactexporter_p.cpp b/src/versit/qversitcontactexporter_p.cpp | ||
| -index 85458d6..6b30126 100644 | ||
| ---- a/src/versit/qversitcontactexporter_p.cpp | ||
| -+++ b/src/versit/qversitcontactexporter_p.cpp | ||
| -@@ -526,9 +526,7 @@ void QVersitContactExporterPrivate::encodeDisplayLabel( | ||
| - QVersitProperty property = | ||
| - VersitUtils::takeProperty(document, QStringLiteral("FN"), removedProperties); | ||
| - property.setName(QStringLiteral("FN")); | ||
| -- QStringList value(property.variantValue().toStringList()); | ||
| -- value.append(displaylabelDetail.label()); | ||
| -- property.setValue(value); | ||
| -+ property.setValue(displaylabelDetail.label()); | ||
| - *generatedProperties << property; | ||
| - *processedFields << QContactDisplayLabel::FieldLabel; | ||
| - } | ||
| --- | ||
| -2.5.0 | ||
| - |
Oops, something went wrong.