Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port to libqofono #7

Draft
wants to merge 27 commits into
base: staging
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d6284b4
fix error handling logic
Jul 6, 2019
0f2b5c9
fix: control reaches end of non-void function
Jul 6, 2019
b84082c
check argc
Jul 6, 2019
d4d65c2
Modernize CMakeLists, now requires Cmake 3.1
Jul 6, 2019
44a0929
replace old-style-connect part 1
Jul 7, 2019
43d4922
replace old-style-connect part 2
Jul 7, 2019
7dfe650
replace old-style-connect part 3
Jul 7, 2019
0155545
replace old-style-connect part 4
Jul 7, 2019
17b4e11
Qt5::Test is only needed for tests
Jul 7, 2019
f98ef9c
check for exactly two phonenumbers in comparison
Jul 7, 2019
d5ba4a6
add qofono to CMakeLists.txt
Jul 14, 2019
d482476
ofonomessage -> qofonomessage
Jul 14, 2019
505f78b
ofonovoicecall -> qofonovoicecall
Jul 14, 2019
a13c1ca
unused ofono-qt include
Jul 14, 2019
d4d63b6
ofonomessagemanager -> QOfonoMessageManager
Jul 27, 2019
2f00c5c
ofonomessagewaiting -> QOfonoMessageWaiting
Jul 27, 2019
39ae3f4
OfonoVoiceCallManager -> QOfonoVoiceCallManager
Jul 27, 2019
60104b1
OfonoCallVolume -> QOfonoCallVolume
Jul 27, 2019
1b276d1
OfonoNetworkRegistration -> QOfonoNetworkRegistration
Jul 27, 2019
c6992d2
OfonoSupplementaryServices -> QOfonoSupplementaryServices
Jul 27, 2019
be996d7
OfonoSimManager -> QOfonoSimManager
Jul 27, 2019
eafae33
OfonoModemManager -> QOfonoManager
Jul 27, 2019
e373765
Remove usage of ofono-qt in CMakeLists.txt
Jul 27, 2019
9d3f907
adjust debian build depends
Jul 27, 2019
8518a34
adapt travis-ci
Aug 4, 2019
b9ce313
fix tests #1: mock lib name
Aug 4, 2019
2888e0c
fix tests #2: correct so name
Aug 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,13 @@ addons:
- sqlite3
- telepathy-mission-control-5
- doxygen
- libqofono-dev

before_install:
- sudo apt-get update
- sudo apt-get install -y qtbase5-dev libtelepathy-qt5-dev libphonenumber-dev dbus-test-runner dconf-cli gnome-keyring libmission-control-plugins-dev libqt5sql5-sqlite libsqlite3-dev qt5-default sqlite3 telepathy-mission-control-5 doxygen
- sudo apt-get install -y qtbase5-dev libtelepathy-qt5-dev libphonenumber-dev dbus-test-runner dconf-cli gnome-keyring libmission-control-plugins-dev libqt5sql5-sqlite libsqlite3-dev qt5-default sqlite3 telepathy-mission-control-5 doxygen libqofono-dev

script:
- git clone https://github.com/Kaffeine/libofono-qt.git
- cd libofono-qt
- qmake && make -j4
- sudo make install
- cd ..
- mkdir build && cd build
- cmake ../
- make -j4
Expand Down
19 changes: 8 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
project(telepathy-ofono)
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.1)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
set(TELEPATHY_OFONO telepathy-ofono)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
Expand Down Expand Up @@ -31,28 +33,23 @@ IF(CMAKE_BUILD_TYPE MATCHES [cC][oO][vV][eE][rR][aA][gG][eE])
ENDIF(CMAKE_BUILD_TYPE MATCHES [cC][oO][vV][eE][rR][aA][gG][eE])

find_package(LibPhoneNumber REQUIRED)
find_package(Qt5Core)
find_package(Qt5DBus)
find_package(Qt5Network)
add_definitions(-DQT_NO_KEYWORDS)
find_package(Qt5 REQUIRED COMPONENTS Core DBus Network)

find_package(PkgConfig REQUIRED)
pkg_check_modules(TP_QT5 REQUIRED TelepathyQt5)
pkg_check_modules(SQLITE3 REQUIRED sqlite3)
pkg_check_modules(MC_PLUGINS REQUIRED mission-control-plugins)
pkg_check_modules(OFONO_QT REQUIRED ofono-qt)
pkg_check_modules(QOFONO REQUIRED qofono-qt5)

