From dbc9ba3b0554c513e062fa4b50125cf4055ee8f5 Mon Sep 17 00:00:00 2001 From: Matt Vogt Date: Mon, 27 Jan 2014 17:56:12 -0800 Subject: [PATCH] [libcontacts] Remove Qt4 support --- config.pri | 13 +- package.pri | 3 +- rpm/libcontacts.spec | 64 -------- src/seasidecache.cpp | 138 +----------------- src/seasidecache.h | 32 ---- src/seasideimport.cpp | 39 ----- src/seasideimport.h | 4 - src/seasidenamegrouper.h | 4 - src/seasidepropertyhandler.cpp | 17 --- src/seasidepropertyhandler.h | 11 +- src/src.pro | 30 +--- tests/tst_seasideimport/tst_seasideimport.cpp | 2 - tests/tst_seasideimport/tst_seasideimport.pro | 3 +- 13 files changed, 12 insertions(+), 348 deletions(-) delete mode 100644 rpm/libcontacts.spec diff --git a/config.pri b/config.pri index efd6c79..0d7a727 100644 --- a/config.pri +++ b/config.pri @@ -3,15 +3,4 @@ include(package.pri) CONFIG += qt link_pkgconfig QT -= gui -equals(QT_MAJOR_VERSION, 4) { - CONFIG += mobility - MOBILITY += contacts versit - PKGCONFIG += qtcontacts-sqlite-extensions -} -equals(QT_MAJOR_VERSION, 5) { - PKGCONFIG += Qt5Contacts Qt5Versit qtcontacts-sqlite-qt5-extensions - DEFINES *= USING_QTPIM - - # Needed for qt4 moc, which can't handle numeric tests - DEFINES *= QT_VERSION_5 -} +PKGCONFIG += Qt5Contacts Qt5Versit qtcontacts-sqlite-qt5-extensions diff --git a/package.pri b/package.pri index 83f5d33..d409247 100644 --- a/package.pri +++ b/package.pri @@ -1,2 +1 @@ -equals(QT_MAJOR_VERSION, 4): PACKAGENAME=contactcache -equals(QT_MAJOR_VERSION, 5): PACKAGENAME=contactcache-qt5 +PACKAGENAME=contactcache-qt5 diff --git a/rpm/libcontacts.spec b/rpm/libcontacts.spec deleted file mode 100644 index 6a619bc..0000000 --- a/rpm/libcontacts.spec +++ /dev/null @@ -1,64 +0,0 @@ -Name: libcontacts -Summary: Nemo contact cache library -Version: 0.0.0 -Release: 1 -Group: System/Libraries -License: BSD -URL: https://github.com/nemomobile/libcontacts -Source0: %{name}-%{version}.tar.bz2 -Requires: qtcontacts-sqlite -BuildRequires: pkgconfig(QtCore) -BuildRequires: pkgconfig(QtContacts) -BuildRequires: pkgconfig(QtVersit) -BuildRequires: pkgconfig(mlite) -BuildRequires: pkgconfig(mce) -BuildRequires: pkgconfig(qtcontacts-sqlite-extensions) >= 0.1.35 - -%description -%{summary}. - -%package tests -Summary: Nemo contact cache library tests -Group: System/Libraries -Requires: %{name} = %{version}-%{release} - -%description tests -%{summary}. - -%package devel -Summary: Nemo contact cache library headers -Group: System/Libraries -Requires: %{name} = %{version}-%{release} - -%description devel -%{summary}. - -%prep -%setup -q -n %{name}-%{version} - -%build - -%qmake - -make %{?jobs:-j%jobs} - -%install -rm -rf %{buildroot} -%qmake_install - -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig - -%files -%defattr(-,root,root,-) -%{_libdir}/libcontactcache.so* - -%files tests -%defattr(-,root,root,-) -/opt/tests/contactcache/* - -%files devel -%defattr(-,root,root,-) -%{_includedir}/contactcache/* -%{_libdir}/pkgconfig/contactcache.pc diff --git a/src/seasidecache.cpp b/src/seasidecache.cpp index 3a45f51..25eae49 100644 --- a/src/seasidecache.cpp +++ b/src/seasidecache.cpp @@ -40,11 +40,7 @@ #include #include -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) #include -#else -#include -#endif #include #include #include @@ -77,20 +73,13 @@ #include #include -#ifdef USING_QTPIM QTVERSIT_USE_NAMESPACE -#endif namespace { ML10N::MLocale mLocale; -const QString aggregateRelationshipType = -#ifdef USING_QTPIM - QContactRelationship::Aggregates(); -#else - QContactRelationship::Aggregates; -#endif +const QString aggregateRelationshipType = QContactRelationship::Aggregates(); const QString syncTargetLocal = QLatin1String("local"); const QString syncTargetWasLocal = QLatin1String("was_local"); @@ -127,48 +116,28 @@ typedef QList DetailList; template DetailTypeId detailType() { -#ifdef USING_QTPIM return T::Type; -#else - return T::DefinitionName; -#endif } DetailTypeId detailType(const QContactDetail &detail) { -#ifdef USING_QTPIM return detail.type(); -#else - return detail.definitionName(); -#endif } template void setDetailType(Filter &filter, Field field) { -#ifdef USING_QTPIM filter.setDetailType(T::Type, field); -#else - filter.setDetailDefinitionName(T::DefinitionName, field); -#endif } DetailList detailTypesHint(const QContactFetchHint &hint) { -#ifdef USING_QTPIM return hint.detailTypesHint(); -#else - return hint.detailDefinitionsHint(); -#endif } void setDetailTypesHint(QContactFetchHint &hint, const DetailList &types) { -#ifdef USING_QTPIM hint.setDetailTypesHint(types); -#else - hint.setDetailDefinitionsHint(types); -#endif } QContactFetchHint basicFetchHint() @@ -485,11 +454,7 @@ SeasideCache* SeasideCache::instance() SeasideCache::ContactIdType SeasideCache::apiId(const QContact &contact) { -#ifdef USING_QTPIM return contact.id(); -#else - return contact.id().localId(); -#endif } SeasideCache::ContactIdType SeasideCache::apiId(quint32 iid) @@ -499,20 +464,9 @@ SeasideCache::ContactIdType SeasideCache::apiId(quint32 iid) bool SeasideCache::validId(const ContactIdType &id) { -#ifdef USING_QTPIM return !id.isNull(); -#else - return (id != 0); -#endif } -#ifndef USING_QTPIM -bool SeasideCache::validId(const QContactId &id) -{ - return (id.localId() != 0); -} -#endif - quint32 SeasideCache::internalId(const QContact &contact) { return internalId(contact.id()); @@ -523,13 +477,6 @@ quint32 SeasideCache::internalId(const QContactId &id) return QtContactsSqliteExtensions::internalContactId(id); } -#ifndef USING_QTPIM -quint32 SeasideCache::internalId(QContactLocalId id) -{ - return QtContactsSqliteExtensions::internalContactId(id); -} -#endif - SeasideCache::SeasideCache() : m_syncFilter(FilterNone) #ifdef HAS_MLITE @@ -591,7 +538,6 @@ SeasideCache::SeasideCache() typedef QtContactsSqliteExtensions::ContactManagerEngine EngineType; EngineType *cme = dynamic_cast(QContactManagerData::managerData(mgr)->m_engine); -#ifdef USING_QTPIM connect(mgr, SIGNAL(dataChanged()), this, SLOT(updateContacts())); connect(mgr, SIGNAL(contactsAdded(QList)), this, SLOT(contactsAdded(QList))); @@ -601,17 +547,6 @@ SeasideCache::SeasideCache() this, SLOT(contactsPresenceChanged(QList))); connect(mgr, SIGNAL(contactsRemoved(QList)), this, SLOT(contactsRemoved(QList))); -#else - connect(mgr, SIGNAL(dataChanged()), this, SLOT(updateContacts())); - connect(mgr, SIGNAL(contactsAdded(QList)), - this, SLOT(contactsAdded(QList))); - connect(mgr, SIGNAL(contactsChanged(QList)), - this, SLOT(contactsChanged(QList))); - connect(cme, SIGNAL(contactsPresenceChanged(QList)), - this, SLOT(contactsPresenceChanged(QList))); - connect(mgr, SIGNAL(contactsRemoved(QList)), - this, SLOT(contactsRemoved(QList))); -#endif connect(&m_fetchRequest, SIGNAL(resultsAvailable()), this, SLOT(contactsAvailable())); connect(&m_fetchByIdRequest, SIGNAL(resultsAvailable()), this, SLOT(contactsAvailable())); @@ -889,13 +824,7 @@ SeasideCache::CacheItem *SeasideCache::itemById(const ContactIdType &id, bool re item->iid = iid; item->contactState = ContactAbsent; -#ifdef USING_QTPIM item->contact.setId(id); -#else - QContactId contactId; - contactId.setLocalId(id); - item->contact.setId(contactId); -#endif } if (requireComplete) { @@ -904,7 +833,6 @@ SeasideCache::CacheItem *SeasideCache::itemById(const ContactIdType &id, bool re return item; } -#ifdef USING_QTPIM SeasideCache::CacheItem *SeasideCache::itemById(int id, bool requireComplete) { if (id != 0) { @@ -916,21 +844,12 @@ SeasideCache::CacheItem *SeasideCache::itemById(int id, bool requireComplete) return 0; } -#endif SeasideCache::CacheItem *SeasideCache::existingItem(const ContactIdType &id) { -#ifdef USING_QTPIM return existingItem(internalId(id)); -#else - QHash::iterator it = instancePtr->m_people.find(id); - return it != instancePtr->m_people.end() - ? &(*it) - : 0; -#endif } -#ifdef USING_QTPIM SeasideCache::CacheItem *SeasideCache::existingItem(quint32 iid) { QHash::iterator it = instancePtr->m_people.find(iid); @@ -938,7 +857,6 @@ SeasideCache::CacheItem *SeasideCache::existingItem(quint32 iid) ? &(*it) : 0; } -#endif QContact SeasideCache::contactById(const ContactIdType &id) { @@ -1621,11 +1539,7 @@ void SeasideCache::startRequest(bool *idleProcessing) } else { // Fetch the constituent information (even if they're already in the // cache, because we don't update non-aggregates on change notifications) -#ifdef USING_QTPIM m_fetchByIdRequest.setIds(m_constituentIds.toList()); -#else - m_fetchByIdRequest.setLocalIds(m_constituentIds.toList()); -#endif m_fetchByIdRequest.start(); m_fetchByIdProcessedCount = 0; @@ -1639,15 +1553,10 @@ void SeasideCache::startRequest(bool *idleProcessing) QContactId aggregateId = m_contactsToFetchConstituents.first(); // Find the constituents of this contact -#ifdef USING_QTPIM QContact first; first.setId(aggregateId); m_relationshipsFetchRequest.setFirst(first); m_relationshipsFetchRequest.setRelationshipType(QContactRelationship::Aggregates()); -#else - m_relationshipsFetchRequest.setFirst(aggregateId); - m_relationshipsFetchRequest.setRelationshipType(QContactRelationship::Aggregates); -#endif m_relationshipsFetchRequest.start(); } } @@ -1656,11 +1565,7 @@ void SeasideCache::startRequest(bool *idleProcessing) if (m_contactIdRequest.isActive()) { requestPending = true; } else { -#ifdef USING_QTPIM ContactIdType contactId(m_contactsToFetchCandidates.first()); -#else - ContactIdType contactId(m_contactsToFetchCandidates.first().localId()); -#endif const QContact contact(contactById(contactId)); // Find candidates to merge with this contact @@ -1745,11 +1650,7 @@ void SeasideCache::startRequest(bool *idleProcessing) // The actual limit is over 800, but we should reduce further to increase interactivity const int maxRequestIds = 200; -#ifdef USING_QTPIM QContactIdFilter filter; -#else - QContactLocalIdFilter filter; -#endif if (m_changedContacts.count() > maxRequestIds) { filter.setIds(m_changedContacts.mid(0, maxRequestIds)); m_changedContacts = m_changedContacts.mid(maxRequestIds); @@ -1774,11 +1675,7 @@ void SeasideCache::startRequest(bool *idleProcessing) } else if (!m_displayOff) { const int maxRequestIds = 200; -#ifdef USING_QTPIM QContactIdFilter filter; -#else - QContactLocalIdFilter filter; -#endif if (m_presenceChangedContacts.count() > maxRequestIds) { filter.setIds(m_presenceChangedContacts.mid(0, maxRequestIds)); m_presenceChangedContacts = m_presenceChangedContacts.mid(maxRequestIds); @@ -2506,19 +2403,11 @@ void SeasideCache::contactIdsAvailable() void SeasideCache::relationshipsAvailable() { -#ifdef USING_QTPIM static const QString aggregatesRelationship = QContactRelationship::Aggregates(); -#else - static const QString aggregatesRelationship = QContactRelationship::Aggregates; -#endif foreach (const QContactRelationship &rel, m_relationshipsFetchRequest.relationships()) { if (rel.relationshipType() == aggregatesRelationship) { -#ifdef USING_QTPIM m_constituentIds.insert(apiId(rel.second())); -#else - m_constituentIds.insert(rel.second().localId()); -#endif } } } @@ -2636,11 +2525,7 @@ void SeasideCache::requestStateChanged(QContactAbstractRequest::State state) m_contactsToLinkTo.append(aggregateId); } else { // We didn't find any constituents - report the empty list -#ifdef USING_QTPIM CacheItem *cacheItem = itemById(aggregateId); -#else - CacheItem *cacheItem = itemById(aggregateId.localId()); -#endif if (cacheItem->itemData) { cacheItem->itemData->constituentsFetched(QList()); } @@ -2652,11 +2537,7 @@ void SeasideCache::requestStateChanged(QContactAbstractRequest::State state) if (!m_contactsToLinkTo.isEmpty()) { // Report these results QContactId aggregateId = m_contactsToLinkTo.takeFirst(); -#ifdef USING_QTPIM CacheItem *cacheItem = itemById(aggregateId); -#else - CacheItem *cacheItem = itemById(aggregateId.localId()); -#endif QList constituentIds; foreach (const ContactIdType &id, m_constituentIds) { @@ -2692,11 +2573,7 @@ void SeasideCache::requestStateChanged(QContactAbstractRequest::State state) } else if (!m_contactsToFetchCandidates.isEmpty()) { // Report these results QContactId contactId = m_contactsToFetchCandidates.takeFirst(); -#ifdef USING_QTPIM CacheItem *cacheItem = itemById(contactId); -#else - CacheItem *cacheItem = itemById(contactId.localId()); -#endif const quint32 contactIid = internalId(contactId); @@ -2728,11 +2605,7 @@ void SeasideCache::requestStateChanged(QContactAbstractRequest::State state) } foreach (const QContactRelationship &relationship, relationships) { -#ifdef USING_QTPIM m_aggregatedContacts.insert(SeasideCache::apiId(relationship.first())); -#else - m_aggregatedContacts.insert(relationship.first().localId()); -#endif } if (completed) { @@ -3058,15 +2931,11 @@ QString SeasideCache::exportContacts() return QString(); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) QString baseDir; foreach (const QString &loc, QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation)) { baseDir = loc; break; } -#else - const QString baseDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation); -#endif QFile vcard(baseDir + QDir::separator() + QDateTime::currentDateTime().toString("ss_mm_hh_dd_mm_yyyy") @@ -3295,13 +3164,8 @@ QContactRelationship SeasideCache::makeRelationship(const QString &type, const Q { QContactRelationship relationship; relationship.setRelationshipType(type); -#ifdef USING_QTPIM relationship.setFirst(contact1); relationship.setSecond(contact2); -#else - relationship.setFirst(contact1.id()); - relationship.setSecond(contact2.id()); -#endif return relationship; } diff --git a/src/seasidecache.h b/src/seasidecache.h index 4b8e39b..aca1e76 100644 --- a/src/seasidecache.h +++ b/src/seasidecache.h @@ -47,13 +47,8 @@ #include #include #include -#ifdef USING_QTPIM #include #include -#else -#include -#include -#endif #include #include @@ -65,15 +60,9 @@ #include #endif -#ifdef USING_QTPIM QTCONTACTS_USE_NAMESPACE typedef QContactDetail::DetailType DetailTypeId; -#else -QTM_USE_NAMESPACE - -typedef QString DetailTypeId; -#endif class CONTACTCACHE_EXPORT SeasideNameGroupChangeListener { @@ -272,15 +261,9 @@ class CONTACTCACHE_EXPORT SeasideCache : public QObject static ContactIdType apiId(quint32 iid); static bool validId(const ContactIdType &id); -#ifndef USING_QTPIM - static bool validId(const QContactId &id); -#endif static quint32 internalId(const QContact &contact); static quint32 internalId(const QContactId &id); -#ifndef USING_QTPIM - static quint32 internalId(QContactLocalId id); -#endif static void registerModel(ListModel *model, FilterType type, FetchDataType requiredTypes = FetchNone, FetchDataType extraTypes = FetchNone); static void unregisterModel(ListModel *model); @@ -305,13 +288,9 @@ class CONTACTCACHE_EXPORT SeasideCache : public QObject static int contactId(const QContact &contact); static CacheItem *existingItem(const ContactIdType &id); -#ifdef USING_QTPIM static CacheItem *existingItem(quint32 iid); -#endif static CacheItem *itemById(const ContactIdType &id, bool requireComplete = true); -#ifdef USING_QTPIM static CacheItem *itemById(int id, bool requireComplete = true); -#endif static ContactIdType selfContactId(); static QContact contactById(const ContactIdType &id); @@ -371,17 +350,10 @@ private slots: void relationshipsAvailable(); void requestStateChanged(QContactAbstractRequest::State state); void updateContacts(); -#ifdef USING_QTPIM void contactsAdded(const QList &contactIds); void contactsChanged(const QList &contactIds); void contactsPresenceChanged(const QList &contactIds); void contactsRemoved(const QList &contactIds); -#else - void contactsAdded(const QList &contactIds); - void contactsChanged(const QList &contactIds); - void contactsPresenceChanged(const QList &contactIds); - void contactsRemoved(const QList &contactIds); -#endif void displayLabelOrderChanged(); void sortPropertyChanged(); void groupPropertyChanged(); @@ -469,11 +441,7 @@ private slots: QHash m_expiredContacts; QContactFetchRequest m_fetchRequest; QContactFetchByIdRequest m_fetchByIdRequest; -#ifdef USING_QTPIM QContactIdFetchRequest m_contactIdRequest; -#else - QContactLocalIdFetchRequest m_contactIdRequest; -#endif QContactRelationshipFetchRequest m_relationshipsFetchRequest; QContactRemoveRequest m_removeRequest; QContactSaveRequest m_saveRequest; diff --git a/src/seasideimport.cpp b/src/seasideimport.cpp index 4fc421a..6a421c9 100644 --- a/src/seasideimport.cpp +++ b/src/seasideimport.cpp @@ -57,12 +57,8 @@ #include #include -#ifdef USING_QTPIM #include #include -#else -#include -#endif #include #include @@ -89,13 +85,8 @@ QContactFilter localContactFilter() { // Contacts that are local to the device have sync target 'local' or 'was_local' QContactDetailFilter filterLocal, filterWasLocal; -#ifdef USING_QTPIM filterLocal.setDetailType(QContactSyncTarget::Type, QContactSyncTarget::FieldSyncTarget); filterWasLocal.setDetailType(QContactSyncTarget::Type, QContactSyncTarget::FieldSyncTarget); -#else - filterLocal.setDetailDefinitionName(QContactSyncTarget::DefinitionName, QContactSyncTarget::FieldSyncTarget); - filterWasLocal.setDetailDefinitionName(QContactSyncTarget::DefinitionName, QContactSyncTarget::FieldSyncTarget); -#endif filterLocal.setValue(QString::fromLatin1("local")); filterWasLocal.setValue(QString::fromLatin1("was_local")); @@ -133,32 +124,19 @@ QString contactNameString(const QContact &contact) template QVariant detailValue(const T &detail, F field) { -#ifdef USING_QTPIM return detail.value(field); -#else - return detail.variantValue(field); -#endif } -#ifdef USING_QTPIM typedef QMap DetailMap; -#else -typedef QVariantMap DetailMap; -#endif DetailMap detailValues(const QContactDetail &detail) { -#ifdef USING_QTPIM DetailMap rv(detail.values()); -#else - DetailMap rv(detail.variantValues()); -#endif return rv; } static bool variantEqual(const QVariant &lhs, const QVariant &rhs) { -#ifdef USING_QTPIM // Work around incorrect result from QVariant::operator== when variants contain QList static const int QListIntType = QMetaType::type("QList"); @@ -170,7 +148,6 @@ static bool variantEqual(const QVariant &lhs, const QVariant &rhs) if (lhsType == QListIntType) { return (lhs.value >() == rhs.value >()); } -#endif return (lhs == rhs); } @@ -197,7 +174,6 @@ static void fixupDetail(QContactDetail &) { } -#ifdef USING_QTPIM // Fixup QContactUrl because importer produces incorrectly typed URL field static void fixupDetail(QContactUrl &url) { @@ -236,7 +212,6 @@ static void fixupDetail(QContactOrganization &org) } } } -#endif template bool updateExistingDetails(QContact *updateContact, const QContact &importedContact, bool singular = false) @@ -288,9 +263,7 @@ bool mergeIntoExistingContact(QContact *updateContact, const QContact &importedC rv |= updateExistingDetails(updateContact, importedContact); rv |= updateExistingDetails(updateContact, importedContact); rv |= updateExistingDetails(updateContact, importedContact); -#ifdef USING_QTPIM rv |= updateExistingDetails(updateContact, importedContact); -#endif return rv; } @@ -419,11 +392,7 @@ QList SeasideImport::buildImportContacts(const QList // Find all names and GUIDs for local contacts that might match these contacts QContactFetchHint fetchHint(basicFetchHint()); -#ifdef USING_QTPIM fetchHint.setDetailTypesHint(QList() << QContactName::Type << QContactNickname::Type << QContactGuid::Type); -#else - fetchHint.setDetailDefinitionsHint(QStringList() << QContactName::DefinitionName << QContactNickname::DefinitionName << QContactGuid::DefinitionName); -#endif QHash existingGuids; QHash existingNames; @@ -519,16 +488,8 @@ QList SeasideImport::buildImportContacts(const QList int existingCount(existingIds.count()); if (existingCount > 0) { // Retrieve all the contacts that we have matches for -#ifdef USING_QTPIM QContactIdFilter idFilter; idFilter.setIds(existingIds.keys()); -#else - QContactLocalIdFilter idFilter; - QList localIds; - foreach (const QContactId &id, existingIds.keys()) { - localids.append(id.toLocal()); - } -#endif QSet modifiedContacts; QSet unmodifiedContacts; diff --git a/src/seasideimport.h b/src/seasideimport.h index a241332..650733e 100644 --- a/src/seasideimport.h +++ b/src/seasideimport.h @@ -37,12 +37,8 @@ #include #include -#ifdef USING_QTPIM QTCONTACTS_USE_NAMESPACE QTVERSIT_USE_NAMESPACE -#else -QTM_USE_NAMESPACE -#endif class CONTACTCACHE_EXPORT SeasideImport { diff --git a/src/seasidenamegrouper.h b/src/seasidenamegrouper.h index d8d3846..6c41525 100644 --- a/src/seasidenamegrouper.h +++ b/src/seasidenamegrouper.h @@ -37,11 +37,7 @@ #include #include -#ifdef USING_QTPIM QTCONTACTS_USE_NAMESPACE -#else -QTM_USE_NAMESPACE -#endif class CONTACTCACHE_EXPORT SeasideNameGrouper { diff --git a/src/seasidepropertyhandler.cpp b/src/seasidepropertyhandler.cpp index 0784c52..4c60e5c 100644 --- a/src/seasidepropertyhandler.cpp +++ b/src/seasidepropertyhandler.cpp @@ -32,10 +32,6 @@ #include "seasidepropertyhandler.h" -#ifndef QT_VERSION_5 -#include -#include -#endif #include #include #include @@ -65,19 +61,6 @@ void processPhoto(const QVersitProperty &property, bool *alreadyProcessed, QList // if the property is a PHOTO property, store the data to disk // and then create an avatar detail which points to it. -#ifndef QT_VERSION_5 - // The Qt4 / QtMobility version has QContactThumbnail support. - // We need to remove any such thumbnail detail from the output, - // as some backends (such as qtcontacts-sqlite) do not support - // that detail type. - for (int i = 0; i < updatedDetails->size(); ++i) { - if (updatedDetails->at(i).definitionName() == QContactThumbnail::DefinitionName) { - updatedDetails->removeAt(i); - --i; - } - } -#endif - // The data might be either a URL, a file path, or encoded image data // It's hard to tell what the content is, because versit removes the encoding // information in the process of decoding the data... diff --git a/src/seasidepropertyhandler.h b/src/seasidepropertyhandler.h index 7becf26..d0c2f41 100644 --- a/src/seasidepropertyhandler.h +++ b/src/seasidepropertyhandler.h @@ -40,22 +40,13 @@ #include -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) -# include -#else -# include -#endif - +#include #include #include #include -#ifdef USING_QTPIM QTCONTACTS_USE_NAMESPACE QTVERSIT_USE_NAMESPACE -#else -QTM_USE_NAMESPACE -#endif /* SeasidePropertyHandler diff --git a/src/src.pro b/src/src.pro index e1d99bc..6eb61bb 100644 --- a/src/src.pro +++ b/src/src.pro @@ -16,24 +16,13 @@ QMAKE_PKGCONFIG_LIBDIR = $$PREFIX/lib QMAKE_PKGCONFIG_DESTDIR = pkgconfig CONFIG += link_pkgconfig -equals(QT_MAJOR_VERSION, 4) { - packagesExist(mlite) { - PKGCONFIG += mlite - DEFINES += HAS_MLITE - } else { - warning("mlite not available. Some functionality may not work as expected.") - } - PKGCONFIG += mce -} -equals(QT_MAJOR_VERSION, 5) { - packagesExist(mlite5) { - PKGCONFIG += mlite5 - DEFINES += HAS_MLITE - } else { - warning("mlite not available. Some functionality may not work as expected.") - } - PKGCONFIG += mlocale5 mce +packagesExist(mlite5) { + PKGCONFIG += mlite5 + DEFINES += HAS_MLITE +} else { + warning("mlite not available. Some functionality may not work as expected.") } +PKGCONFIG += mlocale5 mce DEFINES += CONTACTCACHE_BUILD @@ -41,12 +30,7 @@ DEFINES += CONTACTCACHE_BUILD QT += contacts-private # We need the moc output for ContactManagerEngine from sqlite-extensions -equals(QT_MAJOR_VERSION, 4) { - extensionsIncludePath = $$system(pkg-config --cflags-only-I qtcontacts-sqlite-extensions) -} -equals(QT_MAJOR_VERSION, 5) { - extensionsIncludePath = $$system(pkg-config --cflags-only-I qtcontacts-sqlite-qt5-extensions) -} +extensionsIncludePath = $$system(pkg-config --cflags-only-I qtcontacts-sqlite-qt5-extensions) VPATH += $$replace(extensionsIncludePath, -I, ) HEADERS += contactmanagerengine.h diff --git a/tests/tst_seasideimport/tst_seasideimport.cpp b/tests/tst_seasideimport/tst_seasideimport.cpp index d7ff195..cfeb255 100644 --- a/tests/tst_seasideimport/tst_seasideimport.cpp +++ b/tests/tst_seasideimport/tst_seasideimport.cpp @@ -41,9 +41,7 @@ #include #include -#ifdef USING_QTPIM QTVERSIT_USE_NAMESPACE -#endif class tst_SeasideImport : public QObject { diff --git a/tests/tst_seasideimport/tst_seasideimport.pro b/tests/tst_seasideimport/tst_seasideimport.pro index 3212e69..723a1bd 100644 --- a/tests/tst_seasideimport/tst_seasideimport.pro +++ b/tests/tst_seasideimport/tst_seasideimport.pro @@ -4,5 +4,4 @@ TARGET = tst_seasideimport SOURCES += tst_seasideimport.cpp -equals(QT_MAJOR_VERSION, 4): LIBS += ../../src/libcontactcache.so -equals(QT_MAJOR_VERSION, 5): LIBS += ../../src/libcontactcache-qt5.so +LIBS += ../../src/libcontactcache-qt5.so