diff --git a/dialer/plugin/tp-caller.cpp b/dialer/plugin/tp-caller.cpp index b59940f8..b73f8703 100644 --- a/dialer/plugin/tp-caller.cpp +++ b/dialer/plugin/tp-caller.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include @@ -72,7 +71,7 @@ void TpCaller::dial(const QString &number) return; } - m_callChannel = pendingChannel->channel(); + m_callChannel = Tp::CallChannelPtr(qobject_cast(pendingChannel->channel().data())); Q_EMIT callInProgressChanged(); }); }); @@ -89,13 +88,13 @@ void TpCaller::hangUp() qDebug() << "About to hangup" << m_callChannel << m_callChannel->isValid() << m_callChannel->connection(); if (m_callChannel && m_callChannel->isValid() && m_callChannel->connection()) { qDebug() << "Hanging up"; - Tp::PendingOperation *op = qobject_cast(m_callChannel.data())->hangup(); + Tp::PendingOperation *op = m_callChannel->hangup(); connect(op, &Tp::PendingOperation::finished, [=]() { if (op->isError()) { qWarning() << "Unable to hang up:" << op->errorMessage(); } qDebug() << "Channel close request complete"; - Q_EMIT callInProgressChanged(); + m_callChannel->requestClose(); }); } } diff --git a/dialer/plugin/tp-caller.h b/dialer/plugin/tp-caller.h index 55c8f773..86eab294 100644 --- a/dialer/plugin/tp-caller.h +++ b/dialer/plugin/tp-caller.h @@ -21,7 +21,7 @@ #include #include -#include +#include class TpCaller : public QObject { @@ -40,7 +40,7 @@ Q_SIGNALS: private: Tp::AccountPtr m_simAccount; - Tp::ChannelPtr m_callChannel; + Tp::CallChannelPtr m_callChannel; }; #endif // TPCALLER_H