find_program(DBUS_RUNNER dbus-test-runner)

set(CMAKE_AUTOMOC ON)

include_directories(${TP_QT5_INCLUDE_DIRS})
include_directories(${Qt5Core_INCLUDE_DIRS})
include_directories(${Qt5DBus_INCLUDE_DIRS})
include_directories(${SQLITE3_INCLUDE_DIRS})
include_directories(${LibPhoneNumber_INCLUDE_DIRS})
include_directories(/usr/include/telepathy-qt5/)
include_directories(${OFONO_QT_INCLUDE_DIRS})
include_directories(${QOFONO_INCLUDE_DIRS})

find_library(TELEPATHY_QT5_LIBRARIES telepathy-qt5)
find_library(TELEPATHY_QT5_SERVICE_LIBRARIES telepathy-qt5-service)
Expand Down Expand Up @@ -95,7 +92,7 @@ add_dependencies(${TELEPATHY_OFONO} schema_update qrc_update)

enable_testing()

target_link_libraries(${TELEPATHY_OFONO} ${Qt5Core_LIBRARIES} ${Qt5DBus_LIBRARIES} -ltelepathy-qt5 ${TELEPATHY_QT5_SERVICE_LIBRARIES} ${Qt5Network_LIBRARIES} ${OFONO_QT_LIBRARIES} ${SQLITE3_LIBRARIES} ${LibPhoneNumber_LIBRARIES})
target_link_libraries(${TELEPATHY_OFONO} Qt5::Core Qt5::DBus -ltelepathy-qt5 ${TELEPATHY_QT5_SERVICE_LIBRARIES} Qt5::Network ${SQLITE3_LIBRARIES} ${LibPhoneNumber_LIBRARIES} ${QOFONO_LIBRARIES})
install(TARGETS ${TELEPATHY_OFONO} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR})

configure_file(ofono.service.in org.freedesktop.Telepathy.ConnectionManager.ofono.service)
Expand Down
209 changes: 106 additions & 103 deletions connection.cpp

Large diffs are not rendered by default.

55 changes: 28 additions & 27 deletions connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,20 @@
#include <TelepathyQt/AbstractAdaptor>
#include <TelepathyQt/DBusError>

// ofono-qt
#include <ofonomodem.h>
#include <ofonomodemmanager.h>
#include <ofonomessagemanager.h>
#include <ofonovoicecallmanager.h>
#include <ofonovoicecall.h>
#include <ofonocallvolume.h>
#include <ofononetworkregistration.h>
#include <ofonomessagewaiting.h>
#include <ofonosupplementaryservices.h>
#include <ofonosimmanager.h>

// telepathy-ofono
// qofono
#include <qofonovoicecallmanager.h>
#include <qofonocallvolume.h>
#include <qofonomanager.h>
#include <qofonomessagemanager.h>
#include <qofonomessagewaiting.h>
#include <qofonomodem.h>
#include <qofononetworkregistration.h>
#include <qofonosupplementaryservices.h>
#include <qofonosimmanager.h>


// telepathy-ofono

#include "ofonotextchannel.h"
#include "ofonocallchannel.h"
#include "emergencymodeiface.h"
Expand All @@ -50,7 +51,7 @@
#include "ussdiface.h"


class oFonoConnection;
//class oFonoConnection;
class oFonoTextChannel;
class oFonoCallChannel;
class oFonoConferenceCallChannel;
Expand Down Expand Up @@ -90,9 +91,9 @@ class oFonoConnection : public Tp::BaseConnection
uint newHandle(const QString &identifier);
uint newGroupHandle(const QString &identifier);

OfonoMessageManager *messageManager();
OfonoVoiceCallManager *voiceCallManager();
OfonoCallVolume *callVolume();
QOfonoMessageManager *messageManager();
QOfonoVoiceCallManager *voiceCallManager();
QOfonoCallVolume *callVolume();
QMap<QString, oFonoCallChannel*> callChannels();

