Skip to content

Commit

Permalink
[voicecall] Remove Qt 4 support.
Browse files Browse the repository at this point in the history
Not needed anymore.
  • Loading branch information
rburchell committed Sep 27, 2013
1 parent 8c08990 commit 449d9d7
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 200 deletions.
10 changes: 3 additions & 7 deletions plugins/declarative/src/src.pro
@@ -1,12 +1,9 @@
CONFIG += no_libvoicecall no_plugininstall
include(../../plugin.pri)
QT = core dbus
equals(QT_MAJOR_VERSION, 4): QT += declarative
equals(QT_MAJOR_VERSION, 5): QT += qml
QT = core dbus qml

TARGET = voicecall
equals(QT_MAJOR_VERSION, 4): uri = stage.rubyx.voicecall
equals(QT_MAJOR_VERSION, 5): uri = org.nemomobile.voicecall
uri = org.nemomobile.voicecall

#DEFINES += WANT_TRACE

Expand Down Expand Up @@ -35,8 +32,7 @@ OTHER_FILES += qmldir
}

qmldir.files = qmldir
equals(QT_MAJOR_VERSION, 4): installPath = $$[QT_INSTALL_IMPORTS]/$$replace(uri, \\., /)
equals(QT_MAJOR_VERSION, 5): installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /)
installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /)
qmldir.path = $$installPath
target.path = $$installPath
INSTALLS += target qmldir
6 changes: 0 additions & 6 deletions plugins/declarative/src/voicecallmodel.cpp
Expand Up @@ -74,10 +74,6 @@ VoiceCallModel::VoiceCallModel(VoiceCallManager *manager)
d_ptr->headerData.insert(ROLE_IS_MULTIPARTY, "isMultiparty");
d_ptr->headerData.insert(ROLE_INSTANCE, "instance");

#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
setRoleNames(d_ptr->headerData);
#endif

// Need to listen for signal on the manager, because it handles connectivity to VCM.
QObject::connect(d->manager, SIGNAL(voiceCallsChanged()), SLOT(onVoiceCallsChanged()));
}
Expand All @@ -89,13 +85,11 @@ VoiceCallModel::~VoiceCallModel()
delete d;
}

#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
QHash<int, QByteArray> VoiceCallModel::roleNames() const
{
Q_D(const VoiceCallModel);
return d->headerData;
}
#endif

int VoiceCallModel::count() const
{
Expand Down
2 changes: 0 additions & 2 deletions plugins/declarative/src/voicecallmodel.h
Expand Up @@ -74,10 +74,8 @@ public Q_SLOTS:
VoiceCallHandler* instance(int instance) const;
VoiceCallHandler* instance(const QString &handlerId) const;

#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
protected:
QHash<int, QByteArray> roleNames() const;
#endif

protected Q_SLOTS:
void onVoiceCallsChanged();
Expand Down
9 changes: 1 addition & 8 deletions plugins/declarative/src/voicecallplugin.cpp
Expand Up @@ -6,11 +6,7 @@
#include "voicecallmodel.h"
#include "voicecallprovidermodel.h"

#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
# include <QtQml>
#else
# include <QtDeclarative>
#endif
#include <QtQml>

void VoiceCallPlugin::registerTypes(const char *uri)
{
Expand All @@ -21,6 +17,3 @@ void VoiceCallPlugin::registerTypes(const char *uri)
qmlRegisterType<VoiceCallManager>(uri, 1, 0, "VoiceCallManager");
}

#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(voicecall, VoiceCallPlugin)
#endif
12 changes: 2 additions & 10 deletions plugins/declarative/src/voicecallplugin.h
Expand Up @@ -3,20 +3,12 @@

#include <QtGlobal>

#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <QtQml/QQmlExtensionPlugin>
#define QDeclarativeExtensionPlugin QQmlExtensionPlugin
#else
# include <QtDeclarative/QDeclarativeExtensionPlugin>
#endif
#include <QtQml/QQmlExtensionPlugin>

class VoiceCallPlugin : public QDeclarativeExtensionPlugin
class VoiceCallPlugin : public QQmlExtensionPlugin
{
Q_OBJECT

#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "org.nemomobile.voicecall")
#endif

public:
void registerTypes(const char *uri);
Expand Down
6 changes: 0 additions & 6 deletions plugins/declarative/src/voicecallprovidermodel.cpp
Expand Up @@ -80,10 +80,6 @@ VoiceCallProviderModel::VoiceCallProviderModel(VoiceCallManager *manager)
d_ptr->headerData.insert(ROLE_TYPE, "type");
d_ptr->headerData.insert(ROLE_LABEL, "name");

#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
setRoleNames(d_ptr->headerData);
#endif

QObject::connect(d->manager, SIGNAL(providersChanged()), SLOT(onProvidersChanged()));

this->onProvidersChanged();
Expand All @@ -96,13 +92,11 @@ VoiceCallProviderModel::~VoiceCallProviderModel()
delete d;
}

#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
QHash<int, QByteArray> VoiceCallProviderModel::roleNames() const
{
Q_D(const VoiceCallProviderModel);
return d->headerData;
}
#endif

int VoiceCallProviderModel::count() const
{
Expand Down
2 changes: 0 additions & 2 deletions plugins/declarative/src/voicecallprovidermodel.h
Expand Up @@ -68,10 +68,8 @@ public Q_SLOTS:
QString type(int index) const;
QString label(int index) const;

#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
protected:
QHash<int, QByteArray> roleNames() const;
#endif

protected Q_SLOTS:
void onProvidersChanged();
Expand Down
9 changes: 1 addition & 8 deletions plugins/plugins.pro
@@ -1,9 +1,2 @@
TEMPLATE = subdirs

# Qt 4 doesn't have the voicecall daemon, so the plugins for it aren't required
# either. We do build the declarative voicecall plugin so that a Qt 4 UI can
# interact with the daemon though.
#
# Qt 5's voiceall needs all plugins.
equals(QT_MAJOR_VERSION, 4): SUBDIRS = declarative
equals(QT_MAJOR_VERSION, 5): SUBDIRS = declarative providers ngf playback-manager
SUBDIRS = declarative providers ngf playback-manager
56 changes: 0 additions & 56 deletions rpm/voicecall.changes

This file was deleted.

60 changes: 0 additions & 60 deletions rpm/voicecall.spec

This file was deleted.

25 changes: 0 additions & 25 deletions rpm/voicecall.yaml

This file was deleted.

12 changes: 2 additions & 10 deletions voicecall.pro
@@ -1,15 +1,7 @@
TEMPLATE = subdirs
SUBDIRS += src lib plugins

# daemon is only built for Qt 5
equals(QT_MAJOR_VERSION, 5) {
SUBDIRS += src lib

# Qt 4 only builds the declarative plugin which does not use libvoicecall.
plugins.depends = lib
}

SUBDIRS += plugins

plugins.depends = lib
src.depends = lib

OTHER_FILES = LICENSE makedist rpm/voicecall-qt5.spec

0 comments on commit 449d9d7

Please sign in to comment.