Skip to content

Commit

Permalink
[qtcontacts-sqlite] Remove Qt4 support
Browse files Browse the repository at this point in the history
After this change, the engine can be built only with qt5 and qtpim.
  • Loading branch information
matthewvogt committed Jan 22, 2014
1 parent b7aba1e commit 9dfdb77
Show file tree
Hide file tree
Showing 34 changed files with 28 additions and 1,588 deletions.
15 changes: 2 additions & 13 deletions config.pri
@@ -1,13 +1,2 @@
include(contacts-namespace.pri)

equals(QT_MAJOR_VERSION, 4) {
CONFIG += mobility
MOBILITY += contacts
}
equals(QT_MAJOR_VERSION, 5) {
CONFIG += link_pkgconfig
PKGCONFIG += Qt5Contacts

# Needed for qt4 moc, which can't handle numeric tests
DEFINES *= QT_VERSION_5
}
CONFIG += link_pkgconfig
PKGCONFIG += Qt5Contacts
12 changes: 0 additions & 12 deletions contacts-namespace.pri

This file was deleted.

65 changes: 0 additions & 65 deletions rpm/qtcontacts-sqlite.spec

This file was deleted.

45 changes: 0 additions & 45 deletions src/engine/contactid.cpp
Expand Up @@ -32,9 +32,7 @@
#include "contactid_p.h"

#include <QContact>
#ifdef USING_QTPIM
#include <QContactManager>
#endif

namespace {

Expand All @@ -55,8 +53,6 @@ quint32 dbIdFromString(const QString &s)

}

#ifdef USING_QTPIM

#include <QContactManagerEngine>

QContactId ContactId::apiId(const QContact &contact)
Expand Down Expand Up @@ -143,43 +139,6 @@ QDebug &ContactId::debugStreamOut(QDebug &dbg) const
}
#endif // QT_NO_DEBUG_STREAM

#else // QT_VERSION

QContactLocalId ContactId::apiId(const QContact &contact)
{
return contact.localId();
}

QContactLocalId ContactId::apiId(quint32 dbId)
{
return dbId ? (dbId + 1) : 0;
}

quint32 ContactId::databaseId(const QContact &contact)
{
return databaseId(contact.localId());
}

quint32 ContactId::databaseId(const QContactId &contactId)
{
return databaseId(contactId.localId());
}

quint32 ContactId::databaseId(QContactLocalId apiId)
{
return apiId ? (apiId - 1) : 0;
}

QContactId ContactId::contactId(QContactLocalId apiId)
{
QContactId id;
id.setManagerUri(default_uri);
id.setLocalId(apiId);
return id;
}

#endif

bool ContactId::isValid(const QContact &contact)
{
return isValid(databaseId(contact));
Expand All @@ -202,10 +161,6 @@ QString ContactId::toString(const QContactIdType &apiId)

QString ContactId::toString(const QContact &c)
{
#ifdef USING_QTPIM
return toString(c.id());
#else
return toString(c.localId());
#endif
}

32 changes: 1 addition & 31 deletions src/engine/contactid_p.h
Expand Up @@ -36,13 +36,11 @@
#include <QContactId>
#include <QContact>

#ifdef USING_QTPIM

#include <QContactEngineId>

#define QContactIdType QContactId

USE_CONTACTS_NAMESPACE
QTCONTACTS_USE_NAMESPACE

class ContactId : public QContactEngineId
{
Expand Down Expand Up @@ -84,33 +82,5 @@ class ContactId : public QContactEngineId
quint32 m_databaseId;
};

#else // USING_QTPIM

#define QContactIdType QContactLocalId

USE_CONTACTS_NAMESPACE

class ContactId
{
public:
static QContactLocalId apiId(const QContact &contact);
static QContactLocalId apiId(quint32 databaseId);

static quint32 databaseId(const QContact &contact);
static quint32 databaseId(const QContactId &contactId);
static quint32 databaseId(QContactLocalId apiId);

static QContactId contactId(QContactLocalId apiId);

static bool isValid(const QContact &contact);
static bool isValid(const QContactId &contactId);
static bool isValid(quint32 dbId);

static QString toString(const QContactIdType &apiId);
static QString toString(const QContact &c);
};

#endif // USING_QTPIM

#endif // QTCONTACTSSQLITE_CONTACTIDIMPL

2 changes: 1 addition & 1 deletion src/engine/contactnotifier.h
Expand Up @@ -38,7 +38,7 @@
#include <QObject>
#include <QSet>

USE_CONTACTS_NAMESPACE
QTCONTACTS_USE_NAMESPACE

namespace ContactNotifier
{
Expand Down

0 comments on commit 9dfdb77

Please sign in to comment.