uint ensureHandle(const QString &phoneNumber);
Expand All @@ -119,7 +120,7 @@ class oFonoConnection : public Tp::BaseConnection
private Q_SLOTS:
void onOfonoIncomingMessage(const QString &message, const QVariantMap &info);
void onOfonoImmediateMessage(const QString &message, const QVariantMap &info);
void onOfonoCallAdded(const QString &call, const QVariantMap &properties);
void onOfonoCallAdded(const QString &call);//, const QVariantMap &properties);
void onTextChannelClosed();
void onCallChannelClosed();
void onCallChannelDestroyed();
Expand Down Expand Up @@ -153,15 +154,15 @@ private Q_SLOTS:
QMap<QString, oFonoCallChannel*> mCallChannels;

QStringList mModems;
OfonoModemManager *mOfonoModemManager;
OfonoMessageManager *mOfonoMessageManager;
OfonoVoiceCallManager *mOfonoVoiceCallManager;
OfonoCallVolume *mOfonoCallVolume;
OfonoNetworkRegistration *mOfonoNetworkRegistration;
OfonoMessageWaiting *mOfonoMessageWaiting;
OfonoSupplementaryServices *mOfonoSupplementaryServices;
OfonoSimManager *mOfonoSimManager;
OfonoModem *mOfonoModem;
QOfonoManager *mOfonoManager;
QOfonoMessageManager *mOfonoMessageManager;
QOfonoVoiceCallManager *mOfonoVoiceCallManager;
QOfonoCallVolume *mOfonoCallVolume;
QOfonoNetworkRegistration *mOfonoNetworkRegistration;
QOfonoMessageWaiting *mOfonoMessageWaiting;
QOfonoSupplementaryServices *mOfonoSupplementaryServices;
QOfonoSimManager *mOfonoSimManager;
QOfonoModem *mOfonoModem;
Tp::SimplePresence mSelfPresence;
MMSDManager *mMmsdManager;
QMap<QString, MMSDService*> mMmsdServices;
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Build-Depends: cmake,
dconf-cli,
gnome-keyring,
libmission-control-plugins-dev (>= 1:5.14.0),
libofono-qt-dev (>= 1.5),
libqofono-dev (>= 0.90),
libphonenumber-dev,
libqt5sql5-sqlite,
libtelepathy-qt5-dev (>= 0.9.3),
Expand Down
4 changes: 2 additions & 2 deletions emergencymodeiface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ ConnectionInterfaceEmergencyModeAdaptor::~ConnectionInterfaceEmergencyModeAdapto

