From d6284b420a212168e24e82fb1ac135cc7bc4da16 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sat, 6 Jul 2019 18:18:27 +0200 Subject: [PATCH 01/27] fix error handling logic ! was applied before comparison to left side only and results in bool, bool is never -1, error handling was never run --- emergencymodeiface.cpp | 4 ++-- ussdiface.cpp | 6 +++--- voicemailiface.cpp | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/emergencymodeiface.cpp b/emergencymodeiface.cpp index 788746a..f5ad85d 100644 --- a/emergencymodeiface.cpp +++ b/emergencymodeiface.cpp @@ -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(); } @@ -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(); } diff --git a/ussdiface.cpp b/ussdiface.cpp index 3887243..5dc9e9f 100644 --- a/ussdiface.cpp +++ b/ussdiface.cpp @@ -256,7 +256,7 @@ ConnectionInterfaceUSSDAdaptor::~ConnectionInterfaceUSSDAdaptor() void ConnectionInterfaceUSSDAdaptor::Initiate(const QString &command, const QDBusMessage& dbusMessage) { - if (!adaptee()->metaObject()->indexOfMethod("initiate(const QString &,ConnectionInterfaceUSSDAdaptor::InitiateContextPtr)") == -1) { + if (adaptee()->metaObject()->indexOfMethod("initiate(const QString &,ConnectionInterfaceUSSDAdaptor::InitiateContextPtr)") == -1) { dbusConnection().send(dbusMessage.createErrorReply(TP_QT_ERROR_NOT_IMPLEMENTED, QLatin1String("Not implemented"))); return; } @@ -271,7 +271,7 @@ void ConnectionInterfaceUSSDAdaptor::Initiate(const QString &command, const QDBu void ConnectionInterfaceUSSDAdaptor::Respond(const QString &reply, const QDBusMessage& dbusMessage) { - if (!adaptee()->metaObject()->indexOfMethod("respond(QConnectionInterfaceUSSDAdaptor::RespondContextPtr)") == -1) { + if (adaptee()->metaObject()->indexOfMethod("respond(QConnectionInterfaceUSSDAdaptor::RespondContextPtr)") == -1) { dbusConnection().send(dbusMessage.createErrorReply(TP_QT_ERROR_NOT_IMPLEMENTED, QLatin1String("Not implemented"))); return; } @@ -286,7 +286,7 @@ void ConnectionInterfaceUSSDAdaptor::Respond(const QString &reply, const QDBusMe void ConnectionInterfaceUSSDAdaptor::Cancel(const QDBusMessage& dbusMessage) { - if (!adaptee()->metaObject()->indexOfMethod("cancel(ConnectionInterfaceUSSDAdaptor::CancelContextPtr)") == -1) { + if (adaptee()->metaObject()->indexOfMethod("cancel(ConnectionInterfaceUSSDAdaptor::CancelContextPtr)") == -1) { dbusConnection().send(dbusMessage.createErrorReply(TP_QT_ERROR_NOT_IMPLEMENTED, QLatin1String("Not implemented"))); return; } diff --git a/voicemailiface.cpp b/voicemailiface.cpp index f152a5a..20d1c42 100644 --- a/voicemailiface.cpp +++ b/voicemailiface.cpp @@ -159,7 +159,7 @@ ConnectionInterfaceVoicemailAdaptor::~ConnectionInterfaceVoicemailAdaptor() bool ConnectionInterfaceVoicemailAdaptor::VoicemailIndicator(const QDBusMessage& dbusMessage) { - if (!adaptee()->metaObject()->indexOfMethod("voicemailIndicator(ConnectionInterfaceVoicemailAdaptor::VoicemailIndicatorContextPtr)") == -1) { + if (adaptee()->metaObject()->indexOfMethod("voicemailIndicator(ConnectionInterfaceVoicemailAdaptor::VoicemailIndicatorContextPtr)") == -1) { dbusConnection().send(dbusMessage.createErrorReply(TP_QT_ERROR_NOT_IMPLEMENTED, QLatin1String("Not implemented"))); return bool(); } @@ -173,7 +173,7 @@ bool ConnectionInterfaceVoicemailAdaptor::VoicemailIndicator(const QDBusMessage& QString ConnectionInterfaceVoicemailAdaptor::VoicemailNumber(const QDBusMessage& dbusMessage) { - if (!adaptee()->metaObject()->indexOfMethod("voicemailNumber(ConnectionInterfaceVoicemailAdaptor::VoicemailNumberContextPtr)") == -1) { + if (adaptee()->metaObject()->indexOfMethod("voicemailNumber(ConnectionInterfaceVoicemailAdaptor::VoicemailNumberContextPtr)") == -1) { dbusConnection().send(dbusMessage.createErrorReply(TP_QT_ERROR_NOT_IMPLEMENTED, QLatin1String("Not implemented"))); return QString(); } @@ -187,7 +187,7 @@ QString ConnectionInterfaceVoicemailAdaptor::VoicemailNumber(const QDBusMessage& uint ConnectionInterfaceVoicemailAdaptor::VoicemailCount(const QDBusMessage& dbusMessage) { - if (!adaptee()->metaObject()->indexOfMethod("voicemailCount(ConnectionInterfaceVoicemailAdaptor::VoicemailCountContextPtr)") == -1) { + if (adaptee()->metaObject()->indexOfMethod("voicemailCount(ConnectionInterfaceVoicemailAdaptor::VoicemailCountContextPtr)") == -1) { dbusConnection().send(dbusMessage.createErrorReply(TP_QT_ERROR_NOT_IMPLEMENTED, QLatin1String("Not implemented"))); return uint(); } From 0f2b5c980d2f2d4170cc8079ab47e52c4348e2fa Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sat, 6 Jul 2019 18:23:13 +0200 Subject: [PATCH 02/27] fix: control reaches end of non-void function --- sqlitedatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlitedatabase.cpp b/sqlitedatabase.cpp index 09bddbc..6df593d 100644 --- a/sqlitedatabase.cpp +++ b/sqlitedatabase.cpp @@ -108,7 +108,7 @@ bool SQLiteDatabase::reopen() // make sure the database is up-to-date after reopening. // this is mainly required for the memory backend used for testing - createOrUpdateDatabase(); + return createOrUpdateDatabase(); } bool SQLiteDatabase::createOrUpdateDatabase() From b84082c21890be05453e1034870e550c94082bb0 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sat, 6 Jul 2019 20:49:25 +0200 Subject: [PATCH 03/27] check argc --- sqlitedatabase.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sqlitedatabase.cpp b/sqlitedatabase.cpp index 6df593d..fb818d5 100644 --- a/sqlitedatabase.cpp +++ b/sqlitedatabase.cpp @@ -33,6 +33,12 @@ Q_DECLARE_METATYPE(sqlite3*) // custom sqlite function "comparePhoneNumbers" used to compare IDs if necessary void comparePhoneNumbers(sqlite3_context *context, int argc, sqlite3_value **argv) { + if (argc < 2) { + qCritical() << "comparePhoneNumbers called with only" << argc << "arguments but requires two."; + sqlite3_result_error(context, "Not enough arguments given", 0); + return; + } + QString arg1((const char*)sqlite3_value_text(argv[0])); QString arg2((const char*)sqlite3_value_text(argv[1])); sqlite3_result_int(context, (int)PhoneUtils::comparePhoneNumbers(arg1, arg2)); From d4d65c23991b4d913b9a560c8cd554fa3fed12df Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sat, 6 Jul 2019 21:05:51 +0200 Subject: [PATCH 04/27] Modernize CMakeLists, now requires Cmake 3.1 --- CMakeLists.txt | 14 ++++++-------- tests/CMakeLists.txt | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 47c22f2..6f74406 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -31,9 +33,7 @@ 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) +find_package(Qt5 REQUIRED COMPONENTS Core DBus Network Test) add_definitions(-DQT_NO_KEYWORDS) find_package(PkgConfig REQUIRED) @@ -47,8 +47,6 @@ 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/) @@ -95,7 +93,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 ${OFONO_QT_LIBRARIES} ${SQLITE3_LIBRARIES} ${LibPhoneNumber_LIBRARIES}) install(TARGETS ${TELEPATHY_OFONO} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}) configure_file(ofono.service.in org.freedesktop.Telepathy.ConnectionManager.ofono.service) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 599916e..4a7c387 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -5,7 +5,6 @@ include_directories( macro(generate_test TESTNAME USE_DBUS) add_executable(${TESTNAME} ${ARGN} ${TESTNAME}.cpp) - qt5_use_modules(${TESTNAME} Core DBus Test) set(TEST_COMMAND ) if (${USE_DBUS}) set(TEST_COMMAND -p ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME} -p -xunitxml -p -o -p ${CMAKE_BINARY_DIR}/test_${TESTNAME}.xml) @@ -34,6 +33,7 @@ macro(generate_test TESTNAME USE_DBUS) target_link_libraries(${TESTNAME} ${TP_QT5_LIBRARIES} ${LibPhoneNumber_LIBRARIES} + Qt5::Core Qt5::DBus Qt5::Test ) endmacro(generate_test) From 44a09298200c0299d3d26fedc5ca00bc8773109d Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sun, 7 Jul 2019 14:23:14 +0200 Subject: [PATCH 05/27] replace old-style-connect part 1 --- connection.cpp | 121 +++++++++++++++++++++---------------------------- 1 file changed, 52 insertions(+), 69 deletions(-) diff --git a/connection.cpp b/connection.cpp index faefd70..06e3edd 100644 --- a/connection.cpp +++ b/connection.cpp @@ -126,8 +126,8 @@ oFonoConnection::oFonoConnection(const QDBusConnection &dbusConnection, // init custom emergency mode interface (not provided by telepathy emergencyModeIface = BaseConnectionEmergencyModeInterface::create(); emergencyModeIface->setEmergencyNumbersCallback(Tp::memFun(this,&oFonoConnection::emergencyNumbers)); - QObject::connect(mOfonoVoiceCallManager, SIGNAL(emergencyNumbersChanged(QStringList)), - emergencyModeIface.data(), SLOT(setEmergencyNumbers(QStringList))); + QObject::connect(mOfonoVoiceCallManager, &OfonoVoiceCallManager::emergencyNumbersChanged, + emergencyModeIface.data(), &BaseConnectionEmergencyModeInterface::setEmergencyNumbers); plugInterface(Tp::AbstractConnectionInterfacePtr::dynamicCast(emergencyModeIface)); emergencyModeIface->setEmergencyNumbers(mOfonoVoiceCallManager->emergencyNumbers()); emergencyModeIface->setFakeEmergencyNumber(parameters["fakeEmergencyNumber"].toString()); @@ -190,65 +190,48 @@ oFonoConnection::oFonoConnection(const QDBusConnection &dbusConnection, << TP_QT_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE); plugInterface(Tp::AbstractConnectionInterfacePtr::dynamicCast(contactsIface)); - QObject::connect(mOfonoModem, SIGNAL(onlineChanged(bool)), SLOT(updateOnlineStatus())); - QObject::connect(mOfonoModem, SIGNAL(serialChanged(QString)), supplementaryServicesIface.data(), SLOT(setSerial(QString))); - QObject::connect(mOfonoModem, SIGNAL(interfacesChanged(QStringList)), SLOT(updateOnlineStatus())); - QObject::connect(mOfonoMessageManager, SIGNAL(incomingMessage(QString,QVariantMap)), this, SLOT(onOfonoIncomingMessage(QString,QVariantMap))); - QObject::connect(mOfonoMessageManager, SIGNAL(immediateMessage(QString,QVariantMap)), this, SLOT(onOfonoImmediateMessage(QString,QVariantMap))); - QObject::connect(mOfonoMessageManager, SIGNAL(statusReport(QString,QVariantMap)), this, SLOT(onDeliveryReportReceived(QString,QVariantMap))); - QObject::connect(mOfonoVoiceCallManager, SIGNAL(callAdded(QString,QVariantMap)), SLOT(onOfonoCallAdded(QString, QVariantMap))); + QObject::connect(mOfonoModem, &OfonoModem::onlineChanged, this, &oFonoConnection::updateOnlineStatus); + QObject::connect(mOfonoModem, &OfonoModem::serialChanged, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::setSerial); + QObject::connect(mOfonoModem, &OfonoModem::interfacesChanged, this, &oFonoConnection::updateOnlineStatus); + QObject::connect(mOfonoMessageManager, &OfonoMessageManager::incomingMessage, this, &oFonoConnection::onOfonoIncomingMessage); + QObject::connect(mOfonoMessageManager, &OfonoMessageManager::immediateMessage, this, &oFonoConnection::onOfonoImmediateMessage); + QObject::connect(mOfonoMessageManager, &OfonoMessageManager::statusReport, this, &oFonoConnection::onDeliveryReportReceived); + QObject::connect(mOfonoVoiceCallManager, &OfonoVoiceCallManager::callAdded, this, &oFonoConnection::onOfonoCallAdded); + /// \TODO: this is actually a misnamed slot in ofono-qt/OfonoVoiceCallManager QObject::connect(mOfonoVoiceCallManager, SIGNAL(validityChanged(bool)), SLOT(onValidityChanged(bool))); - QObject::connect(mOfonoSimManager, SIGNAL(validityChanged(bool)), SLOT(onValidityChanged(bool))); - QObject::connect(mOfonoSimManager, SIGNAL(presenceChanged(bool)), SLOT(updateOnlineStatus())); - QObject::connect(mOfonoSimManager, SIGNAL(pinRequiredChanged(QString)), SLOT(updateOnlineStatus())); - QObject::connect(mOfonoSimManager, SIGNAL(subscriberNumbersChanged(QStringList)), SLOT(updateOnlineStatus())); - QObject::connect(mOfonoNetworkRegistration, SIGNAL(statusChanged(QString)), SLOT(updateOnlineStatus())); - QObject::connect(mOfonoNetworkRegistration, SIGNAL(nameChanged(QString)), SLOT(updateOnlineStatus())); - QObject::connect(mOfonoNetworkRegistration, SIGNAL(mccChanged(QString)), SLOT(updateOnlineStatus(QString))); - QObject::connect(mOfonoNetworkRegistration, SIGNAL(validityChanged(bool)), SLOT(onValidityChanged(bool))); - QObject::connect(mOfonoMessageWaiting, SIGNAL(voicemailMessageCountChanged(int)), voicemailIface.data(), SLOT(setVoicemailCount(int))); - QObject::connect(mOfonoMessageWaiting, SIGNAL(voicemailWaitingChanged(bool)), voicemailIface.data(), SLOT(setVoicemailIndicator(bool))); - QObject::connect(mOfonoMessageWaiting, SIGNAL(voicemailMailboxNumberChanged(QString)), voicemailIface.data(), SLOT(setVoicemailNumber(QString))); - - QObject::connect(mMmsdManager, SIGNAL(serviceAdded(const QString&)), SLOT(onMMSDServiceAdded(const QString&))); - QObject::connect(mMmsdManager, SIGNAL(serviceRemoved(const QString&)), SLOT(onMMSDServiceRemoved(const QString&))); - - QObject::connect(mOfonoSupplementaryServices, SIGNAL(notificationReceived(const QString &)), supplementaryServicesIface.data(), SLOT(NotificationReceived(const QString &))); - QObject::connect(mOfonoSupplementaryServices, SIGNAL(requestReceived(const QString &)), supplementaryServicesIface.data(), SLOT(RequestReceived(const QString &))); - - QObject::connect(mOfonoSupplementaryServices, SIGNAL(initiateUSSDComplete(const QString &)), supplementaryServicesIface.data(), SLOT(InitiateUSSDComplete(const QString &))); - - QObject::connect(mOfonoSupplementaryServices, SIGNAL(barringComplete(const QString &, const QString &, const QVariantMap &)), - supplementaryServicesIface.data(), SLOT(BarringComplete(const QString &, const QString &, const QVariantMap &))); - - QObject::connect(mOfonoSupplementaryServices, SIGNAL(forwardingComplete(const QString &, const QString &, const QVariantMap &)), - supplementaryServicesIface.data(), SLOT(ForwardingComplete(const QString &, const QString &, const QVariantMap &))); - - QObject::connect(mOfonoSupplementaryServices, SIGNAL(waitingComplete(const QString &, const QVariantMap &)), - supplementaryServicesIface.data(), SLOT(WaitingComplete(const QString &, const QVariantMap &))); - - QObject::connect(mOfonoSupplementaryServices, SIGNAL(callingLinePresentationComplete(const QString &, const QString &)), - supplementaryServicesIface.data(), SLOT(CallingLinePresentationComplete(const QString &, const QString &))); - - QObject::connect(mOfonoSupplementaryServices, SIGNAL(connectedLinePresentationComplete(const QString &, const QString &)), - supplementaryServicesIface.data(), SLOT(ConnectedLinePresentationComplete(const QString &, const QString &))); - - QObject::connect(mOfonoSupplementaryServices, SIGNAL(callingLineRestrictionComplete(const QString &, const QString &)), - supplementaryServicesIface.data(), SLOT(CallingLineRestrictionComplete(const QString &, const QString &))); - - QObject::connect(mOfonoSupplementaryServices, SIGNAL(connectedLineRestrictionComplete(const QString &, const QString &)), - supplementaryServicesIface.data(), SLOT(ConnectedLineRestrictionComplete(const QString &, const QString &))); - - QObject::connect(mOfonoSupplementaryServices, SIGNAL(initiateFailed()), supplementaryServicesIface.data(), SLOT(InitiateFailed())); - - QObject::connect(mOfonoSupplementaryServices, SIGNAL(stateChanged(const QString&)), supplementaryServicesIface.data(), SLOT(StateChanged(const QString&))); - - QObject::connect(mOfonoSupplementaryServices, SIGNAL(respondComplete(bool, const QString &)), supplementaryServicesIface.data(), SLOT(RespondComplete(bool, const QString &))); - - QObject::connect(this, SIGNAL(disconnected()), this, SLOT(onDisconnected())); + QObject::connect(mOfonoSimManager, &OfonoSimManager::validityChanged, this, &oFonoConnection::onValidityChanged); + QObject::connect(mOfonoSimManager, &OfonoSimManager::presenceChanged, this, &oFonoConnection::updateOnlineStatus); + QObject::connect(mOfonoSimManager, &OfonoSimManager::pinRequiredChanged, this, &oFonoConnection::updateOnlineStatus); + QObject::connect(mOfonoSimManager, &OfonoSimManager::subscriberNumbersChanged, this, &oFonoConnection::updateOnlineStatus); + QObject::connect(mOfonoNetworkRegistration, &OfonoNetworkRegistration::statusChanged, this, &oFonoConnection::updateOnlineStatus); + QObject::connect(mOfonoNetworkRegistration, &OfonoNetworkRegistration::nameChanged, this, &oFonoConnection::updateOnlineStatus); + QObject::connect(mOfonoNetworkRegistration, &OfonoNetworkRegistration::mccChanged, this, &oFonoConnection::updateOnlineStatus); + QObject::connect(mOfonoNetworkRegistration, &OfonoNetworkRegistration::validityChanged, this, &oFonoConnection::onValidityChanged); + QObject::connect(mOfonoMessageWaiting, &OfonoMessageWaiting::voicemailMessageCountChanged, voicemailIface.data(), &BaseConnectionVoicemailInterface::setVoicemailCount); + QObject::connect(mOfonoMessageWaiting, &OfonoMessageWaiting::voicemailWaitingChanged, voicemailIface.data(), &BaseConnectionVoicemailInterface::setVoicemailIndicator); + QObject::connect(mOfonoMessageWaiting, &OfonoMessageWaiting::voicemailMailboxNumberChanged, voicemailIface.data(), &BaseConnectionVoicemailInterface::setVoicemailNumber); + + QObject::connect(mMmsdManager, &MMSDManager::serviceAdded, this, &oFonoConnection::onMMSDServiceAdded); + QObject::connect(mMmsdManager, &MMSDManager::serviceRemoved, this, &oFonoConnection::onMMSDServiceRemoved); + + QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::notificationReceived, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::NotificationReceived); + QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::requestReceived, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::RequestReceived); + QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::initiateUSSDComplete, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::InitiateUSSDComplete); + QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::barringComplete, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::BarringComplete); + QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::forwardingComplete, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::ForwardingComplete); + QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::waitingComplete, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::WaitingComplete); + QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::callingLinePresentationComplete, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::CallingLinePresentationComplete); + QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::connectedLinePresentationComplete, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::ConnectedLinePresentationComplete); + QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::callingLineRestrictionComplete, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::CallingLineRestrictionComplete); + QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::connectedLineRestrictionComplete, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::ConnectedLineRestrictionComplete); + QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::initiateFailed, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::InitiateFailed); + QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::stateChanged, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::StateChanged); + QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::respondComplete, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::RespondComplete); + + QObject::connect(this, &oFonoConnection::disconnected, this, &oFonoConnection::onDisconnected); // workaround: we can't add services here as tp-ofono interfaces are not exposed on dbus // todo: use QDBusServiceWatcher - QTimer::singleShot(1000, this, SLOT(onCheckMMSServices())); + QTimer::singleShot(1000, this, &oFonoConnection::onCheckMMSServices); } void oFonoConnection::onDisconnected() @@ -290,8 +273,8 @@ void oFonoConnection::onMMSDServiceAdded(const QString &path) } qDebug() << "oFonoConnection::onMMSServiceAdded" << path; mMmsdServices[path] = service; - QObject::connect(service, SIGNAL(messageAdded(const QString&, const QVariantMap&)), SLOT(onMMSAdded(const QString&, const QVariantMap&))); - QObject::connect(service, SIGNAL(messageRemoved(const QString&)), SLOT(onMMSRemoved(const QString&))); + QObject::connect(service, &MMSDService::messageAdded, this, &oFonoConnection::onMMSAdded); + QObject::connect(service, &MMSDService::messageRemoved, this, &oFonoConnection::onMMSRemoved); Q_FOREACH(MessageStruct message, service->messages()) { addMMSToService(message.path.path(), message.properties, service->path()); } @@ -784,8 +767,8 @@ Tp::BaseChannelPtr oFonoConnection::createTextChannel(const QVariantMap &request channel = new oFonoTextChannel(this, QString(), phoneNumbers, flash); } mTextChannels << channel; - QObject::connect(channel, SIGNAL(messageRead(QString)), SLOT(onMessageRead(QString))); - QObject::connect(channel, SIGNAL(destroyed()), SLOT(onTextChannelClosed())); + QObject::connect(channel, &oFonoTextChannel::messageRead, this, &oFonoConnection::onMessageRead); + QObject::connect(channel, &oFonoTextChannel::destroyed, this, &oFonoConnection::onTextChannelClosed); return channel->baseChannel(); } @@ -846,7 +829,7 @@ Tp::BaseChannelPtr oFonoConnection::createCallChannel(const QVariantMap &request QList channels = mOfonoVoiceCallManager->createMultiparty(); if (!channels.isEmpty()) { mConferenceCall = new oFonoConferenceCallChannel(this); - QObject::connect(mConferenceCall, SIGNAL(destroyed()), SLOT(onConferenceCallChannelClosed())); + QObject::connect(mConferenceCall, &oFonoConferenceCallChannel::destroyed, this, &oFonoConnection::onConferenceCallChannelClosed); mConferenceCall->baseChannel()->setInitiatorHandle(initiatorHandle); return mConferenceCall->baseChannel(); } @@ -873,12 +856,12 @@ Tp::BaseChannelPtr oFonoConnection::createCallChannel(const QVariantMap &request oFonoCallChannel *channel = new oFonoCallChannel(this, newPhoneNumber, targetHandle, objpath.path()); channel->baseChannel()->setInitiatorHandle(initiatorHandle); mCallChannels[objpath.path()] = channel; - QObject::connect(channel, SIGNAL(destroyed()), SLOT(onCallChannelDestroyed())); - QObject::connect(channel, SIGNAL(closed()), SLOT(onCallChannelClosed())); - QObject::connect(channel, SIGNAL(merged()), SLOT(onCallChannelMerged())); - QObject::connect(channel, SIGNAL(splitted()), SLOT(onCallChannelSplitted())); - QObject::connect(channel, SIGNAL(multipartyCallHeld()), SLOT(onMultipartyCallHeld())); - QObject::connect(channel, SIGNAL(multipartyCallActive()), SLOT(onMultipartyCallActive())); + QObject::connect(channel, &oFonoCallChannel::destroyed, this, &oFonoConnection::onCallChannelDestroyed); + QObject::connect(channel, &oFonoCallChannel::closed, this, &oFonoConnection::onCallChannelClosed); + QObject::connect(channel, &oFonoCallChannel::merged, this, &oFonoConnection::onCallChannelMerged); + QObject::connect(channel, &oFonoCallChannel::splitted, this, &oFonoConnection::onCallChannelSplitted); + QObject::connect(channel, &oFonoCallChannel::multipartyCallHeld, this, &oFonoConnection::onMultipartyCallHeld); + QObject::connect(channel, &oFonoCallChannel::multipartyCallActive, this, &oFonoConnection::onMultipartyCallActive); qDebug() << channel; return channel->baseChannel(); } From 43d4922b1e973b42419c7098f7a596175416f208 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sun, 7 Jul 2019 14:38:39 +0200 Subject: [PATCH 06/27] replace old-style-connect part 2 --- ofonocallchannel.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ofonocallchannel.cpp b/ofonocallchannel.cpp index 10402a6..64ee267 100644 --- a/ofonocallchannel.cpp +++ b/ofonocallchannel.cpp @@ -57,10 +57,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() @@ -76,14 +76,14 @@ void oFonoCallChannel::onSplit(Tp::DBusError *error) 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); } } @@ -148,13 +148,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(), &OfonoCallVolume::mutedChanged, this, &oFonoCallChannel::onOfonoMuteChanged); + QObject::connect(this, &oFonoCallChannel::stateChanged, this, &oFonoCallChannel::onOfonoCallStateChanged); + QObject::connect(mConnection->voiceCallManager(), &OfonoVoiceCallManager::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) { @@ -181,11 +181,11 @@ 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(), &OfonoVoiceCallManager::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(), &OfonoVoiceCallManager::swapCallsComplete, this, &oFonoCallChannel::onSwapCallsComplete); mConnection->voiceCallManager()->swapCalls(); mHoldIface->setHoldState(Tp::LocalHoldStatePendingUnhold, Tp::LocalHoldStateReasonRequested); } @@ -194,12 +194,12 @@ void oFonoCallChannel::onHoldStateChanged(const Tp::LocalHoldState &state, const void oFonoCallChannel::onSwapCallsComplete(bool success) { if (!success && errorName() == "org.ofono.Error.InProgress") { - QTimer::singleShot(2000, mConnection->voiceCallManager(), SLOT(swapCalls())); + QTimer::singleShot(2000, mConnection->voiceCallManager(), &OfonoVoiceCallManager::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(), &OfonoVoiceCallManager::swapCallsComplete, this, &oFonoCallChannel::onSwapCallsComplete); mHoldIface->setHoldState(holdState, reason); } From 7dfe650bfa66db2370a7ac229f8480786dd0aa16 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sun, 7 Jul 2019 14:51:03 +0200 Subject: [PATCH 07/27] replace old-style-connect part 3 --- ofonoconferencecallchannel.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ofonoconferencecallchannel.cpp b/ofonoconferencecallchannel.cpp index 07a08b3..3b836df 100644 --- a/ofonoconferencecallchannel.cpp +++ b/ofonoconferencecallchannel.cpp @@ -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(), &OfonoCallVolume::mutedChanged, this, &oFonoConferenceCallChannel::onOfonoMuteChanged); + QObject::connect(mConnection->voiceCallManager(), &OfonoVoiceCallManager::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) @@ -178,11 +178,11 @@ 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(), &OfonoVoiceCallManager::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(), &OfonoVoiceCallManager::swapCallsComplete, this, &oFonoConferenceCallChannel::onSwapCallsComplete); mHoldIface->setHoldState(Tp::LocalHoldStatePendingUnhold, Tp::LocalHoldStateReasonRequested); mConnection->voiceCallManager()->swapCalls(); } @@ -190,7 +190,7 @@ void oFonoConferenceCallChannel::onHoldStateChanged(const Tp::LocalHoldState &st void oFonoConferenceCallChannel::onSwapCallsComplete(bool success) { - QObject::disconnect(mConnection->voiceCallManager(), SIGNAL(swapCallsComplete(bool)), this, SLOT(onSwapCallsComplete(bool))); + QObject::disconnect(mConnection->voiceCallManager(), &OfonoVoiceCallManager::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; From 0155545699c03233d2088f7eee1c65104eaca0b1 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sun, 7 Jul 2019 15:02:38 +0200 Subject: [PATCH 08/27] replace old-style-connect part 4 --- ofonotextchannel.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ofonotextchannel.cpp b/ofonotextchannel.cpp index c0c72f8..1c43cf5 100644 --- a/ofonotextchannel.cpp +++ b/ofonotextchannel.cpp @@ -117,7 +117,7 @@ oFonoTextChannel::oFonoTextChannel(oFonoConnection *conn, const QString &targetI mBaseChannel = baseChannel; mTextChannel = Tp::BaseChannelTextTypePtr::dynamicCast(mBaseChannel->interface(TP_QT_IFACE_CHANNEL_TYPE_TEXT)); mTextChannel->setMessageAcknowledgedCallback(Tp::memFun(this,&oFonoTextChannel::messageAcknowledged)); - QObject::connect(mBaseChannel.data(), SIGNAL(closed()), this, SLOT(deleteLater())); + QObject::connect(mBaseChannel.data(), &Tp::BaseChannel::closed, this, &oFonoTextChannel::deleteLater); } Tp::UIntList oFonoTextChannel::members() @@ -232,7 +232,7 @@ QString oFonoTextChannel::sendMessage(Tp::MessagePartList message, uint flags, T Q_FOREACH(const QString &phoneNumber, mPhoneNumbers) { QString realObjpath = mConnection->sendMMS(QStringList() << phoneNumber, attachments).path(); MMSDMessage *msg = new MMSDMessage(realObjpath, QVariantMap(), this); - QObject::connect(msg, SIGNAL(propertyChanged(QString,QVariant)), SLOT(onMMSPropertyChanged(QString,QVariant))); + QObject::connect(msg, &MMSDMessage::propertyChanged, this, &oFonoTextChannel::onMMSPropertyChanged); mPendingBroadcastMMS[realObjpath] = objpath; mPendingDeliveryReportUnknown[objpath] = handle; QTimer::singleShot(0, this, SLOT(onProcessPendingDeliveryReport())); @@ -256,7 +256,7 @@ QString oFonoTextChannel::sendMessage(Tp::MessagePartList message, uint flags, T return objpath; } MMSDMessage *msg = new MMSDMessage(objpath, QVariantMap(), this); - QObject::connect(msg, SIGNAL(propertyChanged(QString,QVariant)), SLOT(onMMSPropertyChanged(QString,QVariant))); + QObject::connect(msg, &MMSDMessage::propertyChanged, this, &oFonoTextChannel::onMMSPropertyChanged); mPendingDeliveryReportUnknown[objpath] = handle; QTimer::singleShot(0, this, SLOT(onProcessPendingDeliveryReport())); if (temporaryFiles.size() > 0) { @@ -292,7 +292,7 @@ QString oFonoTextChannel::sendMessage(Tp::MessagePartList message, uint flags, T } // FIXME: track pending messages only if delivery reports are enabled. We need a system config option for it. PendingMessagesManager::instance()->addPendingMessage(objpath, mPhoneNumbers[0]); - QObject::connect(msg, SIGNAL(stateChanged(QString)), SLOT(onOfonoMessageStateChanged(QString))); + QObject::connect(msg, &OfonoMessage::stateChanged, this, &oFonoTextChannel::onOfonoMessageStateChanged); return objpath; } else { // Broadcast sms @@ -330,7 +330,7 @@ QString oFonoTextChannel::sendMessage(Tp::MessagePartList message, uint flags, T // return only the last one in case of group chat for history purposes return objpath; } - QObject::connect(msg, SIGNAL(stateChanged(QString)), SLOT(onOfonoMessageStateChanged(QString))); + QObject::connect(msg, &OfonoMessage::stateChanged, this, &oFonoTextChannel::onOfonoMessageStateChanged); return objpath; } } From 17b4e117bc0394e3d89b8b04f12abf6df8c19529 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sun, 7 Jul 2019 22:06:10 +0200 Subject: [PATCH 09/27] Qt5::Test is only needed for tests --- CMakeLists.txt | 2 +- tests/CMakeLists.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f74406..67e0238 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,7 @@ 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(Qt5 REQUIRED COMPONENTS Core DBus Network Test) +find_package(Qt5 REQUIRED COMPONENTS Core DBus Network) add_definitions(-DQT_NO_KEYWORDS) find_package(PkgConfig REQUIRED) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4a7c387..65670cf 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -3,6 +3,8 @@ include_directories( ${CMAKE_SOURCE_DIR} ) +find_package(Qt5 REQUIRED COMPONENTS Test) + macro(generate_test TESTNAME USE_DBUS) add_executable(${TESTNAME} ${ARGN} ${TESTNAME}.cpp) set(TEST_COMMAND ) From f98ef9c56e5b2b3b87a0c54eaa4308c32f39fb93 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sun, 7 Jul 2019 22:10:13 +0200 Subject: [PATCH 10/27] check for exactly two phonenumbers in comparison --- sqlitedatabase.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sqlitedatabase.cpp b/sqlitedatabase.cpp index fb818d5..11fe8df 100644 --- a/sqlitedatabase.cpp +++ b/sqlitedatabase.cpp @@ -33,9 +33,9 @@ Q_DECLARE_METATYPE(sqlite3*) // custom sqlite function "comparePhoneNumbers" used to compare IDs if necessary void comparePhoneNumbers(sqlite3_context *context, int argc, sqlite3_value **argv) { - if (argc < 2) { - qCritical() << "comparePhoneNumbers called with only" << argc << "arguments but requires two."; - sqlite3_result_error(context, "Not enough arguments given", 0); + if (argc != 2) { + qCritical() << "comparePhoneNumbers called with " << argc << "arguments but requires two."; + sqlite3_result_error(context, "Number of arguments needs to be two", 0); return; } From d5ba4a68153e17635d29af3549f14e340e0ea9a3 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sun, 14 Jul 2019 21:41:14 +0200 Subject: [PATCH 11/27] add qofono to CMakeLists.txt --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 67e0238..32f5c04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,7 @@ 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) @@ -51,6 +52,7 @@ 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) @@ -93,7 +95,7 @@ add_dependencies(${TELEPATHY_OFONO} schema_update qrc_update) enable_testing() -target_link_libraries(${TELEPATHY_OFONO} Qt5::Core Qt5::DBus -ltelepathy-qt5 ${TELEPATHY_QT5_SERVICE_LIBRARIES} Qt5::Network ${OFONO_QT_LIBRARIES} ${SQLITE3_LIBRARIES} ${LibPhoneNumber_LIBRARIES}) +target_link_libraries(${TELEPATHY_OFONO} Qt5::Core Qt5::DBus -ltelepathy-qt5 ${TELEPATHY_QT5_SERVICE_LIBRARIES} Qt5::Network ${OFONO_QT_LIBRARIES} ${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) From d4824760e5c9932191a154117e6bda590aa82b42 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sun, 14 Jul 2019 22:32:46 +0200 Subject: [PATCH 12/27] ofonomessage -> qofonomessage --- CMakeLists.txt | 1 - ofonotextchannel.cpp | 20 +++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 32f5c04..68ce868 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,6 @@ ENDIF(CMAKE_BUILD_TYPE MATCHES [cC][oO][vV][eE][rR][aA][gG][eE]) find_package(LibPhoneNumber REQUIRED) find_package(Qt5 REQUIRED COMPONENTS Core DBus Network) -add_definitions(-DQT_NO_KEYWORDS) find_package(PkgConfig REQUIRED) pkg_check_modules(TP_QT5 REQUIRED TelepathyQt5) diff --git a/ofonotextchannel.cpp b/ofonotextchannel.cpp index 1c43cf5..b298914 100644 --- a/ofonotextchannel.cpp +++ b/ofonotextchannel.cpp @@ -17,8 +17,8 @@ * Gustavo Pichorim Boiko */ -// ofono-qt -#include +// qofono +#include // telepathy-ofono #include "ofonotextchannel.h" @@ -282,7 +282,8 @@ QString oFonoTextChannel::sendMessage(Tp::MessagePartList message, uint flags, T QTimer::singleShot(0, this, SLOT(onProcessPendingDeliveryReport())); return objpath; } - OfonoMessage *msg = new OfonoMessage(objpath); + QOfonoMessage *msg = new QOfonoMessage(this); + msg->setMessagePath(objpath); if (msg->state() == "") { // message was already sent or failed too fast (this case is only reproducible with the emulator) msg->deleteLater(); @@ -292,7 +293,7 @@ QString oFonoTextChannel::sendMessage(Tp::MessagePartList message, uint flags, T } // FIXME: track pending messages only if delivery reports are enabled. We need a system config option for it. PendingMessagesManager::instance()->addPendingMessage(objpath, mPhoneNumbers[0]); - QObject::connect(msg, &OfonoMessage::stateChanged, this, &oFonoTextChannel::onOfonoMessageStateChanged); + QObject::connect(msg, &QOfonoMessage::stateChanged, this, &oFonoTextChannel::onOfonoMessageStateChanged); return objpath; } else { // Broadcast sms @@ -320,7 +321,8 @@ QString oFonoTextChannel::sendMessage(Tp::MessagePartList message, uint flags, T QTimer::singleShot(0, this, SLOT(onProcessPendingDeliveryReport())); return objpath; } - OfonoMessage *msg = new OfonoMessage(objpath); + QOfonoMessage *msg = new QOfonoMessage(this); + msg->setMessagePath(objpath); if (msg->state() == "") { // message was already sent or failed too fast (this case is only reproducible with the emulator) msg->deleteLater(); @@ -330,7 +332,7 @@ QString oFonoTextChannel::sendMessage(Tp::MessagePartList message, uint flags, T // return only the last one in case of group chat for history purposes return objpath; } - QObject::connect(msg, &OfonoMessage::stateChanged, this, &oFonoTextChannel::onOfonoMessageStateChanged); + QObject::connect(msg, &QOfonoMessage::stateChanged, this, &oFonoTextChannel::onOfonoMessageStateChanged); return objpath; } } @@ -430,7 +432,7 @@ void oFonoTextChannel::onProcessPendingDeliveryReport() void oFonoTextChannel::onOfonoMessageStateChanged(QString status) { - OfonoMessage *msg = static_cast(sender()); + QOfonoMessage *msg = static_cast(sender()); if(msg) { Tp::DeliveryStatus delivery_status; if (status == "sent") { @@ -438,7 +440,7 @@ void oFonoTextChannel::onOfonoMessageStateChanged(QString status) msg->deleteLater(); } else if(status == "failed") { delivery_status = Tp::DeliveryStatusPermanentlyFailed; - PendingMessagesManager::instance()->removePendingMessage(msg->path()); + PendingMessagesManager::instance()->removePendingMessage(msg->messagePath()); msg->deleteLater(); } else if(status == "pending") { delivery_status = Tp::DeliveryStatusTemporarilyFailed; @@ -446,7 +448,7 @@ void oFonoTextChannel::onOfonoMessageStateChanged(QString status) delivery_status = Tp::DeliveryStatusUnknown; } - sendDeliveryReport(msg->path(), mConnection->ensureHandle(mPhoneNumbers[0]), delivery_status); + sendDeliveryReport(msg->messagePath(), mConnection->ensureHandle(mPhoneNumbers[0]), delivery_status); } } From 505f78b0f4a9b046b1ecea54d29bfec54345b6f2 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sun, 14 Jul 2019 22:51:28 +0200 Subject: [PATCH 13/27] ofonovoicecall -> qofonovoicecall --- ofonocallchannel.cpp | 8 +++++--- ofonocallchannel.h | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ofonocallchannel.cpp b/ofonocallchannel.cpp index 64ee267..ca34a76 100644 --- a/ofonocallchannel.cpp +++ b/ofonocallchannel.cpp @@ -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), @@ -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, @@ -70,7 +72,7 @@ Tp::CallState oFonoCallChannel::callState() void oFonoCallChannel::onSplit(Tp::DBusError *error) { - mConnection->voiceCallManager()->privateChat(path()); + mConnection->voiceCallManager()->privateChat(voiceCallPath()); } void oFonoCallChannel::onHangupComplete(bool status) @@ -193,7 +195,7 @@ void oFonoCallChannel::onHoldStateChanged(const Tp::LocalHoldState &state, const void oFonoCallChannel::onSwapCallsComplete(bool success) { - if (!success && errorName() == "org.ofono.Error.InProgress") { + if (!success /*&& errorName() == "org.ofono.Error.InProgress" TODO: PORTING */) { QTimer::singleShot(2000, mConnection->voiceCallManager(), &OfonoVoiceCallManager::swapCalls); return; } diff --git a/ofonocallchannel.h b/ofonocallchannel.h index 7361c00..364aa7d 100644 --- a/ofonocallchannel.h +++ b/ofonocallchannel.h @@ -26,13 +26,14 @@ #include #include -#include +// qofono +#include #include "connection.h" class oFonoConnection; -class oFonoCallChannel : public OfonoVoiceCall +class oFonoCallChannel : public QOfonoVoiceCall { Q_OBJECT public: From a13c1cac82af614624fdfc0c36b716fd96ad80f2 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sun, 14 Jul 2019 23:09:15 +0200 Subject: [PATCH 14/27] unused ofono-qt include --- ofonoconferencecallchannel.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/ofonoconferencecallchannel.h b/ofonoconferencecallchannel.h index c66ba4d..da15d5d 100644 --- a/ofonoconferencecallchannel.h +++ b/ofonoconferencecallchannel.h @@ -26,8 +26,6 @@ #include #include -#include - #include "connection.h" class oFonoConnection; From d4d63b6ca9c394648d1ca5c495fa9039595523a8 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sat, 27 Jul 2019 16:11:08 +0200 Subject: [PATCH 15/27] ofonomessagemanager -> QOfonoMessageManager error handling is still open todo --- connection.cpp | 14 +++++++++----- connection.h | 15 +++++++++------ ofonotextchannel.cpp | 14 ++++++++------ 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/connection.cpp b/connection.cpp index 06e3edd..a0abe14 100644 --- a/connection.cpp +++ b/connection.cpp @@ -54,7 +54,10 @@ oFonoConnection::oFonoConnection(const QDBusConnection &dbusConnection, if (!mModemPath.isEmpty()) { setting = OfonoModem::ManualSelect; } - mOfonoMessageManager = new OfonoMessageManager(setting, mModemPath); + + //TODO porting 'setting'?? was getting passed to ModemInterface + mOfonoMessageManager = new QOfonoMessageManager(this); + mOfonoMessageManager->setModemPath(mModemPath); mOfonoVoiceCallManager = new OfonoVoiceCallManager(setting, mModemPath); mOfonoCallVolume = new OfonoCallVolume(setting, mModemPath); mOfonoNetworkRegistration = new OfonoNetworkRegistration(setting, mModemPath); @@ -193,9 +196,10 @@ oFonoConnection::oFonoConnection(const QDBusConnection &dbusConnection, QObject::connect(mOfonoModem, &OfonoModem::onlineChanged, this, &oFonoConnection::updateOnlineStatus); QObject::connect(mOfonoModem, &OfonoModem::serialChanged, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::setSerial); QObject::connect(mOfonoModem, &OfonoModem::interfacesChanged, this, &oFonoConnection::updateOnlineStatus); - QObject::connect(mOfonoMessageManager, &OfonoMessageManager::incomingMessage, this, &oFonoConnection::onOfonoIncomingMessage); - QObject::connect(mOfonoMessageManager, &OfonoMessageManager::immediateMessage, this, &oFonoConnection::onOfonoImmediateMessage); - QObject::connect(mOfonoMessageManager, &OfonoMessageManager::statusReport, this, &oFonoConnection::onDeliveryReportReceived); + QObject::connect(mOfonoMessageManager, &QOfonoMessageManager::incomingMessage, this, &oFonoConnection::onOfonoIncomingMessage); + QObject::connect(mOfonoMessageManager, &QOfonoMessageManager::immediateMessage, this, &oFonoConnection::onOfonoImmediateMessage); + //TODO porting: is that equivalent to receiving a status report? + //QObject::connect(mOfonoMessageManager, &QOfonoMessageManager::sendMessageComplete, this, &oFonoConnection::onDeliveryReportReceived); QObject::connect(mOfonoVoiceCallManager, &OfonoVoiceCallManager::callAdded, this, &oFonoConnection::onOfonoCallAdded); /// \TODO: this is actually a misnamed slot in ofono-qt/OfonoVoiceCallManager QObject::connect(mOfonoVoiceCallManager, SIGNAL(validityChanged(bool)), SLOT(onValidityChanged(bool))); @@ -918,7 +922,7 @@ Tp::BaseChannelPtr oFonoConnection::createChannel(const QVariantMap &request, Tp return Tp::BaseChannelPtr(); } -OfonoMessageManager *oFonoConnection::messageManager() +QOfonoMessageManager *oFonoConnection::messageManager() { return mOfonoMessageManager; } diff --git a/connection.h b/connection.h index f0a05f8..3fe852c 100644 --- a/connection.h +++ b/connection.h @@ -27,10 +27,12 @@ #include #include +// qofono +#include +#include + // ofono-qt -#include #include -#include #include #include #include @@ -39,7 +41,8 @@ #include #include -// telepathy-ofono +// telepathy-ofono + #include "ofonotextchannel.h" #include "ofonocallchannel.h" #include "emergencymodeiface.h" @@ -50,7 +53,7 @@ #include "ussdiface.h" -class oFonoConnection; +//class oFonoConnection; class oFonoTextChannel; class oFonoCallChannel; class oFonoConferenceCallChannel; @@ -90,7 +93,7 @@ class oFonoConnection : public Tp::BaseConnection uint newHandle(const QString &identifier); uint newGroupHandle(const QString &identifier); - OfonoMessageManager *messageManager(); + QOfonoMessageManager *messageManager(); OfonoVoiceCallManager *voiceCallManager(); OfonoCallVolume *callVolume(); QMap callChannels(); @@ -154,7 +157,7 @@ private Q_SLOTS: QStringList mModems; OfonoModemManager *mOfonoModemManager; - OfonoMessageManager *mOfonoMessageManager; + QOfonoMessageManager *mOfonoMessageManager; OfonoVoiceCallManager *mOfonoVoiceCallManager; OfonoCallVolume *mOfonoCallVolume; OfonoNetworkRegistration *mOfonoNetworkRegistration; diff --git a/ofonotextchannel.cpp b/ofonotextchannel.cpp index b298914..5071742 100644 --- a/ofonotextchannel.cpp +++ b/ofonotextchannel.cpp @@ -269,8 +269,9 @@ QString oFonoTextChannel::sendMessage(Tp::MessagePartList message, uint flags, T if (mPhoneNumbers.size() == 1) { QString phoneNumber = mPhoneNumbers[0]; uint handle = mConnection->ensureHandle(phoneNumber); - objpath = mConnection->messageManager()->sendMessage(phoneNumber, body["content"].variant().toString(), success).path(); - if (objpath.isEmpty() || !success) { + /// TODO porting how does error handling work with qofono? + /*objpath = */ mConnection->messageManager()->sendMessage(phoneNumber, body["content"].variant().toString());//, success).path(); + /*if (objpath.isEmpty() || !success) { if (!success) { qWarning() << mConnection->messageManager()->errorName() << mConnection->messageManager()->errorMessage(); } else { @@ -293,24 +294,25 @@ QString oFonoTextChannel::sendMessage(Tp::MessagePartList message, uint flags, T } // FIXME: track pending messages only if delivery reports are enabled. We need a system config option for it. PendingMessagesManager::instance()->addPendingMessage(objpath, mPhoneNumbers[0]); - QObject::connect(msg, &QOfonoMessage::stateChanged, this, &oFonoTextChannel::onOfonoMessageStateChanged); + QObject::connect(msg, &QOfonoMessage::stateChanged, this, &oFonoTextChannel::onOfonoMessageStateChanged);*/ return objpath; } else { // Broadcast sms bool someMessageSent = false; QString lastPhoneNumber; Q_FOREACH(const QString &phoneNumber, mPhoneNumbers) { - objpath = mConnection->messageManager()->sendMessage(phoneNumber, body["content"].variant().toString(), success).path(); + /*objpath =*/ mConnection->messageManager()->sendMessage(phoneNumber, body["content"].variant().toString());//, success).path(); lastPhoneNumber = phoneNumber; // dont fail if this is a broadcast chat as we cannot track individual messages - if (objpath.isEmpty() || !success) { + // TODo PORTING reenable error handling + /*if (objpath.isEmpty() || !success) { if (!success) { qWarning() << mConnection->messageManager()->errorName() << mConnection->messageManager()->errorMessage(); } else { error->set(TP_QT_ERROR_INVALID_ARGUMENT, mConnection->messageManager()->errorMessage()); } continue; - } + }*/ someMessageSent = true; } if (!someMessageSent) { From 2f00c5c147a55acaa54573e0889b4374120ac2a5 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sat, 27 Jul 2019 16:15:40 +0200 Subject: [PATCH 16/27] ofonomessagewaiting -> QOfonoMessageWaiting --- connection.cpp | 10 ++++++---- connection.h | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/connection.cpp b/connection.cpp index a0abe14..b4b7869 100644 --- a/connection.cpp +++ b/connection.cpp @@ -61,7 +61,9 @@ oFonoConnection::oFonoConnection(const QDBusConnection &dbusConnection, mOfonoVoiceCallManager = new OfonoVoiceCallManager(setting, mModemPath); mOfonoCallVolume = new OfonoCallVolume(setting, mModemPath); mOfonoNetworkRegistration = new OfonoNetworkRegistration(setting, mModemPath); - mOfonoMessageWaiting = new OfonoMessageWaiting(setting, mModemPath); + /// TODO porting setting? + mOfonoMessageWaiting = new QOfonoMessageWaiting(this); + mOfonoMessageWaiting->setModemPath(mModemPath); mOfonoSupplementaryServices = new OfonoSupplementaryServices(setting, mModemPath); mOfonoSimManager = new OfonoSimManager(setting, mModemPath); mOfonoModem = mOfonoSimManager->modem(); @@ -211,9 +213,9 @@ oFonoConnection::oFonoConnection(const QDBusConnection &dbusConnection, QObject::connect(mOfonoNetworkRegistration, &OfonoNetworkRegistration::nameChanged, this, &oFonoConnection::updateOnlineStatus); QObject::connect(mOfonoNetworkRegistration, &OfonoNetworkRegistration::mccChanged, this, &oFonoConnection::updateOnlineStatus); QObject::connect(mOfonoNetworkRegistration, &OfonoNetworkRegistration::validityChanged, this, &oFonoConnection::onValidityChanged); - QObject::connect(mOfonoMessageWaiting, &OfonoMessageWaiting::voicemailMessageCountChanged, voicemailIface.data(), &BaseConnectionVoicemailInterface::setVoicemailCount); - QObject::connect(mOfonoMessageWaiting, &OfonoMessageWaiting::voicemailWaitingChanged, voicemailIface.data(), &BaseConnectionVoicemailInterface::setVoicemailIndicator); - QObject::connect(mOfonoMessageWaiting, &OfonoMessageWaiting::voicemailMailboxNumberChanged, voicemailIface.data(), &BaseConnectionVoicemailInterface::setVoicemailNumber); + QObject::connect(mOfonoMessageWaiting, &QOfonoMessageWaiting::voicemailMessageCountChanged, voicemailIface.data(), &BaseConnectionVoicemailInterface::setVoicemailCount); + QObject::connect(mOfonoMessageWaiting, &QOfonoMessageWaiting::voicemailWaitingChanged, voicemailIface.data(), &BaseConnectionVoicemailInterface::setVoicemailIndicator); + QObject::connect(mOfonoMessageWaiting, &QOfonoMessageWaiting::voicemailMailboxNumberChanged, voicemailIface.data(), &BaseConnectionVoicemailInterface::setVoicemailNumber); QObject::connect(mMmsdManager, &MMSDManager::serviceAdded, this, &oFonoConnection::onMMSDServiceAdded); QObject::connect(mMmsdManager, &MMSDManager::serviceRemoved, this, &oFonoConnection::onMMSDServiceRemoved); diff --git a/connection.h b/connection.h index 3fe852c..149e39a 100644 --- a/connection.h +++ b/connection.h @@ -30,6 +30,7 @@ // qofono #include #include +#include // ofono-qt #include @@ -37,7 +38,6 @@ #include #include #include -#include #include #include @@ -161,7 +161,7 @@ private Q_SLOTS: OfonoVoiceCallManager *mOfonoVoiceCallManager; OfonoCallVolume *mOfonoCallVolume; OfonoNetworkRegistration *mOfonoNetworkRegistration; - OfonoMessageWaiting *mOfonoMessageWaiting; + QOfonoMessageWaiting *mOfonoMessageWaiting; OfonoSupplementaryServices *mOfonoSupplementaryServices; OfonoSimManager *mOfonoSimManager; OfonoModem *mOfonoModem; From 39ae3f4a52beee51716f90648e2c2b90811a080a Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sat, 27 Jul 2019 16:46:16 +0200 Subject: [PATCH 17/27] OfonoVoiceCallManager -> QOfonoVoiceCallManager --- connection.cpp | 41 +++++++++++++++++++--------------- connection.h | 8 +++---- ofonocallchannel.cpp | 10 ++++----- ofonoconferencecallchannel.cpp | 8 +++---- 4 files changed, 36 insertions(+), 31 deletions(-) diff --git a/connection.cpp b/connection.cpp index b4b7869..6ca6d33 100644 --- a/connection.cpp +++ b/connection.cpp @@ -58,7 +58,9 @@ oFonoConnection::oFonoConnection(const QDBusConnection &dbusConnection, //TODO porting 'setting'?? was getting passed to ModemInterface mOfonoMessageManager = new QOfonoMessageManager(this); mOfonoMessageManager->setModemPath(mModemPath); - mOfonoVoiceCallManager = new OfonoVoiceCallManager(setting, mModemPath); + /// TODO porting setting? + mOfonoVoiceCallManager = new QOfonoVoiceCallManager(this); + mOfonoVoiceCallManager->setModemPath(mModemPath); mOfonoCallVolume = new OfonoCallVolume(setting, mModemPath); mOfonoNetworkRegistration = new OfonoNetworkRegistration(setting, mModemPath); /// TODO porting setting? @@ -131,7 +133,7 @@ oFonoConnection::oFonoConnection(const QDBusConnection &dbusConnection, // init custom emergency mode interface (not provided by telepathy emergencyModeIface = BaseConnectionEmergencyModeInterface::create(); emergencyModeIface->setEmergencyNumbersCallback(Tp::memFun(this,&oFonoConnection::emergencyNumbers)); - QObject::connect(mOfonoVoiceCallManager, &OfonoVoiceCallManager::emergencyNumbersChanged, + QObject::connect(mOfonoVoiceCallManager, &QOfonoVoiceCallManager::emergencyNumbersChanged, emergencyModeIface.data(), &BaseConnectionEmergencyModeInterface::setEmergencyNumbers); plugInterface(Tp::AbstractConnectionInterfacePtr::dynamicCast(emergencyModeIface)); emergencyModeIface->setEmergencyNumbers(mOfonoVoiceCallManager->emergencyNumbers()); @@ -202,7 +204,7 @@ oFonoConnection::oFonoConnection(const QDBusConnection &dbusConnection, QObject::connect(mOfonoMessageManager, &QOfonoMessageManager::immediateMessage, this, &oFonoConnection::onOfonoImmediateMessage); //TODO porting: is that equivalent to receiving a status report? //QObject::connect(mOfonoMessageManager, &QOfonoMessageManager::sendMessageComplete, this, &oFonoConnection::onDeliveryReportReceived); - QObject::connect(mOfonoVoiceCallManager, &OfonoVoiceCallManager::callAdded, this, &oFonoConnection::onOfonoCallAdded); + QObject::connect(mOfonoVoiceCallManager, &QOfonoVoiceCallManager::callAdded, this, &oFonoConnection::onOfonoCallAdded); /// \TODO: this is actually a misnamed slot in ofono-qt/OfonoVoiceCallManager QObject::connect(mOfonoVoiceCallManager, SIGNAL(validityChanged(bool)), SLOT(onValidityChanged(bool))); QObject::connect(mOfonoSimManager, &OfonoSimManager::validityChanged, this, &oFonoConnection::onValidityChanged); @@ -549,7 +551,8 @@ void oFonoConnection::onValidityChanged(bool valid) } else if (sender() == mOfonoNetworkRegistration) { Q_EMIT mOfonoNetworkRegistration->modem()->pathChanged(mOfonoModem->path()); } else if (sender() == mOfonoVoiceCallManager) { - Q_EMIT mOfonoVoiceCallManager->modem()->pathChanged(mOfonoModem->path()); + /// todo porting can this safely be removed? + //Q_EMIT mOfonoVoiceCallManager->modem()->pathChanged(mOfonoModem->path()); } QString modemSerial; if (valid) { @@ -832,21 +835,23 @@ Tp::BaseChannelPtr oFonoConnection::createCallChannel(const QVariantMap &request return Tp::BaseChannelPtr(); } - QList channels = mOfonoVoiceCallManager->createMultiparty(); - if (!channels.isEmpty()) { + // todo porting error handling + /*QList channels =*/ mOfonoVoiceCallManager->createMultiparty(); + //if (!channels.isEmpty()) { mConferenceCall = new oFonoConferenceCallChannel(this); QObject::connect(mConferenceCall, &oFonoConferenceCallChannel::destroyed, this, &oFonoConnection::onConferenceCallChannelClosed); mConferenceCall->baseChannel()->setInitiatorHandle(initiatorHandle); return mConferenceCall->baseChannel(); - } - error->set(TP_QT_ERROR_NOT_AVAILABLE, "Impossible to merge calls"); - return Tp::BaseChannelPtr(); + //} + //error->set(TP_QT_ERROR_NOT_AVAILABLE, "Impossible to merge calls"); + //return Tp::BaseChannelPtr(); } QDBusObjectPath objpath(request["ofonoObjPath"].toString()); if (objpath.path().isEmpty()) { - objpath = mOfonoVoiceCallManager->dial(newPhoneNumber, "", success); + /// todo porting error handling + /*objpath =*/ mOfonoVoiceCallManager->dial(newPhoneNumber, "");//, success); } qDebug() << "success " << success; @@ -929,7 +934,7 @@ QOfonoMessageManager *oFonoConnection::messageManager() return mOfonoMessageManager; } -OfonoVoiceCallManager *oFonoConnection::voiceCallManager() +QOfonoVoiceCallManager *oFonoConnection::voiceCallManager() { return mOfonoVoiceCallManager; } @@ -1095,13 +1100,13 @@ bool oFonoConnection::matchChannel(const Tp::BaseChannelPtr &channel, const QVar return (channelType == TP_QT_IFACE_CHANNEL_TYPE_TEXT) && BaseConnection::matchChannel(channel, request, error); } -void oFonoConnection::onOfonoCallAdded(const QString &call, const QVariantMap &properties) +void oFonoConnection::onOfonoCallAdded(const QString &call/*, const QVariantMap &properties*/) { - qDebug() << "new call" << call << properties; + qDebug() << "new call" << call;// << properties; bool yours; Tp::DBusError error; - QString lineIdentification = properties["LineIdentification"].toString(); + QString lineIdentification;// = properties["LineIdentification"].toString(); // check if there is an open channel for this call, if so, ignore it if (mCallChannels.keys().contains(call)) { @@ -1125,11 +1130,11 @@ void oFonoConnection::onOfonoCallAdded(const QString &call, const QVariantMap &p uint handle = ensureHandle(normalizedNumber); uint initiatorHandle = 0; - if (properties["State"] == "incoming" || properties["State"] == "waiting") { + //if (properties["State"] == "incoming" || properties["State"] == "waiting") { initiatorHandle = handle; - } else { - initiatorHandle = selfHandle(); - } + //} else { + // initiatorHandle = selfHandle(); + //} qDebug() << "initiatorHandle " < +#include #include #include // ofono-qt #include -#include #include #include #include @@ -94,7 +94,7 @@ class oFonoConnection : public Tp::BaseConnection uint newGroupHandle(const QString &identifier); QOfonoMessageManager *messageManager(); - OfonoVoiceCallManager *voiceCallManager(); + QOfonoVoiceCallManager *voiceCallManager(); OfonoCallVolume *callVolume(); QMap callChannels(); @@ -122,7 +122,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(); @@ -158,7 +158,7 @@ private Q_SLOTS: QStringList mModems; OfonoModemManager *mOfonoModemManager; QOfonoMessageManager *mOfonoMessageManager; - OfonoVoiceCallManager *mOfonoVoiceCallManager; + QOfonoVoiceCallManager *mOfonoVoiceCallManager; OfonoCallVolume *mOfonoCallVolume; OfonoNetworkRegistration *mOfonoNetworkRegistration; QOfonoMessageWaiting *mOfonoMessageWaiting; diff --git a/ofonocallchannel.cpp b/ofonocallchannel.cpp index ca34a76..a71575e 100644 --- a/ofonocallchannel.cpp +++ b/ofonocallchannel.cpp @@ -153,7 +153,7 @@ void oFonoCallChannel::init() QObject::connect(mBaseChannel.data(), &Tp::BaseChannel::closed, this, &oFonoCallChannel::deleteLater); QObject::connect(mConnection->callVolume(), &OfonoCallVolume::mutedChanged, this, &oFonoCallChannel::onOfonoMuteChanged); QObject::connect(this, &oFonoCallChannel::stateChanged, this, &oFonoCallChannel::onOfonoCallStateChanged); - QObject::connect(mConnection->voiceCallManager(), &OfonoVoiceCallManager::sendTonesComplete, this, &oFonoCallChannel::onDtmfComplete); + QObject::connect(mConnection->voiceCallManager(), &QOfonoVoiceCallManager::sendTonesComplete, this, &oFonoCallChannel::onDtmfComplete); QObject::connect(this, &oFonoCallChannel::multipartyChanged, this, &oFonoCallChannel::onMultipartyChanged); QObject::connect(this, &oFonoCallChannel::disconnectReason, this, &oFonoCallChannel::onDisconnectReason); @@ -183,11 +183,11 @@ 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(), &OfonoVoiceCallManager::swapCallsComplete, this, &oFonoCallChannel::onSwapCallsComplete); + 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(), &OfonoVoiceCallManager::swapCallsComplete, this, &oFonoCallChannel::onSwapCallsComplete); + QObject::connect(mConnection->voiceCallManager(), &QOfonoVoiceCallManager::swapCallsComplete, this, &oFonoCallChannel::onSwapCallsComplete); mConnection->voiceCallManager()->swapCalls(); mHoldIface->setHoldState(Tp::LocalHoldStatePendingUnhold, Tp::LocalHoldStateReasonRequested); } @@ -196,12 +196,12 @@ void oFonoCallChannel::onHoldStateChanged(const Tp::LocalHoldState &state, const void oFonoCallChannel::onSwapCallsComplete(bool success) { if (!success /*&& errorName() == "org.ofono.Error.InProgress" TODO: PORTING */) { - QTimer::singleShot(2000, mConnection->voiceCallManager(), &OfonoVoiceCallManager::swapCalls); + 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(), &OfonoVoiceCallManager::swapCallsComplete, this, &oFonoCallChannel::onSwapCallsComplete); + QObject::disconnect(mConnection->voiceCallManager(), &QOfonoVoiceCallManager::swapCallsComplete, this, &oFonoCallChannel::onSwapCallsComplete); mHoldIface->setHoldState(holdState, reason); } diff --git a/ofonoconferencecallchannel.cpp b/ofonoconferencecallchannel.cpp index 3b836df..48d9b34 100644 --- a/ofonoconferencecallchannel.cpp +++ b/ofonoconferencecallchannel.cpp @@ -153,7 +153,7 @@ void oFonoConferenceCallChannel::init() QObject::connect(mBaseChannel.data(), &Tp::BaseChannel::closed, this, &oFonoConferenceCallChannel::deleteLater); QObject::connect(mConnection->callVolume(), &OfonoCallVolume::mutedChanged, this, &oFonoConferenceCallChannel::onOfonoMuteChanged); - QObject::connect(mConnection->voiceCallManager(), &OfonoVoiceCallManager::sendTonesComplete, this, &oFonoConferenceCallChannel::onDtmfComplete); + QObject::connect(mConnection->voiceCallManager(), &QOfonoVoiceCallManager::sendTonesComplete, this, &oFonoConferenceCallChannel::onDtmfComplete); QObject::connect(mConnection, &oFonoConnection::channelMerged, this, &oFonoConferenceCallChannel::onChannelMerged); QObject::connect(mConnection, &oFonoConnection::channelSplitted, this, &oFonoConferenceCallChannel::onChannelSplitted); @@ -178,11 +178,11 @@ 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(), &OfonoVoiceCallManager::swapCallsComplete, this, &oFonoConferenceCallChannel::onSwapCallsComplete); + 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(), &OfonoVoiceCallManager::swapCallsComplete, this, &oFonoConferenceCallChannel::onSwapCallsComplete); + QObject::connect(mConnection->voiceCallManager(), &QOfonoVoiceCallManager::swapCallsComplete, this, &oFonoConferenceCallChannel::onSwapCallsComplete); mHoldIface->setHoldState(Tp::LocalHoldStatePendingUnhold, Tp::LocalHoldStateReasonRequested); mConnection->voiceCallManager()->swapCalls(); } @@ -190,7 +190,7 @@ void oFonoConferenceCallChannel::onHoldStateChanged(const Tp::LocalHoldState &st void oFonoConferenceCallChannel::onSwapCallsComplete(bool success) { - QObject::disconnect(mConnection->voiceCallManager(), &OfonoVoiceCallManager::swapCallsComplete, this, &oFonoConferenceCallChannel::onSwapCallsComplete); + 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; From 60104b14e2746748406556905356139707f0e869 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sat, 27 Jul 2019 16:55:21 +0200 Subject: [PATCH 18/27] OfonoCallVolume -> QOfonoCallVolume --- connection.cpp | 5 +++-- connection.h | 8 +++----- ofonocallchannel.cpp | 2 +- ofonoconferencecallchannel.cpp | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/connection.cpp b/connection.cpp index 6ca6d33..312b098 100644 --- a/connection.cpp +++ b/connection.cpp @@ -61,7 +61,8 @@ oFonoConnection::oFonoConnection(const QDBusConnection &dbusConnection, /// TODO porting setting? mOfonoVoiceCallManager = new QOfonoVoiceCallManager(this); mOfonoVoiceCallManager->setModemPath(mModemPath); - mOfonoCallVolume = new OfonoCallVolume(setting, mModemPath); + mOfonoCallVolume = new QOfonoCallVolume(this); + mOfonoCallVolume->setModemPath(mModemPath); mOfonoNetworkRegistration = new OfonoNetworkRegistration(setting, mModemPath); /// TODO porting setting? mOfonoMessageWaiting = new QOfonoMessageWaiting(this); @@ -939,7 +940,7 @@ QOfonoVoiceCallManager *oFonoConnection::voiceCallManager() return mOfonoVoiceCallManager; } -OfonoCallVolume *oFonoConnection::callVolume() +QOfonoCallVolume *oFonoConnection::callVolume() { return mOfonoCallVolume; } diff --git a/connection.h b/connection.h index 2590370..66f930b 100644 --- a/connection.h +++ b/connection.h @@ -28,15 +28,13 @@ #include // qofono -#include #include +#include #include #include // ofono-qt #include -#include -#include #include #include #include @@ -95,7 +93,7 @@ class oFonoConnection : public Tp::BaseConnection QOfonoMessageManager *messageManager(); QOfonoVoiceCallManager *voiceCallManager(); - OfonoCallVolume *callVolume(); + QOfonoCallVolume *callVolume(); QMap callChannels(); uint ensureHandle(const QString &phoneNumber); @@ -159,7 +157,7 @@ private Q_SLOTS: OfonoModemManager *mOfonoModemManager; QOfonoMessageManager *mOfonoMessageManager; QOfonoVoiceCallManager *mOfonoVoiceCallManager; - OfonoCallVolume *mOfonoCallVolume; + QOfonoCallVolume *mOfonoCallVolume; OfonoNetworkRegistration *mOfonoNetworkRegistration; QOfonoMessageWaiting *mOfonoMessageWaiting; OfonoSupplementaryServices *mOfonoSupplementaryServices; diff --git a/ofonocallchannel.cpp b/ofonocallchannel.cpp index a71575e..678435f 100644 --- a/ofonocallchannel.cpp +++ b/ofonocallchannel.cpp @@ -151,7 +151,7 @@ void oFonoCallChannel::init() mCallChannel->setCallState(Tp::CallStateInitialised, 0, reason, stateDetails); QObject::connect(mBaseChannel.data(), &Tp::BaseChannel::closed, this, &oFonoCallChannel::deleteLater); - QObject::connect(mConnection->callVolume(), &OfonoCallVolume::mutedChanged, this, &oFonoCallChannel::onOfonoMuteChanged); + 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); diff --git a/ofonoconferencecallchannel.cpp b/ofonoconferencecallchannel.cpp index 48d9b34..f560622 100644 --- a/ofonoconferencecallchannel.cpp +++ b/ofonoconferencecallchannel.cpp @@ -152,7 +152,7 @@ void oFonoConferenceCallChannel::init() mDTMFIface->setStopToneCallback(Tp::memFun(this,&oFonoConferenceCallChannel::onDTMFStopTone)); QObject::connect(mBaseChannel.data(), &Tp::BaseChannel::closed, this, &oFonoConferenceCallChannel::deleteLater); - QObject::connect(mConnection->callVolume(), &OfonoCallVolume::mutedChanged, this, &oFonoConferenceCallChannel::onOfonoMuteChanged); + QObject::connect(mConnection->callVolume(), &QOfonoCallVolume::mutedChanged, this, &oFonoConferenceCallChannel::onOfonoMuteChanged); QObject::connect(mConnection->voiceCallManager(), &QOfonoVoiceCallManager::sendTonesComplete, this, &oFonoConferenceCallChannel::onDtmfComplete); QObject::connect(mConnection, &oFonoConnection::channelMerged, this, &oFonoConferenceCallChannel::onChannelMerged); From 1b276d1ce8698b996d39a98d356056f6ab5338f1 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sat, 27 Jul 2019 17:03:00 +0200 Subject: [PATCH 19/27] OfonoNetworkRegistration -> QOfonoNetworkRegistration --- connection.cpp | 14 ++++++++------ connection.h | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/connection.cpp b/connection.cpp index 312b098..5006dab 100644 --- a/connection.cpp +++ b/connection.cpp @@ -63,7 +63,8 @@ oFonoConnection::oFonoConnection(const QDBusConnection &dbusConnection, mOfonoVoiceCallManager->setModemPath(mModemPath); mOfonoCallVolume = new QOfonoCallVolume(this); mOfonoCallVolume->setModemPath(mModemPath); - mOfonoNetworkRegistration = new OfonoNetworkRegistration(setting, mModemPath); + mOfonoNetworkRegistration = new QOfonoNetworkRegistration(this); + mOfonoNetworkRegistration->setModemPath(mModemPath); /// TODO porting setting? mOfonoMessageWaiting = new QOfonoMessageWaiting(this); mOfonoMessageWaiting->setModemPath(mModemPath); @@ -212,10 +213,11 @@ oFonoConnection::oFonoConnection(const QDBusConnection &dbusConnection, QObject::connect(mOfonoSimManager, &OfonoSimManager::presenceChanged, this, &oFonoConnection::updateOnlineStatus); QObject::connect(mOfonoSimManager, &OfonoSimManager::pinRequiredChanged, this, &oFonoConnection::updateOnlineStatus); QObject::connect(mOfonoSimManager, &OfonoSimManager::subscriberNumbersChanged, this, &oFonoConnection::updateOnlineStatus); - QObject::connect(mOfonoNetworkRegistration, &OfonoNetworkRegistration::statusChanged, this, &oFonoConnection::updateOnlineStatus); - QObject::connect(mOfonoNetworkRegistration, &OfonoNetworkRegistration::nameChanged, this, &oFonoConnection::updateOnlineStatus); - QObject::connect(mOfonoNetworkRegistration, &OfonoNetworkRegistration::mccChanged, this, &oFonoConnection::updateOnlineStatus); - QObject::connect(mOfonoNetworkRegistration, &OfonoNetworkRegistration::validityChanged, this, &oFonoConnection::onValidityChanged); + QObject::connect(mOfonoNetworkRegistration, &QOfonoNetworkRegistration::statusChanged, this, &oFonoConnection::updateOnlineStatus); + QObject::connect(mOfonoNetworkRegistration, &QOfonoNetworkRegistration::nameChanged, this, &oFonoConnection::updateOnlineStatus); + QObject::connect(mOfonoNetworkRegistration, &QOfonoNetworkRegistration::mccChanged, this, &oFonoConnection::updateOnlineStatus); + // TODO porting can this be gone + //QObject::connect(mOfonoNetworkRegistration, &QOfonoNetworkRegistration::validityChanged, this, &oFonoConnection::onValidityChanged); QObject::connect(mOfonoMessageWaiting, &QOfonoMessageWaiting::voicemailMessageCountChanged, voicemailIface.data(), &BaseConnectionVoicemailInterface::setVoicemailCount); QObject::connect(mOfonoMessageWaiting, &QOfonoMessageWaiting::voicemailWaitingChanged, voicemailIface.data(), &BaseConnectionVoicemailInterface::setVoicemailIndicator); QObject::connect(mOfonoMessageWaiting, &QOfonoMessageWaiting::voicemailMailboxNumberChanged, voicemailIface.data(), &BaseConnectionVoicemailInterface::setVoicemailNumber); @@ -550,7 +552,7 @@ void oFonoConnection::onValidityChanged(bool valid) if (sender() == mOfonoSimManager) { Q_EMIT mOfonoSimManager->modem()->pathChanged(mOfonoModem->path()); } else if (sender() == mOfonoNetworkRegistration) { - Q_EMIT mOfonoNetworkRegistration->modem()->pathChanged(mOfonoModem->path()); + //Q_EMIT mOfonoNetworkRegistration->modem()->pathChanged(mOfonoModem->path()); } else if (sender() == mOfonoVoiceCallManager) { /// todo porting can this safely be removed? //Q_EMIT mOfonoVoiceCallManager->modem()->pathChanged(mOfonoModem->path()); diff --git a/connection.h b/connection.h index 66f930b..d5d8609 100644 --- a/connection.h +++ b/connection.h @@ -32,10 +32,10 @@ #include #include #include +#include // ofono-qt #include -#include #include #include @@ -158,7 +158,7 @@ private Q_SLOTS: QOfonoMessageManager *mOfonoMessageManager; QOfonoVoiceCallManager *mOfonoVoiceCallManager; QOfonoCallVolume *mOfonoCallVolume; - OfonoNetworkRegistration *mOfonoNetworkRegistration; + QOfonoNetworkRegistration *mOfonoNetworkRegistration; QOfonoMessageWaiting *mOfonoMessageWaiting; OfonoSupplementaryServices *mOfonoSupplementaryServices; OfonoSimManager *mOfonoSimManager; From c6992d264ea57a2facb6b3580e3988da2a869a80 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sat, 27 Jul 2019 17:15:02 +0200 Subject: [PATCH 20/27] OfonoSupplementaryServices -> QOfonoSupplementaryServices --- connection.cpp | 30 ++++++++++++++++-------------- connection.h | 4 ++-- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/connection.cpp b/connection.cpp index 5006dab..8d04a9e 100644 --- a/connection.cpp +++ b/connection.cpp @@ -68,7 +68,8 @@ oFonoConnection::oFonoConnection(const QDBusConnection &dbusConnection, /// TODO porting setting? mOfonoMessageWaiting = new QOfonoMessageWaiting(this); mOfonoMessageWaiting->setModemPath(mModemPath); - mOfonoSupplementaryServices = new OfonoSupplementaryServices(setting, mModemPath); + mOfonoSupplementaryServices = new QOfonoSupplementaryServices(this); + mOfonoSupplementaryServices->setModemPath(mModemPath); mOfonoSimManager = new OfonoSimManager(setting, mModemPath); mOfonoModem = mOfonoSimManager->modem(); @@ -225,19 +226,20 @@ oFonoConnection::oFonoConnection(const QDBusConnection &dbusConnection, QObject::connect(mMmsdManager, &MMSDManager::serviceAdded, this, &oFonoConnection::onMMSDServiceAdded); QObject::connect(mMmsdManager, &MMSDManager::serviceRemoved, this, &oFonoConnection::onMMSDServiceRemoved); - QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::notificationReceived, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::NotificationReceived); - QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::requestReceived, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::RequestReceived); - QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::initiateUSSDComplete, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::InitiateUSSDComplete); - QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::barringComplete, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::BarringComplete); - QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::forwardingComplete, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::ForwardingComplete); - QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::waitingComplete, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::WaitingComplete); - QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::callingLinePresentationComplete, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::CallingLinePresentationComplete); - QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::connectedLinePresentationComplete, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::ConnectedLinePresentationComplete); - QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::callingLineRestrictionComplete, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::CallingLineRestrictionComplete); - QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::connectedLineRestrictionComplete, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::ConnectedLineRestrictionComplete); - QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::initiateFailed, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::InitiateFailed); - QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::stateChanged, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::StateChanged); - QObject::connect(mOfonoSupplementaryServices, &OfonoSupplementaryServices::respondComplete, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::RespondComplete); + QObject::connect(mOfonoSupplementaryServices, &QOfonoSupplementaryServices::notificationReceived, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::NotificationReceived); + QObject::connect(mOfonoSupplementaryServices, &QOfonoSupplementaryServices::requestReceived, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::RequestReceived); + // todo porting + //QObject::connect(mOfonoSupplementaryServices, &QOfonoSupplementaryServices::initiateUSSDComplete, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::InitiateUSSDComplete); + QObject::connect(mOfonoSupplementaryServices, &QOfonoSupplementaryServices::callBarringResponse, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::BarringComplete); + QObject::connect(mOfonoSupplementaryServices, &QOfonoSupplementaryServices::callForwardingResponse, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::ForwardingComplete); + QObject::connect(mOfonoSupplementaryServices, &QOfonoSupplementaryServices::callWaitingResponse, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::WaitingComplete); + QObject::connect(mOfonoSupplementaryServices, &QOfonoSupplementaryServices::callingLinePresentationResponse, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::CallingLinePresentationComplete); + QObject::connect(mOfonoSupplementaryServices, &QOfonoSupplementaryServices::connectedLinePresentationResponse, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::ConnectedLinePresentationComplete); + QObject::connect(mOfonoSupplementaryServices, &QOfonoSupplementaryServices::callingLineRestrictionResponse, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::CallingLineRestrictionComplete); + QObject::connect(mOfonoSupplementaryServices, &QOfonoSupplementaryServices::connectedLineRestrictionResponse, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::ConnectedLineRestrictionComplete); + QObject::connect(mOfonoSupplementaryServices, &QOfonoSupplementaryServices::initiateFailed, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::InitiateFailed); + QObject::connect(mOfonoSupplementaryServices, &QOfonoSupplementaryServices::stateChanged, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::StateChanged); + QObject::connect(mOfonoSupplementaryServices, &QOfonoSupplementaryServices::respondComplete, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::RespondComplete); QObject::connect(this, &oFonoConnection::disconnected, this, &oFonoConnection::onDisconnected); // workaround: we can't add services here as tp-ofono interfaces are not exposed on dbus diff --git a/connection.h b/connection.h index d5d8609..62e849f 100644 --- a/connection.h +++ b/connection.h @@ -33,10 +33,10 @@ #include #include #include +#include // ofono-qt #include -#include #include // telepathy-ofono @@ -160,7 +160,7 @@ private Q_SLOTS: QOfonoCallVolume *mOfonoCallVolume; QOfonoNetworkRegistration *mOfonoNetworkRegistration; QOfonoMessageWaiting *mOfonoMessageWaiting; - OfonoSupplementaryServices *mOfonoSupplementaryServices; + QOfonoSupplementaryServices *mOfonoSupplementaryServices; OfonoSimManager *mOfonoSimManager; OfonoModem *mOfonoModem; Tp::SimplePresence mSelfPresence; From be996d7e01f36afed3028f7cedf3a61e12eb978a Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sat, 27 Jul 2019 17:51:23 +0200 Subject: [PATCH 21/27] OfonoSimManager -> QOfonoSimManager OfonoModem -> QOfonoModem --- connection.cpp | 34 +++++++++++++++++++--------------- connection.h | 9 +++++---- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/connection.cpp b/connection.cpp index 8d04a9e..460eb7f 100644 --- a/connection.cpp +++ b/connection.cpp @@ -49,11 +49,12 @@ oFonoConnection::oFonoConnection(const QDBusConnection &dbusConnection, mMmsdManager(new MMSDManager(this)), mConferenceCall(nullptr) { - OfonoModem::SelectionSetting setting = OfonoModem::AutomaticSelect; + // TODO porting + // OfonoModem::SelectionSetting setting = OfonoModem::AutomaticSelect; mModemPath = parameters["modem-objpath"].toString(); - if (!mModemPath.isEmpty()) { - setting = OfonoModem::ManualSelect; - } +// if (!mModemPath.isEmpty()) { +// setting = OfonoModem::ManualSelect; +// } //TODO porting 'setting'?? was getting passed to ModemInterface mOfonoMessageManager = new QOfonoMessageManager(this); @@ -70,8 +71,10 @@ oFonoConnection::oFonoConnection(const QDBusConnection &dbusConnection, mOfonoMessageWaiting->setModemPath(mModemPath); mOfonoSupplementaryServices = new QOfonoSupplementaryServices(this); mOfonoSupplementaryServices->setModemPath(mModemPath); - mOfonoSimManager = new OfonoSimManager(setting, mModemPath); - mOfonoModem = mOfonoSimManager->modem(); + mOfonoSimManager = new QOfonoSimManager(this); + mOfonoSimManager->setModemPath(mModemPath); + mOfonoModem = new QOfonoModem(this); + mOfonoModem->setModemPath(mModemPath); if (mOfonoSimManager->subscriberNumbers().size() > 0) { setSelfHandle(newHandle(mOfonoSimManager->subscriberNumbers()[0])); @@ -200,9 +203,9 @@ oFonoConnection::oFonoConnection(const QDBusConnection &dbusConnection, << TP_QT_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE); plugInterface(Tp::AbstractConnectionInterfacePtr::dynamicCast(contactsIface)); - QObject::connect(mOfonoModem, &OfonoModem::onlineChanged, this, &oFonoConnection::updateOnlineStatus); - QObject::connect(mOfonoModem, &OfonoModem::serialChanged, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::setSerial); - QObject::connect(mOfonoModem, &OfonoModem::interfacesChanged, this, &oFonoConnection::updateOnlineStatus); + QObject::connect(mOfonoModem, &QOfonoModem::onlineChanged, this, &oFonoConnection::updateOnlineStatus); + QObject::connect(mOfonoModem, &QOfonoModem::serialChanged, supplementaryServicesIface.data(), &BaseConnectionUSSDInterface::setSerial); + QObject::connect(mOfonoModem, &QOfonoModem::interfacesChanged, this, &oFonoConnection::updateOnlineStatus); QObject::connect(mOfonoMessageManager, &QOfonoMessageManager::incomingMessage, this, &oFonoConnection::onOfonoIncomingMessage); QObject::connect(mOfonoMessageManager, &QOfonoMessageManager::immediateMessage, this, &oFonoConnection::onOfonoImmediateMessage); //TODO porting: is that equivalent to receiving a status report? @@ -210,10 +213,11 @@ oFonoConnection::oFonoConnection(const QDBusConnection &dbusConnection, QObject::connect(mOfonoVoiceCallManager, &QOfonoVoiceCallManager::callAdded, this, &oFonoConnection::onOfonoCallAdded); /// \TODO: this is actually a misnamed slot in ofono-qt/OfonoVoiceCallManager QObject::connect(mOfonoVoiceCallManager, SIGNAL(validityChanged(bool)), SLOT(onValidityChanged(bool))); - QObject::connect(mOfonoSimManager, &OfonoSimManager::validityChanged, this, &oFonoConnection::onValidityChanged); - QObject::connect(mOfonoSimManager, &OfonoSimManager::presenceChanged, this, &oFonoConnection::updateOnlineStatus); - QObject::connect(mOfonoSimManager, &OfonoSimManager::pinRequiredChanged, this, &oFonoConnection::updateOnlineStatus); - QObject::connect(mOfonoSimManager, &OfonoSimManager::subscriberNumbersChanged, this, &oFonoConnection::updateOnlineStatus); + // todo porting can this be gone? + //QObject::connect(mOfonoSimManager, &QOfonoSimManager::validityChanged, this, &oFonoConnection::onValidityChanged); + QObject::connect(mOfonoSimManager, &QOfonoSimManager::presenceChanged, this, &oFonoConnection::updateOnlineStatus); + QObject::connect(mOfonoSimManager, &QOfonoSimManager::pinRequiredChanged, this, &oFonoConnection::updateOnlineStatus); + QObject::connect(mOfonoSimManager, &QOfonoSimManager::subscriberNumbersChanged, this, &oFonoConnection::updateOnlineStatus); QObject::connect(mOfonoNetworkRegistration, &QOfonoNetworkRegistration::statusChanged, this, &oFonoConnection::updateOnlineStatus); QObject::connect(mOfonoNetworkRegistration, &QOfonoNetworkRegistration::nameChanged, this, &oFonoConnection::updateOnlineStatus); QObject::connect(mOfonoNetworkRegistration, &QOfonoNetworkRegistration::mccChanged, this, &oFonoConnection::updateOnlineStatus); @@ -552,7 +556,7 @@ void oFonoConnection::onValidityChanged(bool valid) // WORKAROUND: ofono-qt does not refresh the properties once the interface // becomes available, so it contains old values. if (sender() == mOfonoSimManager) { - Q_EMIT mOfonoSimManager->modem()->pathChanged(mOfonoModem->path()); + //Q_EMIT mOfonoSimManager->modem()->pathChanged(mOfonoModem->path()); } else if (sender() == mOfonoNetworkRegistration) { //Q_EMIT mOfonoNetworkRegistration->modem()->pathChanged(mOfonoModem->path()); } else if (sender() == mOfonoVoiceCallManager) { @@ -584,7 +588,7 @@ void oFonoConnection::updateOnlineStatus() !mOfonoSimManager->isValid()) { mSelfPresence.status = "nosim"; } else if (mOfonoSimManager->isValid() && mOfonoSimManager->present() && - mOfonoSimManager->pinRequired() != "none" && !mOfonoSimManager->pinRequired().isEmpty()) { + mOfonoSimManager->pinRequired() != QOfonoSimManager::NoPin) { mSelfPresence.status = "simlocked"; mSelfPresence.type = Tp::ConnectionPresenceTypeAway; } else if (isNetworkRegistered()) { diff --git a/connection.h b/connection.h index 62e849f..7973eee 100644 --- a/connection.h +++ b/connection.h @@ -32,13 +32,14 @@ #include #include #include +#include #include #include +#include + // ofono-qt #include -#include - // telepathy-ofono #include "ofonotextchannel.h" @@ -161,8 +162,8 @@ private Q_SLOTS: QOfonoNetworkRegistration *mOfonoNetworkRegistration; QOfonoMessageWaiting *mOfonoMessageWaiting; QOfonoSupplementaryServices *mOfonoSupplementaryServices; - OfonoSimManager *mOfonoSimManager; - OfonoModem *mOfonoModem; + QOfonoSimManager *mOfonoSimManager; + QOfonoModem *mOfonoModem; Tp::SimplePresence mSelfPresence; MMSDManager *mMmsdManager; QMap mMmsdServices; From eafae339940893bd034b9c1b46b3085a92cd9df4 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sat, 27 Jul 2019 18:00:33 +0200 Subject: [PATCH 22/27] OfonoModemManager -> QOfonoManager --- connection.cpp | 4 ++-- connection.h | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/connection.cpp b/connection.cpp index 460eb7f..5d695d4 100644 --- a/connection.cpp +++ b/connection.cpp @@ -43,7 +43,7 @@ oFonoConnection::oFonoConnection(const QDBusConnection &dbusConnection, const QString &protocolName, const QVariantMap ¶meters) : Tp::BaseConnection(dbusConnection, cmName, protocolName, parameters), - mOfonoModemManager(new OfonoModemManager(this)), + mOfonoManager(new QOfonoManager(this)), mHandleCount(0), mGroupHandleCount(0), mMmsdManager(new MMSDManager(this)), @@ -493,7 +493,7 @@ oFonoConnection::~oFonoConnection() { dbusConnection().unregisterObject(objectPath(), QDBusConnection::UnregisterTree); dbusConnection().unregisterService(busName()); - mOfonoModemManager->deleteLater(); + mOfonoManager->deleteLater(); mOfonoMessageManager->deleteLater(); mOfonoVoiceCallManager->deleteLater(); mOfonoCallVolume->deleteLater(); diff --git a/connection.h b/connection.h index 7973eee..c36121e 100644 --- a/connection.h +++ b/connection.h @@ -30,6 +30,7 @@ // qofono #include #include +#include #include #include #include @@ -38,8 +39,6 @@ #include -// ofono-qt -#include // telepathy-ofono #include "ofonotextchannel.h" @@ -155,7 +154,7 @@ private Q_SLOTS: QMap mCallChannels; QStringList mModems; - OfonoModemManager *mOfonoModemManager; + QOfonoManager *mOfonoManager; QOfonoMessageManager *mOfonoMessageManager; QOfonoVoiceCallManager *mOfonoVoiceCallManager; QOfonoCallVolume *mOfonoCallVolume; From e3737659211c38dc50487270d17c185e276d2a09 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sat, 27 Jul 2019 18:08:17 +0200 Subject: [PATCH 23/27] Remove usage of ofono-qt in CMakeLists.txt --- CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 68ce868..b4850a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,6 @@ 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) @@ -50,7 +49,6 @@ include_directories(${TP_QT5_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) @@ -94,7 +92,7 @@ add_dependencies(${TELEPATHY_OFONO} schema_update qrc_update) enable_testing() -target_link_libraries(${TELEPATHY_OFONO} Qt5::Core Qt5::DBus -ltelepathy-qt5 ${TELEPATHY_QT5_SERVICE_LIBRARIES} Qt5::Network ${OFONO_QT_LIBRARIES} ${SQLITE3_LIBRARIES} ${LibPhoneNumber_LIBRARIES} ${QOFONO_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) From 9d3f90798e6ed2093784a58633833950ac9c1801 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sat, 27 Jul 2019 18:12:00 +0200 Subject: [PATCH 24/27] adjust debian build depends --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 022c05f..78520a5 100644 --- a/debian/control +++ b/debian/control @@ -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), From 8518a34c3759a656ec8141fd1b4759868fec4fe6 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sun, 4 Aug 2019 14:48:36 +0200 Subject: [PATCH 25/27] adapt travis-ci --- .travis.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 773871f..1945fc9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 From b9ce313fa512bad1d6513cd42341f55f1ff52bdf Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sun, 4 Aug 2019 15:07:39 +0200 Subject: [PATCH 26/27] fix tests #1: mock lib name --- tests/dbus-test-wrapper.sh.in | 2 +- tests/mock/CMakeLists.txt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/dbus-test-wrapper.sh.in b/tests/dbus-test-wrapper.sh.in index ac5f813..5d28ec9 100755 --- a/tests/dbus-test-wrapper.sh.in +++ b/tests/dbus-test-wrapper.sh.in @@ -17,7 +17,7 @@ dconf write /org/gnome/empathy/use-conn false export PA_DISABLED=1 # start telepathy-ofono with the ofono-qt mock library -LD_PRELOAD=@CMAKE_CURRENT_BINARY_DIR@/mock/libofono-qt.so ${CMAKE_BINARY_DIR}/telepathy-ofono & +LD_PRELOAD=@CMAKE_CURRENT_BINARY_DIR@/mock/libqofono.so ${CMAKE_BINARY_DIR}/telepathy-ofono & TP_OFONO_PID=$! sleep 2 diff --git a/tests/mock/CMakeLists.txt b/tests/mock/CMakeLists.txt index 948daec..e325c09 100644 --- a/tests/mock/CMakeLists.txt +++ b/tests/mock/CMakeLists.txt @@ -34,9 +34,9 @@ qt5_add_dbus_adaptor(library_SRCS VoiceCallManagerPrivate.xml voicecallmanagerpr qt5_add_dbus_adaptor(library_SRCS VoiceCallPrivate.xml voicecallprivate.h VoiceCallPrivate) qt5_add_dbus_adaptor(library_SRCS SimManagerPrivate.xml simmanagerprivate.h SimManagerPrivate) -add_library(ofono-qt-mock SHARED ${library_SRCS}) -set_target_properties(ofono-qt-mock PROPERTIES - OUTPUT_NAME "ofono-qt" +add_library(qofono-mock SHARED ${library_SRCS}) +set_target_properties(qofono-mock PROPERTIES + OUTPUT_NAME "qofono" ) # Set the library version and the SOVERSION @@ -44,4 +44,4 @@ set_target_properties(ofono-qt-mock PROPERTIES # SOVERSION ${HISTORY_VERSION_MAJOR} # VERSION ${HISTORY_VERSION_MAJOR}.${HISTORY_VERSION_MINOR}.${HISTORY_VERSION_PATCH}) -qt5_use_modules(ofono-qt-mock Core DBus) +qt5_use_modules(qofono-mock Core DBus) From 2888e0c7483656180c8472c777683e34f5a2dfe3 Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Sun, 4 Aug 2019 15:22:23 +0200 Subject: [PATCH 27/27] fix tests #2: correct so name --- tests/dbus-test-wrapper.sh.in | 2 +- tests/mock/CMakeLists.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/dbus-test-wrapper.sh.in b/tests/dbus-test-wrapper.sh.in index 5d28ec9..73af1ed 100755 --- a/tests/dbus-test-wrapper.sh.in +++ b/tests/dbus-test-wrapper.sh.in @@ -17,7 +17,7 @@ dconf write /org/gnome/empathy/use-conn false export PA_DISABLED=1 # start telepathy-ofono with the ofono-qt mock library -LD_PRELOAD=@CMAKE_CURRENT_BINARY_DIR@/mock/libqofono.so ${CMAKE_BINARY_DIR}/telepathy-ofono & +LD_PRELOAD=@CMAKE_CURRENT_BINARY_DIR@/mock/libqofono-qt5.so.0 ${CMAKE_BINARY_DIR}/telepathy-ofono & TP_OFONO_PID=$! sleep 2 diff --git a/tests/mock/CMakeLists.txt b/tests/mock/CMakeLists.txt index e325c09..09e9525 100644 --- a/tests/mock/CMakeLists.txt +++ b/tests/mock/CMakeLists.txt @@ -36,7 +36,8 @@ qt5_add_dbus_adaptor(library_SRCS SimManagerPrivate.xml simmanagerprivate.h SimM add_library(qofono-mock SHARED ${library_SRCS}) set_target_properties(qofono-mock PROPERTIES - OUTPUT_NAME "qofono" + OUTPUT_NAME "qofono-qt5" + SOVERSION 0 ) # Set the library version and the SOVERSION