QStringList ConnectionInterfaceEmergencyModeAdaptor::EmergencyNumbers(const QDBusMessage& dbusMessage)
{
if (!adaptee()->metaObject()->indexOfMethod("emergencyNumbers(ConnectionInterfaceEmergencyModeAdaptor::EmergencyNumbersContextPtr)") == -1) {
if (adaptee()->metaObject()->indexOfMethod("emergencyNumbers(ConnectionInterfaceEmergencyModeAdaptor::EmergencyNumbersContextPtr)") == -1) {
dbusConnection().send(dbusMessage.createErrorReply(TP_QT_ERROR_NOT_IMPLEMENTED, QLatin1String("Not implemented")));
return QStringList();
}
Expand All @@ -150,7 +150,7 @@ QStringList ConnectionInterfaceEmergencyModeAdaptor::EmergencyNumbers(const QDBu

QString ConnectionInterfaceEmergencyModeAdaptor::CountryCode(const QDBusMessage& dbusMessage)
{
if (!adaptee()->metaObject()->indexOfMethod("countryCode(ConnectionInterfaceEmergencyModeAdaptor::CountryCodeContextPtr)") == -1) {
if (adaptee()->metaObject()->indexOfMethod("countryCode(ConnectionInterfaceEmergencyModeAdaptor::CountryCodeContextPtr)") == -1) {
dbusConnection().send(dbusMessage.createErrorReply(TP_QT_ERROR_NOT_IMPLEMENTED, QLatin1String("Not implemented")));
return QString();
}
Expand Down
38 changes: 20 additions & 18 deletions ofonocallchannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


oFonoCallChannel::oFonoCallChannel(oFonoConnection *conn, QString phoneNumber, uint targetHandle, QString voiceObj, QObject *parent):
OfonoVoiceCall(voiceObj),
QOfonoVoiceCall(parent),
mIncoming(false),
mRequestedHangup(false),
mConnection(conn),
Expand All @@ -30,6 +30,8 @@ oFonoCallChannel::oFonoCallChannel(oFonoConnection *conn, QString phoneNumber, u
mMultiparty(false)

{
setVoiceCallPath(voiceObj);

Tp::BaseChannelPtr baseChannel = Tp::BaseChannel::create(mConnection, TP_QT_IFACE_CHANNEL_TYPE_CALL, Tp::HandleTypeContact, targetHandle);
Tp::BaseChannelCallTypePtr callType = Tp::BaseChannelCallType::create(baseChannel.data(),
true,
Expand Down Expand Up @@ -57,10 +59,10 @@ oFonoCallChannel::oFonoCallChannel(oFonoConnection *conn, QString phoneNumber, u
mCallChannel->setHangupCallback(Tp::memFun(this,&oFonoCallChannel::onHangup));
mCallChannel->setAcceptCallback(Tp::memFun(this,&oFonoCallChannel::onAccept));

QObject::connect(this, SIGNAL(hangupComplete(bool)), this, SLOT(onHangupComplete(bool)));
QObject::connect(this, SIGNAL(answerComplete(bool)), this, SLOT(onAnswerComplete(bool)));
QObject::connect(this, &oFonoCallChannel::hangupComplete, this, &oFonoCallChannel::onHangupComplete);
QObject::connect(this, &oFonoCallChannel::answerComplete, this, &oFonoCallChannel::onAnswerComplete);
// init must be called after initialization, otherwise we will have no object path registered.
QTimer::singleShot(0, this, SLOT(init()));
QTimer::singleShot(0, this, &oFonoCallChannel::init);
}

Tp::CallState oFonoCallChannel::callState()
Expand All @@ -70,20 +72,20 @@ Tp::CallState oFonoCallChannel::callState()

void oFonoCallChannel::onSplit(Tp::DBusError *error)
{
mConnection->voiceCallManager()->privateChat(path());
mConnection->voiceCallManager()->privateChat(voiceCallPath());
}

void oFonoCallChannel::onHangupComplete(bool status)
{
if (!status) {
QTimer::singleShot(2000, this, SLOT(hangup()));
QTimer::singleShot(2000, this, &oFonoCallChannel::hangup);
}
}

void oFonoCallChannel::onAnswerComplete(bool status)
{
if (!status) {
QTimer::singleShot(1000, this, SLOT(answer()));
QTimer::singleShot(1000, this, &oFonoCallChannel::answer);
}
}

Expand Down Expand Up @@ -148,13 +150,13 @@ void oFonoCallChannel::init()
mCallChannel->setMembersFlags(memberFlags, identifiers, Tp::UIntList(), reason);

mCallChannel->setCallState(Tp::CallStateInitialised, 0, reason, stateDetails);
QObject::connect(mBaseChannel.data(), SIGNAL(closed()), this, SLOT(deleteLater()));
QObject::connect(mConnection->callVolume(), SIGNAL(mutedChanged(bool)), SLOT(onOfonoMuteChanged(bool)));
QObject::connect(this, SIGNAL(stateChanged(QString)), SLOT(onOfonoCallStateChanged(QString)));
QObject::connect(mConnection->voiceCallManager(), SIGNAL(sendTonesComplete(bool)), SLOT(onDtmfComplete(bool)));
QObject::connect(this, SIGNAL(multipartyChanged(bool)), this, SLOT(onMultipartyChanged(bool)));
QObject::connect(mBaseChannel.data(), &Tp::BaseChannel::closed, this, &oFonoCallChannel::deleteLater);
QObject::connect(mConnection->callVolume(), &QOfonoCallVolume::mutedChanged, this, &oFonoCallChannel::onOfonoMuteChanged);
QObject::connect(this, &oFonoCallChannel::stateChanged, this, &oFonoCallChannel::onOfonoCallStateChanged);
QObject::connect(mConnection->voiceCallManager(), &QOfonoVoiceCallManager::sendTonesComplete, this, &oFonoCallChannel::onDtmfComplete);
QObject::connect(this, &oFonoCallChannel::multipartyChanged, this, &oFonoCallChannel::onMultipartyChanged);

QObject::connect(this, SIGNAL(disconnectReason(const QString &)), this, SLOT(onDisconnectReason(const QString &)));
QObject::connect(this, &oFonoCallChannel::disconnectReason, this, &oFonoCallChannel::onDisconnectReason);
}

void oFonoCallChannel::onDisconnectReason(const QString &reason) {
Expand All @@ -181,25 +183,25 @@ void oFonoCallChannel::onOfonoMuteChanged(bool mute)
void oFonoCallChannel::onHoldStateChanged(const Tp::LocalHoldState &state, const Tp::LocalHoldStateReason &reason, Tp::DBusError *error)
{
if (state == Tp::LocalHoldStateHeld && this->state() == "active") {
QObject::connect(mConnection->voiceCallManager(), SIGNAL(swapCallsComplete(bool)), this, SLOT(onSwapCallsComplete(bool)));
QObject::connect(mConnection->voiceCallManager(), &QOfonoVoiceCallManager::swapCallsComplete, this, &oFonoCallChannel::onSwapCallsComplete);
mConnection->voiceCallManager()->swapCalls();
mHoldIface->setHoldState(Tp::LocalHoldStatePendingHold, Tp::LocalHoldStateReasonRequested);
} else if (state == Tp::LocalHoldStateUnheld && this->state() == "held") {
QObject::connect(mConnection->voiceCallManager(), SIGNAL(swapCallsComplete(bool)), this, SLOT(onSwapCallsComplete(bool)));
QObject::connect(mConnection->voiceCallManager(), &QOfonoVoiceCallManager::swapCallsComplete, this, &oFonoCallChannel::onSwapCallsComplete);
mConnection->voiceCallManager()->swapCalls();
mHoldIface->setHoldState(Tp::LocalHoldStatePendingUnhold, Tp::LocalHoldStateReasonRequested);
}
}

void oFonoCallChannel::onSwapCallsComplete(bool success)
{
if (!success && errorName() == "org.ofono.Error.InProgress") {
QTimer::singleShot(2000, mConnection->voiceCallManager(), SLOT(swapCalls()));
if (!success /*&& errorName() == "org.ofono.Error.InProgress" TODO: PORTING */) {
QTimer::singleShot(2000, mConnection->voiceCallManager(), &QOfonoVoiceCallManager::swapCalls);
return;
}
Tp::LocalHoldState holdState = this->state() == "active" ? Tp::LocalHoldStateUnheld : Tp::LocalHoldStateHeld;
Tp::LocalHoldStateReason reason = success ? Tp::LocalHoldStateReasonRequested : Tp::LocalHoldStateReasonResourceNotAvailable;
QObject::disconnect(mConnection->voiceCallManager(), SIGNAL(swapCallsComplete(bool)), this, SLOT(onSwapCallsComplete(bool)));
QObject::disconnect(mConnection->voiceCallManager(), &QOfonoVoiceCallManager::swapCallsComplete, this, &oFonoCallChannel::onSwapCallsComplete);
mHoldIface->setHoldState(holdState, reason);
}

Expand Down
5 changes: 3 additions & 2 deletions ofonocallchannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@
#include <TelepathyQt/BaseCall>
#include <TelepathyQt/Types>

#include <ofonovoicecall.h>
// qofono
#include <qofonovoicecall.h>

#include "connection.h"

class oFonoConnection;

class oFonoCallChannel : public OfonoVoiceCall
class oFonoCallChannel : public QOfonoVoiceCall
{
Q_OBJECT
public:
Expand Down
18 changes: 9 additions & 9 deletions ofonoconferencecallchannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ void oFonoConferenceCallChannel::init()
mDTMFIface->setStartToneCallback(Tp::memFun(this,&oFonoConferenceCallChannel::onDTMFStartTone));
mDTMFIface->setStopToneCallback(Tp::memFun(this,&oFonoConferenceCallChannel::onDTMFStopTone));

QObject::connect(mBaseChannel.data(), SIGNAL(closed()), this, SLOT(deleteLater()));
QObject::connect(mConnection->callVolume(), SIGNAL(mutedChanged(bool)), SLOT(onOfonoMuteChanged(bool)));
QObject::connect(mConnection->voiceCallManager(), SIGNAL(sendTonesComplete(bool)), SLOT(onDtmfComplete(bool)));
QObject::connect(mBaseChannel.data(), &Tp::BaseChannel::closed, this, &oFonoConferenceCallChannel::deleteLater);
QObject::connect(mConnection->callVolume(), &QOfonoCallVolume::mutedChanged, this, &oFonoConferenceCallChannel::onOfonoMuteChanged);
QObject::connect(mConnection->voiceCallManager(), &QOfonoVoiceCallManager::sendTonesComplete, this, &oFonoConferenceCallChannel::onDtmfComplete);

QObject::connect(mConnection, SIGNAL(channelMerged(const QDBusObjectPath&)), this, SLOT(onChannelMerged(const QDBusObjectPath&)));
QObject::connect(mConnection, SIGNAL(channelSplitted(const QDBusObjectPath&)), this, SLOT(onChannelSplitted(const QDBusObjectPath&)));
QObject::connect(mConnection, SIGNAL(channelHangup(const QDBusObjectPath&)), this, SLOT(onChannelSplitted(const QDBusObjectPath&)));
QObject::connect(mConnection, &oFonoConnection::channelMerged, this, &oFonoConferenceCallChannel::onChannelMerged);
QObject::connect(mConnection, &oFonoConnection::channelSplitted, this, &oFonoConferenceCallChannel::onChannelSplitted);
QObject::connect(mConnection, &oFonoConnection::channelHangup, this, &oFonoConferenceCallChannel::onChannelSplitted);
}

void oFonoConferenceCallChannel::onOfonoMuteChanged(bool mute)
Expand All @@ -178,19 +178,19 @@ void oFonoConferenceCallChannel::setConferenceActive(bool active)
void oFonoConferenceCallChannel::onHoldStateChanged(const Tp::LocalHoldState &state, const Tp::LocalHoldStateReason &reason, Tp::DBusError *error)
{
if (state == Tp::LocalHoldStateHeld && mHoldIface->getHoldState() == Tp::LocalHoldStateUnheld) {
QObject::connect(mConnection->voiceCallManager(), SIGNAL(swapCallsComplete(bool)), this, SLOT(onSwapCallsComplete(bool)));
QObject::connect(mConnection->voiceCallManager(), &QOfonoVoiceCallManager::swapCallsComplete, this, &oFonoConferenceCallChannel::onSwapCallsComplete);
mHoldIface->setHoldState(Tp::LocalHoldStatePendingHold, Tp::LocalHoldStateReasonRequested);
mConnection->voiceCallManager()->swapCalls();
} else if (state == Tp::LocalHoldStateUnheld && mHoldIface->getHoldState() == Tp::LocalHoldStateHeld) {
QObject::connect(mConnection->voiceCallManager(), SIGNAL(swapCallsComplete(bool)), this, SLOT(onSwapCallsComplete(bool)));
QObject::connect(mConnection->voiceCallManager(), &QOfonoVoiceCallManager::swapCallsComplete, this, &oFonoConferenceCallChannel::onSwapCallsComplete);
mHoldIface->setHoldState(Tp::LocalHoldStatePendingUnhold, Tp::LocalHoldStateReasonRequested);
mConnection->voiceCallManager()->swapCalls();
}
}

void oFonoConferenceCallChannel::onSwapCallsComplete(bool success)
{
QObject::disconnect(mConnection->voiceCallManager(), SIGNAL(swapCallsComplete(bool)), this, SLOT(onSwapCallsComplete(bool)));
QObject::disconnect(mConnection->voiceCallManager(), &QOfonoVoiceCallManager::swapCallsComplete, this, &oFonoConferenceCallChannel::onSwapCallsComplete);
if (!success) {
// only change hold state in case of failure. Successful action will happen through setConferenceActive()
Tp::LocalHoldState holdState = mHoldIface->getHoldState() == Tp::LocalHoldStatePendingHold ? Tp::LocalHoldStateUnheld : Tp::LocalHoldStateHeld;
Expand Down
2 changes: 0 additions & 2 deletions ofonoconferencecallchannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include <TelepathyQt/BaseCall>
#include <TelepathyQt/Types>

#include <ofonovoicecall.h>

#include "connection.h"

class oFonoConnection;
Expand Down
Loading