diff -Nru telephony-service-0.1+15.10.20150608.4/approver/approver.cpp telephony-service-0.1+15.10.20150709/approver/approver.cpp --- telephony-service-0.1+15.10.20150608.4/approver/approver.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/approver/approver.cpp 2015-07-09 13:46:02.000000000 +0000 @@ -31,6 +31,7 @@ #include "ringtone.h" #include "callmanager.h" #include "callentry.h" +#include "protocolmanager.h" #include "tonegenerator.h" #include "telepathyhelper.h" #include "accountentry.h" @@ -147,7 +148,7 @@ void Approver::addDispatchOperation(const Tp::MethodInvocationContextPtr<> &context, const Tp::ChannelDispatchOperationPtr &dispatchOperation) { - if (!TelepathyHelper::instance()->supportedProtocols().contains(dispatchOperation->account()->protocolName())) { + if (!ProtocolManager::instance()->isProtocolSupported(dispatchOperation->account()->protocolName())) { context->setFinishedWithError(TP_QT_ERROR_NOT_CAPABLE, "The account for this request is not supported."); return; } @@ -333,8 +334,8 @@ request->setFilter(QContactPhoneNumber::match(contact->id())); // lambda function to update the notification - QObject::connect(request, &QContactAbstractRequest::stateChanged, [this, request, dispatchOp, channel]() { - if (!request || request->state() != QContactAbstractRequest::FinishedState) { + QObject::connect(request, &QContactAbstractRequest::stateChanged, [this, request, dispatchOp, channel](QContactAbstractRequest::State state) { + if (!request || state != QContactAbstractRequest::FinishedState) { return; } @@ -348,7 +349,6 @@ // Also notify greeter via AccountsService GreeterContacts::emitContact(contact); } - showSnapDecision(dispatchOp, channel, contact); }); @@ -367,6 +367,8 @@ { closeSnapDecision(); + acceptCallChannels(dispatchOp); + // forward the channel to the handler dispatchOp->handleWith(TELEPHONY_SERVICE_HANDLER); @@ -385,6 +387,8 @@ CallManager::instance()->foregroundCall()->endCall(); } + acceptCallChannels(dispatchOp); + // forward the channel to the handler dispatchOp->handleWith(TELEPHONY_SERVICE_HANDLER); @@ -476,6 +480,9 @@ notify_notification_set_hint_string(notification, "x-canonical-secondary-icon", "incoming-call"); + notify_notification_set_hint_int32(notification, + "x-canonical-snap-decisions-timeout", + -1); QString acceptTitle = hasCalls ? C::gettext("Hold + Answer") : C::gettext("Accept"); @@ -550,6 +557,17 @@ return true; } +void Approver::acceptCallChannels(const Tp::ChannelDispatchOperationPtr dispatchOp) +{ + // accept all channels + Q_FOREACH(Tp::ChannelPtr channel, dispatchOp->channels()) { + Tp::CallChannelPtr callChannel = Tp::CallChannelPtr::dynamicCast(channel); + if (callChannel) { + callChannel->accept(); + } + } +} + Tp::ChannelDispatchOperationPtr Approver::dispatchOperationForIncomingCall() { Tp::ChannelDispatchOperationPtr callDispatchOp; diff -Nru telephony-service-0.1+15.10.20150608.4/approver/approver.h telephony-service-0.1+15.10.20150709/approver/approver.h --- telephony-service-0.1+15.10.20150608.4/approver/approver.h 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/approver/approver.h 2015-07-09 13:46:02.000000000 +0000 @@ -56,6 +56,7 @@ bool showSnapDecision(const Tp::ChannelDispatchOperationPtr dispatchOperation, const Tp::ChannelPtr channel, const QContact &contact = QContact()); + void acceptCallChannels(const Tp::ChannelDispatchOperationPtr dispatchOp); bool handleMediaKey(bool doubleClick); protected: diff -Nru telephony-service-0.1+15.10.20150608.4/cmake/modules/GenerateTest.cmake telephony-service-0.1+15.10.20150709/cmake/modules/GenerateTest.cmake --- telephony-service-0.1+15.10.20150608.4/cmake/modules/GenerateTest.cmake 2015-06-08 23:04:01.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/cmake/modules/GenerateTest.cmake 2015-07-09 13:46:02.000000000 +0000 @@ -77,7 +77,8 @@ HISTORY_SQLITE_DBPATH=:memory: MC_ACCOUNT_DIR=${TMPDIR} MC_MANAGER_DIR=${TMPDIR} - MC_CLIENTS_DIR=${TMPDIR}) + MC_CLIENTS_DIR=${TMPDIR} + TELEPHONY_SERVICE_TEST=1) endif () set(TEST_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME} ${PLATFORM} -p -o -p -,txt -p -o -p ${CMAKE_BINARY_DIR}/test_${TESTNAME}.xml,xunitxml) @@ -105,11 +106,12 @@ function(generate_telepathy_test TESTNAME) set(options "") - set(oneValueArgs "") + set(oneValueArgs WAIT_FOR) set(multiValueArgs TASKS LIBRARIES QT5_MODULES) cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) set(TASKS --task gnome-keyring-daemon -p -r -p -d --task-name gnome-keyring --ignore-return + --task ${CMAKE_BINARY_DIR}/tests/common/NotificationsMock --task-name notifications --ignore-return --task /usr/lib/dconf/dconf-service --task-name dconf-service --ignore-return --task dconf -p write -p /org/gnome/empathy/use-conn -p false --task-name dconf-write --wait-for ca.desrt.dconf --ignore-return --task /usr/lib/telepathy/mission-control-5 --task-name mission-control --wait-for ca.desrt.dconf --ignore-return @@ -125,10 +127,13 @@ if (NOT DEFINED ARG_QT5_MODULES) set(ARG_QT5_MODULES Core DBus Test Qml) endif (NOT DEFINED ARG_QT5_MODULES) + if (NOT DEFINED ARG_WAIT_FOR) + set(ARG_WAIT_FOR org.freedesktop.Telepathy.Client.TelephonyServiceHandler) + endif (NOT DEFINED ARG_WAIT_FOR) generate_test(${TESTNAME} ${ARGN} TASKS ${TASKS} LIBRARIES ${ARG_LIBRARIES} QT5_MODULES ${ARG_QT5_MODULES} USE_DBUS USE_UI - WAIT_FOR org.freedesktop.Telepathy.Client.TelephonyServiceHandler) + WAIT_FOR ${ARG_WAIT_FOR}) endfunction(generate_telepathy_test) diff -Nru telephony-service-0.1+15.10.20150608.4/CMakeLists.txt telephony-service-0.1+15.10.20150709/CMakeLists.txt --- telephony-service-0.1+15.10.20150608.4/CMakeLists.txt 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/CMakeLists.txt 2015-07-09 13:46:02.000000000 +0000 @@ -12,6 +12,9 @@ # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) +# just to make debug easier, print the system processor +message(STATUS "System processor: ${CMAKE_SYSTEM_PROCESSOR}") + # Check if should build using ubuntu platform api check_include_file_cxx("ubuntu/application/init.h" USE_UBUNTU_PLATFORM_API) @@ -47,6 +50,11 @@ OUTPUT_STRIP_TRAILING_WHITESPACE ) +# sbuild/cross-compilation fallback: +if (QT_INSTALL_QML STREQUAL "") + set(QT_INSTALL_QML ${CMAKE_INSTALL_LIBDIR}/qt5/qml) +endif() + find_package(PkgConfig REQUIRED) pkg_check_modules(TP_QT5 REQUIRED TelepathyQt5) pkg_check_modules(NOTIFY REQUIRED libnotify) @@ -88,6 +96,7 @@ add_subdirectory(icons) add_subdirectory(po) add_subdirectory(tests) +add_subdirectory(protocols) include(EnableCoverageReport) ##################################################################### diff -Nru telephony-service-0.1+15.10.20150608.4/config.h.in telephony-service-0.1+15.10.20150709/config.h.in --- telephony-service-0.1+15.10.20150608.4/config.h.in 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/config.h.in 2015-07-09 13:45:55.000000000 +0000 @@ -48,3 +48,12 @@ return QString("@CMAKE_SOURCE_DIR@/"); } } + +inline QString protocolsDir() { + QString directory = qgetenv("TELEPHONY_SERVICE_PROTOCOLS_DIR"); + if (directory.isEmpty()) { + directory = telephonyServiceDir() + "/protocols"; + } + + return directory; +} diff -Nru telephony-service-0.1+15.10.20150608.4/debian/changelog telephony-service-0.1+15.10.20150709/debian/changelog --- telephony-service-0.1+15.10.20150608.4/debian/changelog 2015-07-15 08:19:20.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/debian/changelog 2015-07-15 08:19:20.000000000 +0000 @@ -1,8 +1,49 @@ -telephony-service (0.1+15.10.20150608.4-0ubuntu2~wily1~test1~qt550beta) wily; urgency=medium +telephony-service (0.1+15.10.20150709-0ubuntu2~wily1~test1~qt550+1) wily; urgency=medium - * No-change rebuild against Qt 5.5.0. + * Rebuild against Qt 5.5.0. - -- Timo Jyrinki Thu, 11 Jun 2015 09:06:34 +0300 + -- Timo Jyrinki Wed, 15 Jul 2015 11:17:52 +0300 + +telephony-service (0.1+15.10.20150709-0ubuntu1) wily; urgency=medium + + [ Gustavo Pichorim Boiko ] + * Sync the fixes that were released in OTA5: (LP: #1384274, #1433068, + #1412709, #1427286, #1453004) + + -- CI Train Bot Thu, 09 Jul 2015 13:46:05 +0000 + +telephony-service (0.1+15.10.20150706.1-0ubuntu1) wily; urgency=medium + + [ Alberto Aguirre ] + * No change rebuid against platform-api 3 + + -- CI Train Bot Mon, 06 Jul 2015 22:06:19 +0000 + +telephony-service (0.1+15.10.20150701-0ubuntu1) wily; urgency=medium + + [ CI Train Bot ] + * Resync trunk. + + [ Tiago Salem Herrmann ] + * Update to telepathy-qt 0.9.6.1 + + -- CI Train Bot Wed, 01 Jul 2015 14:16:47 +0000 + +telephony-service (0.1+15.10.20150617-0ubuntu1) wily; urgency=medium + + [ CI Train Bot ] + * New rebuild forced. + + [ Gustavo Pichorim Boiko ] + * Make it possible to specify the list of supported protocols + dynamically by installing .protocol files in /usr/share/telephony- + service/protocols + + [ Tiago Salem Herrmann ] + * Add multimedia connection manager support + * Remove slashes when normalizing phone numbers. (LP: #1462090) + + -- CI Train Bot Wed, 17 Jun 2015 20:39:47 +0000 telephony-service (0.1+15.10.20150608.4-0ubuntu1) wily; urgency=medium diff -Nru telephony-service-0.1+15.10.20150608.4/debian/telephony-service.install telephony-service-0.1+15.10.20150709/debian/telephony-service.install --- telephony-service-0.1+15.10.20150608.4/debian/telephony-service.install 2015-07-15 08:19:20.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/debian/telephony-service.install 2015-07-15 08:19:20.000000000 +0000 @@ -8,11 +8,12 @@ usr/share/icons/ubuntu-mono-dark/status/*/indicator-call.svg usr/share/icons/ubuntu-mono-light/status/*/indicator-call.svg usr/share/locale/*/LC_MESSAGES/telephony-service.mo -usr/share/notify-osd/icons/gnome/scalable/status/notification-group-call.svg -usr/share/notify-osd/icons/gnome/scalable/status/notification-unavailable-image-call.svg -usr/share/notify-osd/icons/gnome/scalable/status/notification-unknown-call.svg +usr/share/notify-osd/icons/Humanity/scalable/status/notification-group-call.svg +usr/share/notify-osd/icons/Humanity/scalable/status/notification-unavailable-image-call.svg +usr/share/notify-osd/icons/Humanity/scalable/status/notification-unknown-call.svg usr/share/polkit-1/actions/*TelephonyService*.policy usr/share/telepathy/clients/TelephonyService*.client usr/share/telephony-service/assets/* +usr/share/telephony-service/protocols/* var/lib/polkit-1/localauthority/10-vendor.d/*TelephonyService*.pkla upstart/telephony-service-indicator.conf /usr/share/upstart/sessions diff -Nru telephony-service-0.1+15.10.20150608.4/handler/callhandler.cpp telephony-service-0.1+15.10.20150709/handler/callhandler.cpp --- telephony-service-0.1+15.10.20150608.4/handler/callhandler.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/handler/callhandler.cpp 2015-07-09 13:46:02.000000000 +0000 @@ -177,7 +177,8 @@ * play locally (via tone generator) only if we are on a call, or if this is * dialpad sounds */ - if (GreeterContacts::instance()->dialpadSoundsEnabled() && objectPath.isEmpty() + if (GreeterContacts::instance()->dialpadSoundsEnabled() && + !GreeterContacts::instance()->silentMode() && objectPath.isEmpty() || !objectPath.isEmpty()) { ToneGenerator::instance()->playDTMFTone((uint)event); } @@ -264,8 +265,6 @@ void CallHandler::onCallChannelAvailable(Tp::CallChannelPtr channel) { - channel->accept(); - QDBusInterface callChannelIface(channel->busName(), channel->objectPath(), DBUS_PROPERTIES_IFACE); QDBusMessage reply = callChannelIface.call("GetAll", CANONICAL_TELEPHONY_AUDIOOUTPUTS_IFACE); QVariantList args = reply.arguments(); diff -Nru telephony-service-0.1+15.10.20150608.4/handler/handler.cpp telephony-service-0.1+15.10.20150709/handler/handler.cpp --- telephony-service-0.1+15.10.20150608.4/handler/handler.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/handler/handler.cpp 2015-07-09 13:46:02.000000000 +0000 @@ -21,6 +21,8 @@ */ #include "handler.h" +#include "accountentry.h" +#include "protocolmanager.h" #include "telepathyhelper.h" #include @@ -52,13 +54,14 @@ Q_UNUSED(userActionTime) Q_UNUSED(handlerInfo) - if (!TelepathyHelper::instance()->supportedProtocols().contains(account->protocolName())) { + if (!ProtocolManager::instance()->isProtocolSupported(account->protocolName())) { context->setFinishedWithError(TP_QT_ERROR_NOT_CAPABLE, "The account for this request is not supported."); return; } Q_FOREACH(const Tp::ChannelPtr channel, channels) { + mContexts[channel.data()] = context; Tp::TextChannelPtr textChannel = Tp::TextChannelPtr::dynamicCast(channel); if (textChannel) { Tp::PendingReady *pr = textChannel->becomeReady(Tp::Features() @@ -88,7 +91,6 @@ } } - context->setFinished(); } Tp::ChannelClassSpecList Handler::channelFilters() @@ -120,6 +122,10 @@ } mReadyRequests.remove(pr); + Tp::MethodInvocationContextPtr<> context = mContexts.take(textChannel.data()); + if (context) { + context->setFinished(); + } Q_EMIT textChannelAvailable(textChannel); } @@ -133,15 +139,37 @@ return; } - Tp::ChannelPtr channel = mReadyRequests[pr]; + Tp::ChannelPtr channel = mReadyRequests.take(pr); Tp::CallChannelPtr callChannel = Tp::CallChannelPtr::dynamicCast(channel); + Tp::MethodInvocationContextPtr<> context = mContexts.take(channel.data()); if(!callChannel) { + if (context) { + context->setFinishedWithError(TP_QT_ERROR_CONFUSED, "Channel was not a call channel"); + } qCritical() << "The saved channel is not a Tp::CallChannel"; return; } - mReadyRequests.remove(pr); + // if the call is neither Accepted nor Active, it means it got dispatched directly to the handler without passing + // through any approver. For phone calls, this would mean calls getting auto-accepted which is not desirable + // so we return an error here + bool incoming = false; + AccountEntry *accountEntry = TelepathyHelper::instance()->accountForConnection(callChannel->connection()); + if (accountEntry) { + incoming = callChannel->initiatorContact() != accountEntry->account()->connection()->selfContact(); + } + if (incoming && callChannel->callState() != Tp::CallStateAccepted && callChannel->callState() != Tp::CallStateActive) { + qWarning() << "Available channel was not approved by telephony-service-approver, ignoring it."; + if (context) { + context->setFinishedWithError(TP_QT_ERROR_NOT_CAPABLE, "Only channels approved and accepted by telephony-service-approver are supported"); + } + return; + } + + if (context) { + context->setFinished(); + } Q_EMIT callChannelAvailable(callChannel); } diff -Nru telephony-service-0.1+15.10.20150608.4/handler/handler.h telephony-service-0.1+15.10.20150709/handler/handler.h --- telephony-service-0.1+15.10.20150608.4/handler/handler.h 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/handler/handler.h 2015-07-09 13:46:02.000000000 +0000 @@ -56,6 +56,7 @@ private: QMap mReadyRequests; + QMap > mContexts; }; #endif // HANDLER_H diff -Nru telephony-service-0.1+15.10.20150608.4/handler/texthandler.cpp telephony-service-0.1+15.10.20150709/handler/texthandler.cpp --- telephony-service-0.1+15.10.20150608.4/handler/texthandler.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/handler/texthandler.cpp 2015-07-09 13:45:55.000000000 +0000 @@ -270,15 +270,34 @@ // account does not exist return; } + + // check if the message should be sent via multimedia account + if (account->type() == AccountEntry::PhoneAccount) { + // we just use fallback to 1-1 chats + if (recipients.size() == 1) { + + Q_FOREACH(AccountEntry *newAccount, TelepathyHelper::instance()->accounts()) { + // TODO: we have to find the multimedia account that matches the same phone number, + // but for now we just pick any multimedia connected account + if (newAccount->type() == AccountEntry::MultimediaAccount) { + if (newAccount->connected()) { + account = newAccount; + break; + } + } + } + } + } + if (!account->connected()) { - mPendingMessages[accountId][recipients].append(message); + mPendingMessages[account->accountId()][recipients].append(message); return; } - Tp::TextChannelPtr channel = existingChat(recipients, accountId); + Tp::TextChannelPtr channel = existingChat(recipients, account->accountId()); if (channel.isNull()) { - mPendingMessages[accountId][recipients].append(message); - startChat(recipients, accountId); + mPendingMessages[account->accountId()][recipients].append(message); + startChat(recipients, account->accountId()); return; } diff -Nru telephony-service-0.1+15.10.20150608.4/indicator/icons/CMakeLists.txt telephony-service-0.1+15.10.20150709/indicator/icons/CMakeLists.txt --- telephony-service-0.1+15.10.20150608.4/indicator/icons/CMakeLists.txt 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/indicator/icons/CMakeLists.txt 2015-07-09 13:46:02.000000000 +0000 @@ -1,3 +1,4 @@ +set (icon-theme Humanity) set(icons notification-group-call.svg @@ -5,4 +6,4 @@ notification-unknown-call.svg ) -install(FILES ${icons} DESTINATION share/notify-osd/icons/gnome/scalable/status) +install(FILES ${icons} DESTINATION share/notify-osd/icons/${icon-theme}/scalable/status) diff -Nru telephony-service-0.1+15.10.20150608.4/indicator/messagingmenu.cpp telephony-service-0.1+15.10.20150709/indicator/messagingmenu.cpp --- telephony-service-0.1+15.10.20150608.4/indicator/messagingmenu.cpp 2015-06-08 23:04:06.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/indicator/messagingmenu.cpp 2015-07-09 13:46:02.000000000 +0000 @@ -192,7 +192,7 @@ }); // FIXME: For accounts not based on phone numbers, don't try to match contacts for now - if (account->type() == AccountEntry::PhoneAccount) { + if (account->type() == AccountEntry::PhoneAccount || account->type() == AccountEntry::MultimediaAccount) { request->setManager(ContactUtils::sharedManager()); request->start(); } else { @@ -251,7 +251,6 @@ messaging_menu_app_append_message(mCallsApp, message, SOURCE_ID, true); mCalls.append(call); - g_variant_unref(messages); g_object_unref(file); g_object_unref(icon); g_object_unref(message); @@ -523,7 +522,7 @@ } qDebug() << "TelephonyService/MessagingMenu: Calling back" << call.targetId; // FIXME: support accounts not based on phone numbers - if (account->type() == AccountEntry::PhoneAccount) { + if (account->type() == AccountEntry::PhoneAccount || account->type() == AccountEntry::MultimediaAccount) { ApplicationUtils::openUrl(QString("tel:///%1").arg(QString(QUrl::toPercentEncoding(call.targetId)))); } } diff -Nru telephony-service-0.1+15.10.20150608.4/indicator/textchannelobserver.cpp telephony-service-0.1+15.10.20150709/indicator/textchannelobserver.cpp --- telephony-service-0.1+15.10.20150608.4/indicator/textchannelobserver.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/indicator/textchannelobserver.cpp 2015-07-09 13:45:55.000000000 +0000 @@ -90,7 +90,7 @@ NotificationData *notificationData = (NotificationData*) data; if (notificationData != NULL) { AccountEntry *account = TelepathyHelper::instance()->accountForId(notificationData->accountId); - bool phoneNumberBased = account && (account->type() == AccountEntry::PhoneAccount); + bool phoneNumberBased = account && (account->type() == AccountEntry::PhoneAccount || account->type() == AccountEntry::MultimediaAccount); QStringList recipients; recipients << notificationData->senderId << notificationData->participantIds; History::Thread thread = History::Manager::instance()->threadForParticipants(notificationData->accountId, @@ -195,7 +195,7 @@ // check if the account is available if (!account->connected()) { - bool phoneNumberBased = account->type() == AccountEntry::PhoneAccount; + bool phoneNumberBased = account->type() == AccountEntry::PhoneAccount || account->type() == AccountEntry::MultimediaAccount; History::Thread thread = History::Manager::instance()->threadForParticipants(account->accountId(), History::EventTypeText, recipients, @@ -364,7 +364,7 @@ }); // FIXME: For accounts not based on phone numbers, don't try to match contacts for now - if (account->type() == AccountEntry::PhoneAccount) { + if (account->type() == AccountEntry::PhoneAccount || account->type() == AccountEntry::MultimediaAccount) { request->setManager(ContactUtils::sharedManager()); request->start(); } else { @@ -380,6 +380,8 @@ Tp::ContactPtr telepathyContact = message.sender(); QString messageText = message.text(); + AccountEntry *account = TelepathyHelper::instance()->accountForId(accountId); + Tp::MessagePartList messageParts = message.parts(); bool mms = message.header()["mms"].variant().toBool(); if (mms) { @@ -391,19 +393,21 @@ break; } } - // WORKAROUND: powerd can't decide when to wake up the screen on incoming mms's - // as the download of the attachments is made by another daemon, so we wake up - // the screen here. - if (!CallManager::instance()->hasCalls()) { - QDBusInterface unityIface("com.canonical.Unity.Screen", - "/com/canonical/Unity/Screen", - "com.canonical.Unity.Screen", - QDBusConnection::systemBus()); - QList args; - args.append("on"); - args.append(0); - unityIface.callWithArgumentList(QDBus::NoBlock, "setScreenPowerMode", args); - } + } + + // WORKAROUND: powerd can't decide when to wake up the screen on incoming mms's + // (or other telepathy accounts) as the download of the attachments is made by + // another daemon, so we wake up the screen here. + if (!CallManager::instance()->hasCalls() && + (mms || account->type() != AccountEntry::PhoneAccount)) { + QDBusInterface unityIface("com.canonical.Unity.Screen", + "/com/canonical/Unity/Screen", + "com.canonical.Unity.Screen", + QDBusConnection::systemBus()); + QList args; + args.append("on"); + args.append(0); + unityIface.callWithArgumentList(QDBus::NoBlock, "setScreenPowerMode", args); } // add the message to the messaging menu (use hex format to avoid invalid characters) @@ -488,7 +492,7 @@ NotificationData *data = i.value(); AccountEntry *account = TelepathyHelper::instance()->accountForId(data->accountId); - if (!account || account->type() != AccountEntry::PhoneAccount) { + if (!account || (account->type() != AccountEntry::PhoneAccount && account->type() != AccountEntry::MultimediaAccount)) { return; } diff -Nru telephony-service-0.1+15.10.20150608.4/indicator/ussdindicator.cpp telephony-service-0.1+15.10.20150709/indicator/ussdindicator.cpp --- telephony-service-0.1+15.10.20150608.4/indicator/ussdindicator.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/indicator/ussdindicator.cpp 2015-07-09 13:46:02.000000000 +0000 @@ -32,6 +32,7 @@ USSDIndicator::USSDIndicator(QObject *parent) : QObject(parent), + m_notificationId(-1), m_menuRequest(true), m_menuNotification(false), m_notifications("org.freedesktop.Notifications", @@ -99,7 +100,13 @@ void USSDIndicator::onStateChanged(const QString &state) { - // TODO: check if we should close notifications when the state is idle + if (m_notificationId == -1) { + return; + } + + if (state == "idle") { + m_notifications.CloseNotification(m_notificationId); + } } void USSDIndicator::showUSSDNotification(const QString &message, bool replyRequired, USSDManager *ussdManager) @@ -116,6 +123,7 @@ QVariantMap notificationHints; notificationHints["x-canonical-snap-decisions"] = "true"; notificationHints["x-canonical-private-button-tint"] = "true"; + notificationHints["x-canonical-snap-decisions-timeout"] = -1; QVariantMap menuModelActions; menuModelActions["notifications"] = menu->actionPath(); @@ -148,7 +156,7 @@ return; } - m_notificationId = 0; + m_notificationId = -1; if (actionKey == "reply_id") { ussdManager->respond(m_menuRequest.response()); @@ -162,19 +170,18 @@ if (id != m_notificationId) { return; } - m_notifications.CloseNotification(m_notificationId); - m_notificationId = 0; + m_notificationId = -1; } void USSDIndicator::clear() { - if (m_notificationId != 0) { + if (m_notificationId != -1) { USSDManager *ussdManager = mUSSDRequests.take(m_notificationId); if (ussdManager) { ussdManager->cancel(); } m_notifications.CloseNotification(m_notificationId); - m_notificationId = 0; + m_notificationId = -1; } } diff -Nru telephony-service-0.1+15.10.20150608.4/libtelephonyservice/accountentry.cpp telephony-service-0.1+15.10.20150709/libtelephonyservice/accountentry.cpp --- telephony-service-0.1+15.10.20150608.4/libtelephonyservice/accountentry.cpp 2015-06-08 23:04:01.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/libtelephonyservice/accountentry.cpp 2015-07-09 13:45:55.000000000 +0000 @@ -22,9 +22,10 @@ #include #include #include "accountentry.h" +#include "protocolmanager.h" AccountEntry::AccountEntry(const Tp::AccountPtr &account, QObject *parent) : - QObject(parent), mAccount(account), mReady(false) + QObject(parent), mAccount(account), mReady(false), mProtocol(0) { initialize(); } @@ -122,12 +123,19 @@ return first == second; } +Protocol *AccountEntry::protocolInfo() const +{ + return mProtocol; +} + void AccountEntry::initialize() { if (mAccount.isNull()) { return; } + mProtocol = ProtocolManager::instance()->protocolByName(mAccount->protocolName()); + // propagate the display name changes connect(mAccount.data(), SIGNAL(removed()), @@ -194,7 +202,7 @@ void AccountEntry::watchSelfContactPresence() { - if (mAccount.isNull() || mAccount->connection().isNull()) { + if (mAccount.isNull() || mAccount->connection().isNull() || mAccount->connection()->selfContact().isNull()) { return; } diff -Nru telephony-service-0.1+15.10.20150608.4/libtelephonyservice/accountentryfactory.cpp telephony-service-0.1+15.10.20150709/libtelephonyservice/accountentryfactory.cpp --- telephony-service-0.1+15.10.20150608.4/libtelephonyservice/accountentryfactory.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/libtelephonyservice/accountentryfactory.cpp 2015-07-09 13:45:55.000000000 +0000 @@ -22,6 +22,7 @@ #include "accountentryfactory.h" #include "accountentry.h" #include "ofonoaccountentry.h" +#include "multimediaaccountentry.h" AccountEntry *AccountEntryFactory::createEntry(const Tp::AccountPtr &account, QObject *parent) { @@ -31,6 +32,9 @@ if (protocol == "ofono") { return new OfonoAccountEntry(account, parent); } + if (protocol == "multimedia") { + return new MultimediaAccountEntry(account, parent); + } return new AccountEntry(account, parent); } diff -Nru telephony-service-0.1+15.10.20150608.4/libtelephonyservice/accountentry.h telephony-service-0.1+15.10.20150709/libtelephonyservice/accountentry.h --- telephony-service-0.1+15.10.20150608.4/libtelephonyservice/accountentry.h 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/libtelephonyservice/accountentry.h 2015-07-09 13:45:55.000000000 +0000 @@ -25,6 +25,8 @@ #include #include +class Protocol; + typedef struct { QString busName; QString objectPath; @@ -42,12 +44,14 @@ Q_PROPERTY(QString selfContactId READ selfContactId NOTIFY selfContactIdChanged) Q_PROPERTY(bool connected READ connected NOTIFY connectedChanged) Q_PROPERTY(QStringList addressableVCardFields READ addressableVCardFields NOTIFY addressableVCardFieldsChanged) + Q_PROPERTY(Protocol* protocolInfo READ protocolInfo CONSTANT) Q_ENUMS(AccountType) friend class AccountEntryFactory; public: enum AccountType { PhoneAccount, + MultimediaAccount, GenericAccount }; @@ -66,6 +70,8 @@ virtual bool compareIds(const QString &first, const QString &second) const; + Protocol *protocolInfo() const; + Q_SIGNALS: void accountReady(); void accountIdChanged(); @@ -92,6 +98,7 @@ Tp::AccountPtr mAccount; ConnectionInfo mConnectionInfo; bool mReady; + Protocol *mProtocol; }; #endif // ACCOUNTENTRY_H diff -Nru telephony-service-0.1+15.10.20150608.4/libtelephonyservice/applicationutils.cpp telephony-service-0.1+15.10.20150709/libtelephonyservice/applicationutils.cpp --- telephony-service-0.1+15.10.20150608.4/libtelephonyservice/applicationutils.cpp 2015-06-08 23:04:06.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/libtelephonyservice/applicationutils.cpp 2015-07-09 13:46:02.000000000 +0000 @@ -60,13 +60,15 @@ bool ApplicationUtils::openUrl(const QUrl &url) { #ifdef USE_UBUNTU_PLATFORM_API - UAUrlDispatcherSession* session = ua_url_dispatcher_session(); - if (!session) - return false; + if (qgetenv("TELEPHONY_SERVICE_TEST").isEmpty()) { + UAUrlDispatcherSession* session = ua_url_dispatcher_session(); + if (!session) + return false; - ua_url_dispatcher_session_open(session, url.toEncoded().constData(), NULL, NULL); + ua_url_dispatcher_session_open(session, url.toEncoded().constData(), NULL, NULL); - free(session); + free(session); + } #endif return true; } diff -Nru telephony-service-0.1+15.10.20150608.4/libtelephonyservice/callentry.cpp telephony-service-0.1+15.10.20150709/libtelephonyservice/callentry.cpp --- telephony-service-0.1+15.10.20150608.4/libtelephonyservice/callentry.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/libtelephonyservice/callentry.cpp 2015-07-09 13:46:02.000000000 +0000 @@ -295,7 +295,7 @@ QString CallEntry::phoneNumber() const { - if (mChannel->isConference() || !mChannel->actualFeatures().contains(Tp::CallChannel::FeatureCore)) { + if (mChannel->isConference() || !mChannel->actualFeatures().contains(Tp::CallChannel::FeatureCore) || mChannel->targetContact().isNull()) { return ""; } return mChannel->targetContact()->id(); diff -Nru telephony-service-0.1+15.10.20150608.4/libtelephonyservice/channelobserver.cpp telephony-service-0.1+15.10.20150709/libtelephonyservice/channelobserver.cpp --- telephony-service-0.1+15.10.20150608.4/libtelephonyservice/channelobserver.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/libtelephonyservice/channelobserver.cpp 2015-07-09 13:45:55.000000000 +0000 @@ -20,6 +20,7 @@ */ #include "channelobserver.h" +#include "protocolmanager.h" #include "telepathyhelper.h" #include #include @@ -56,7 +57,7 @@ Q_UNUSED(requestsSatisfied) Q_UNUSED(observerInfo) - if (!TelepathyHelper::instance()->supportedProtocols().contains(account->protocolName())) { + if (!ProtocolManager::instance()->isProtocolSupported(account->protocolName())) { context->setFinishedWithError(TP_QT_ERROR_NOT_CAPABLE, "The account for this request is not supported."); return; } diff -Nru telephony-service-0.1+15.10.20150608.4/libtelephonyservice/CMakeLists.txt telephony-service-0.1+15.10.20150709/libtelephonyservice/CMakeLists.txt --- telephony-service-0.1+15.10.20150608.4/libtelephonyservice/CMakeLists.txt 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/libtelephonyservice/CMakeLists.txt 2015-07-09 13:45:55.000000000 +0000 @@ -10,8 +10,11 @@ chatmanager.cpp contactutils.cpp greetercontacts.cpp + multimediaaccountentry.cpp ofonoaccountentry.cpp phoneutils.cpp + protocol.cpp + protocolmanager.cpp ringtone.cpp telepathyhelper.cpp tonegenerator.cpp diff -Nru telephony-service-0.1+15.10.20150608.4/libtelephonyservice/multimediaaccountentry.cpp telephony-service-0.1+15.10.20150709/libtelephonyservice/multimediaaccountentry.cpp --- telephony-service-0.1+15.10.20150608.4/libtelephonyservice/multimediaaccountentry.cpp 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/libtelephonyservice/multimediaaccountentry.cpp 2015-07-09 13:45:55.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2013-2015 Canonical, Ltd. + * + * Authors: + * Gustavo Pichorim Boiko + * Tiago Salem Herrmann + * + * This file is part of telephony-service. + * + * telephony-service is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 3. + * + * telephony-service is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "multimediaaccountentry.h" +#include "phoneutils.h" +#include "telepathyhelper.h" + +MultimediaAccountEntry::MultimediaAccountEntry(const Tp::AccountPtr &account, QObject *parent) : + AccountEntry(account, parent) +{ +} + +AccountEntry::AccountType MultimediaAccountEntry::type() const +{ + return AccountEntry::MultimediaAccount; +} + +bool MultimediaAccountEntry::connected() const +{ + return !mAccount.isNull() && !mAccount->connection().isNull() && + !mAccount->connection()->selfContact().isNull() && + mAccount->connection()->selfContact()->presence().type() != Tp::ConnectionPresenceTypeOffline; +} + +bool MultimediaAccountEntry::compareIds(const QString &first, const QString &second) const +{ + return PhoneUtils::comparePhoneNumbers(first, second); +} + +QStringList MultimediaAccountEntry::addressableVCardFields() +{ + return mAccount->protocolInfo().addressableVCardFields(); +} + +void MultimediaAccountEntry::onConnectionChanged() +{ + // make sure the generic code is also run + AccountEntry::onConnectionChanged(); +} diff -Nru telephony-service-0.1+15.10.20150608.4/libtelephonyservice/multimediaaccountentry.h telephony-service-0.1+15.10.20150709/libtelephonyservice/multimediaaccountentry.h --- telephony-service-0.1+15.10.20150608.4/libtelephonyservice/multimediaaccountentry.h 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/libtelephonyservice/multimediaaccountentry.h 2015-07-09 13:45:55.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2013-2015 Canonical, Ltd. + * + * Authors: + * Gustavo Pichorim Boiko + * Tiago Salem Herrmann + * + * This file is part of telephony-service. + * + * telephony-service is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 3. + * + * telephony-service is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef MULTIMEDIAACCOUNTENTRY_H +#define MULTIMEDIAACCOUNTENTRY_H + +#include "accountentry.h" + +class MultimediaAccountEntry : public AccountEntry +{ + Q_OBJECT + friend class AccountEntryFactory; + +public: + // reimplemented from AccountEntry + virtual AccountEntry::AccountType type() const; + virtual bool connected() const; + virtual bool compareIds(const QString &first, const QString &second) const; + virtual QStringList addressableVCardFields(); + +private Q_SLOTS: + // reimplemented from AccountEntry + void onConnectionChanged(); + +protected: + explicit MultimediaAccountEntry(const Tp::AccountPtr &account, QObject *parent = 0); +}; + +#endif // MULTIMEDIAACCOUNTENTRY_H diff -Nru telephony-service-0.1+15.10.20150608.4/libtelephonyservice/phoneutils.cpp telephony-service-0.1+15.10.20150709/libtelephonyservice/phoneutils.cpp --- telephony-service-0.1+15.10.20150608.4/libtelephonyservice/phoneutils.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/libtelephonyservice/phoneutils.cpp 2015-07-09 13:45:55.000000000 +0000 @@ -39,7 +39,7 @@ bool PhoneUtils::isPhoneNumber(const QString &identifier) { // remove all non diable digits - QString finalNumber = QString(identifier).replace(QRegExp("[p+*#(),;-]"),""); + QString finalNumber = QString(identifier).replace(QRegExp("[p+*#/(),;-]"),""); finalNumber = finalNumber.replace(QRegExp("(\\s+)"), ""); // if empty, the number is invalid if (finalNumber.isEmpty()) diff -Nru telephony-service-0.1+15.10.20150608.4/libtelephonyservice/protocol.cpp telephony-service-0.1+15.10.20150709/libtelephonyservice/protocol.cpp --- telephony-service-0.1+15.10.20150608.4/libtelephonyservice/protocol.cpp 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/libtelephonyservice/protocol.cpp 2015-07-09 13:45:55.000000000 +0000 @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2015 Canonical, Ltd. + * + * Authors: + * Gustavo Pichorim Boiko + * + * This file is part of telephony-service. + * + * telephony-service is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 3. + * + * telephony-service is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "protocol.h" +#include +#include + +Protocol::Protocol(const QString &name, Features features, const QString &fallbackProtocol, QObject *parent) +: QObject(parent), mName(name), mFeatures(features), mFallbackProtocol(fallbackProtocol) +{ +} + +QString Protocol::name() const +{ + return mName; +} + +Protocol::Features Protocol::features() const +{ + return mFeatures; +} + +QString Protocol::fallbackProtocol() const +{ + return mFallbackProtocol; +} + +Protocol *Protocol::fromFile(const QString &fileName) +{ + QFileInfo file(fileName); + if (!file.isReadable() || file.suffix() != "protocol") { + return 0; + } + + QString protocolName = file.baseName(); + QSettings settings(fileName, QSettings::IniFormat); + settings.beginGroup("Protocol"); + QString name = settings.value("Name", protocolName).toString(); + QStringList featureList = settings.value("Features").toStringList(); + Protocol::Features features; + Q_FOREACH(const QString &feature, featureList) { + if (feature == "text") { + features |= Protocol::TextChats; + } else if (feature == "voice") { + features |= Protocol::VoiceCalls; + } + } + QString fallbackProtocol = settings.value("FallbackProtocol").toString(); + + return new Protocol(name, features, fallbackProtocol); +} diff -Nru telephony-service-0.1+15.10.20150608.4/libtelephonyservice/protocol.h telephony-service-0.1+15.10.20150709/libtelephonyservice/protocol.h --- telephony-service-0.1+15.10.20150608.4/libtelephonyservice/protocol.h 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/libtelephonyservice/protocol.h 2015-07-09 13:45:55.000000000 +0000 @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2015 Canonical, Ltd. + * + * Authors: + * Gustavo Pichorim Boiko + * + * This file is part of telephony-service. + * + * telephony-service is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 3. + * + * telephony-service is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef PROTOCOL_H +#define PROTOCOL_H + +#include + +/// @brief describes one protocol and the features it supports +class Protocol : public QObject +{ + Q_OBJECT + /// @brief the name of the protocol + Q_PROPERTY(QString name READ name CONSTANT) + + /// @brief the features this protocol supports + Q_PROPERTY(Features features READ features CONSTANT) + + /// @brief the fallback protocol to be used for operations that support it (mainly text features) + Q_PROPERTY(QString fallbackProtocol READ fallbackProtocol CONSTANT) +public: + enum Feature { + TextChats = 0x1, + VoiceCalls = 0x2 + }; + Q_DECLARE_FLAGS(Features, Feature) + + QString name() const; + Features features() const; + QString fallbackProtocol() const; + + static Protocol *fromFile(const QString &fileName); + + friend class ProtocolManager; + +protected: + explicit Protocol(const QString &name, Features features, const QString &fallbackProtocol = QString::null, QObject *parent = 0); + +private: + QString mName; + Features mFeatures; + QString mFallbackProtocol; +}; + +typedef QList Protocols; + +#endif // PROTOCOL_H diff -Nru telephony-service-0.1+15.10.20150608.4/libtelephonyservice/protocolmanager.cpp telephony-service-0.1+15.10.20150709/libtelephonyservice/protocolmanager.cpp --- telephony-service-0.1+15.10.20150608.4/libtelephonyservice/protocolmanager.cpp 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/libtelephonyservice/protocolmanager.cpp 2015-07-09 13:45:55.000000000 +0000 @@ -0,0 +1,165 @@ +/* + * Copyright (C) 2015 Canonical, Ltd. + * + * Authors: + * Gustavo Pichorim Boiko + * + * This file is part of telephony-service. + * + * telephony-service is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 3. + * + * telephony-service is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "protocolmanager.h" +#include "config.h" +#include + +ProtocolManager::ProtocolManager(const QString &dir, QObject *parent) : + QObject(parent), mProtocolsDir(dir) +{ + mFileWatcher.addPath(mProtocolsDir); + connect(&mFileWatcher, + SIGNAL(directoryChanged(QString)), + SLOT(loadSupportedProtocols())); + loadSupportedProtocols(); +} + +ProtocolManager *ProtocolManager::instance() +{ + static ProtocolManager self(protocolsDir()); + return &self; +} + +Protocols ProtocolManager::protocols() const +{ + return mProtocols; +} + +QStringList ProtocolManager::protocolNames() const +{ + QStringList names; + Q_FOREACH(const Protocol *protocol, mProtocols) { + names << protocol->name(); + } + return names; +} + +Protocols ProtocolManager::protocolsForFeatures(Protocol::Features features) const +{ + Protocols filtered; + Q_FOREACH(Protocol *protocol, mProtocols) { + if (protocol->features() & features) { + filtered << protocol; + } + } + return filtered; +} + +Protocols ProtocolManager::textProtocols() const +{ + return protocolsForFeatures(Protocol::TextChats); +} + +Protocols ProtocolManager::voiceProtocols() const +{ + return protocolsForFeatures(Protocol::VoiceCalls); +} + +Protocol *ProtocolManager::protocolByName(const QString &protocolName) const +{ + Q_FOREACH(Protocol *protocol, mProtocols) { + if (protocol->name() == protocolName) { + return protocol; + } + } + return 0; +} + +bool ProtocolManager::isProtocolSupported(const QString &protocolName) const +{ + return protocolByName(protocolName) != 0; +} + +QQmlListProperty ProtocolManager::qmlProtocols() +{ + return QQmlListProperty(this, 0, qmlProtocolsCount, qmlProtocolsAt); +} + +int ProtocolManager::qmlProtocolsCount(QQmlListProperty *p) +{ + Q_UNUSED(p); + return ProtocolManager::instance()->protocols().count(); +} + +Protocol *ProtocolManager::qmlProtocolsAt(QQmlListProperty *p, int index) +{ + Q_UNUSED(p); + return ProtocolManager::instance()->protocols()[index]; +} + +QQmlListProperty ProtocolManager::qmlTextProtocols() +{ + return QQmlListProperty(this, 0, qmlTextProtocolsCount, qmlTextProtocolsAt); +} + +int ProtocolManager::qmlTextProtocolsCount(QQmlListProperty *p) +{ + Q_UNUSED(p); + return ProtocolManager::instance()->textProtocols().count(); +} + +Protocol *ProtocolManager::qmlTextProtocolsAt(QQmlListProperty *p, int index) +{ + Q_UNUSED(p); + return ProtocolManager::instance()->textProtocols()[index]; +} + +QQmlListProperty ProtocolManager::qmlVoiceProtocols() +{ + return QQmlListProperty(this, 0, qmlVoiceProtocolsCount, qmlVoiceProtocolsAt); +} + +int ProtocolManager::qmlVoiceProtocolsCount(QQmlListProperty *p) +{ + Q_UNUSED(p); + return ProtocolManager::instance()->voiceProtocols().count(); +} + +Protocol *ProtocolManager::qmlVoiceProtocolsAt(QQmlListProperty *p, int index) +{ + Q_UNUSED(p); + return ProtocolManager::instance()->voiceProtocols()[index]; +} + +void ProtocolManager::loadSupportedProtocols() +{ + // clear previous entries + Q_FOREACH(Protocol *protocol, mProtocols) { + protocol->deleteLater(); + } + mProtocols.clear(); + + // and scan the directory + QDir dir(mProtocolsDir); + Q_FOREACH(QString entry, dir.entryList()) { + if (!entry.endsWith(".protocol")) { + continue; + } + Protocol *protocol = Protocol::fromFile(dir.absoluteFilePath(entry)); + if (protocol) { + protocol->setParent(this); + mProtocols << protocol; + } + } + + Q_EMIT protocolsChanged(); +} diff -Nru telephony-service-0.1+15.10.20150608.4/libtelephonyservice/protocolmanager.h telephony-service-0.1+15.10.20150709/libtelephonyservice/protocolmanager.h --- telephony-service-0.1+15.10.20150608.4/libtelephonyservice/protocolmanager.h 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/libtelephonyservice/protocolmanager.h 2015-07-09 13:45:55.000000000 +0000 @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2015 Canonical, Ltd. + * + * Authors: + * Gustavo Pichorim Boiko + * + * This file is part of telephony-service. + * + * telephony-service is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 3. + * + * telephony-service is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef PROTOCOLMANAGER_H +#define PROTOCOLMANAGER_H + +#include +#include +#include +#include "protocol.h" + +/// @brief Manages the list of supported protocols +class ProtocolManager : public QObject +{ + Q_OBJECT + /// @brief all supported protocols + Q_PROPERTY(QQmlListProperty protocols + READ qmlProtocols + NOTIFY protocolsChanged) + /// @brief protocols that support text chats + Q_PROPERTY(QQmlListProperty textProtocols + READ qmlTextProtocols + NOTIFY protocolsChanged) + /// @brief protocols that support voice calls + Q_PROPERTY(QQmlListProperty voiceProtocols + READ qmlVoiceProtocols + NOTIFY protocolsChanged) + /// @brief the name of all supported protocols + Q_PROPERTY(QStringList protocolNames READ protocolNames NOTIFY protocolsChanged) + +public: + static ProtocolManager *instance(); + + /// @brief returns all supported protocols + Protocols protocols() const; + + /// @brief return the name of all supported protocols + QStringList protocolNames() const; + + /// @brief returns all protocols matching the given flags + Protocols protocolsForFeatures(Protocol::Features features) const; + + /// @brief convenience function returning all protocols that support text chats + Protocols textProtocols() const; + + /// @brief convenience function returning all protocols that support voice calls + Protocols voiceProtocols() const; + + /// @brief returns the protocol information for the given @ref protocolName or 0 if not supported + Protocol *protocolByName(const QString &protocolName) const; + + /// @brief checks if a given @ref protocolName is supported + bool isProtocolSupported(const QString &protocolName) const; + + // QML protocols property helpers + QQmlListProperty qmlProtocols(); + static int qmlProtocolsCount(QQmlListProperty *p); + static Protocol *qmlProtocolsAt(QQmlListProperty *p, int index); + + // QML textProtocols property helpers + QQmlListProperty qmlTextProtocols(); + static int qmlTextProtocolsCount(QQmlListProperty *p); + static Protocol *qmlTextProtocolsAt(QQmlListProperty *p, int index); + + // QML voiceProtocols property helpers + QQmlListProperty qmlVoiceProtocols(); + static int qmlVoiceProtocolsCount(QQmlListProperty *p); + static Protocol *qmlVoiceProtocolsAt(QQmlListProperty *p, int index); + +Q_SIGNALS: + void protocolsChanged(); + +protected Q_SLOTS: + void loadSupportedProtocols(); + +protected: + explicit ProtocolManager(const QString &dir, QObject *parent = 0); + +private: + Protocols mProtocols; + QFileSystemWatcher mFileWatcher; + QString mProtocolsDir; +}; + +#endif // PROTOCOLMANAGER_H diff -Nru telephony-service-0.1+15.10.20150608.4/libtelephonyservice/telepathyhelper.cpp telephony-service-0.1+15.10.20150709/libtelephonyservice/telepathyhelper.cpp --- telephony-service-0.1+15.10.20150608.4/libtelephonyservice/telepathyhelper.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/libtelephonyservice/telepathyhelper.cpp 2015-07-09 13:46:02.000000000 +0000 @@ -28,6 +28,7 @@ #include "callmanager.h" #include "config.h" #include "greetercontacts.h" +#include "protocolmanager.h" #include "qgsettings.h" @@ -155,7 +156,7 @@ { QList activeAccountList; Q_FOREACH(AccountEntry *account, mAccounts) { - if (account->active()) { + if (account->active() && account->type() != AccountEntry::MultimediaAccount) { activeAccountList << account; } } @@ -269,16 +270,6 @@ Q_EMIT channelObserverUnregistered(); } -QStringList TelepathyHelper::supportedProtocols() const -{ - QStringList protocols; - protocols << "ufa" - << "tel" - << "ofono" - << "mock"; // used for tests - return protocols; -} - void TelepathyHelper::setupAccountEntry(AccountEntry *entry) { connect(entry, @@ -467,7 +458,7 @@ Tp::AccountSetPtr accountSet; // try to find an account of the one of supported protocols - Q_FOREACH(const QString &protocol, supportedProtocols()) { + Q_FOREACH(const QString &protocol, ProtocolManager::instance()->protocolNames()) { accountSet = mAccountManager->accountsByProtocol(protocol); Q_FOREACH(const Tp::AccountPtr &account, accountSet->accounts()) { onNewAccount(account); @@ -475,6 +466,7 @@ } if (mAccounts.count() == 0) { + mFirstTime = false; Q_EMIT setupReady(); return; } diff -Nru telephony-service-0.1+15.10.20150608.4/libtelephonyservice/telepathyhelper.h telephony-service-0.1+15.10.20150709/libtelephonyservice/telepathyhelper.h --- telephony-service-0.1+15.10.20150608.4/libtelephonyservice/telepathyhelper.h 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/libtelephonyservice/telepathyhelper.h 2015-07-09 13:45:55.000000000 +0000 @@ -123,7 +123,6 @@ public Q_SLOTS: Q_INVOKABLE void registerChannelObserver(const QString &observerName = QString::null); Q_INVOKABLE void unregisterChannelObserver(); - QStringList supportedProtocols() const; protected: void setupAccountEntry(AccountEntry *entry); diff -Nru telephony-service-0.1+15.10.20150608.4/po/am.po telephony-service-0.1+15.10.20150709/po/am.po --- telephony-service-0.1+15.10.20150608.4/po/am.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/am.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:35+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/ar.po telephony-service-0.1+15.10.20150709/po/ar.po --- telephony-service-0.1+15.10.20150608.4/po/ar.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/ar.po 2015-07-09 13:45:55.000000000 +0000 @@ -16,8 +16,8 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n % 100 >= " "3 && n % 100 <= 10 ? 3 : n % 100 >= 11 && n % 100 <= 99 ? 4 : 5;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: ar\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/ast.po telephony-service-0.1+15.10.20150709/po/ast.po --- telephony-service-0.1+15.10.20150608.4/po/ast.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/ast.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/az.po telephony-service-0.1+15.10.20150709/po/az.po --- telephony-service-0.1+15.10.20150608.4/po/az.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/az.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/br.po telephony-service-0.1+15.10.20150709/po/br.po --- telephony-service-0.1+15.10.20150608.4/po/br.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/br.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/bs.po telephony-service-0.1+15.10.20150709/po/bs.po --- telephony-service-0.1+15.10.20150608.4/po/bs.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/bs.po 2015-07-09 13:45:55.000000000 +0000 @@ -16,8 +16,8 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/ca.po telephony-service-0.1+15.10.20150709/po/ca.po --- telephony-service-0.1+15.10.20150608.4/po/ca.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/ca.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: ca\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/ca@valencia.po telephony-service-0.1+15.10.20150709/po/ca@valencia.po --- telephony-service-0.1+15.10.20150608.4/po/ca@valencia.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/ca@valencia.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: ca\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/CMakeLists.txt telephony-service-0.1+15.10.20150709/po/CMakeLists.txt --- telephony-service-0.1+15.10.20150608.4/po/CMakeLists.txt 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/CMakeLists.txt 2015-07-09 13:46:02.000000000 +0000 @@ -28,7 +28,7 @@ find_program(XGETTEXT_EXECUTABLE xgettext) if(XGETTEXT_EXECUTABLE) - add_custom_target(${POT_FILE} ALL + add_custom_target(${POT_FILE} COMMENT "Generating translation template" COMMAND ${XGETTEXT_EXECUTABLE} --c++ --qt --add-comments=TRANSLATORS --keyword=GettextMarkExtraction --keyword=tr --keyword=tr:1,2 -D ${CMAKE_SOURCE_DIR} -s -p ${CMAKE_CURRENT_SOURCE_DIR} -o ${POT_FILE} ${I18N_SRCS} ) diff -Nru telephony-service-0.1+15.10.20150608.4/po/cs.po telephony-service-0.1+15.10.20150709/po/cs.po --- telephony-service-0.1+15.10.20150608.4/po/cs.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/cs.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: cs\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/da.po telephony-service-0.1+15.10.20150709/po/da.po --- telephony-service-0.1+15.10.20150608.4/po/da.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/da.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: da\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/de.po telephony-service-0.1+15.10.20150709/po/de.po --- telephony-service-0.1+15.10.20150608.4/po/de.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/de.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: de\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/el.po telephony-service-0.1+15.10.20150709/po/el.po --- telephony-service-0.1+15.10.20150608.4/po/el.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/el.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/en_AU.po telephony-service-0.1+15.10.20150709/po/en_AU.po --- telephony-service-0.1+15.10.20150608.4/po/en_AU.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/en_AU.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: \n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/en_GB.po telephony-service-0.1+15.10.20150709/po/en_GB.po --- telephony-service-0.1+15.10.20150608.4/po/en_GB.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/en_GB.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: \n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/es.po telephony-service-0.1+15.10.20150709/po/es.po --- telephony-service-0.1+15.10.20150608.4/po/es.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/es.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: es\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/eu.po telephony-service-0.1+15.10.20150709/po/eu.po --- telephony-service-0.1+15.10.20150608.4/po/eu.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/eu.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/fa.po telephony-service-0.1+15.10.20150709/po/fa.po --- telephony-service-0.1+15.10.20150608.4/po/fa.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/fa.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/fi.po telephony-service-0.1+15.10.20150709/po/fi.po --- telephony-service-0.1+15.10.20150608.4/po/fi.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/fi.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: fi\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/fr.po telephony-service-0.1+15.10.20150709/po/fr.po --- telephony-service-0.1+15.10.20150608.4/po/fr.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/fr.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: fr\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/gd.po telephony-service-0.1+15.10.20150709/po/gd.po --- telephony-service-0.1+15.10.20150608.4/po/gd.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/gd.po 2015-07-09 13:45:55.000000000 +0000 @@ -16,8 +16,8 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : " "(n > 2 && n < 20) ? 2 : 3;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: gd\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/gl.po telephony-service-0.1+15.10.20150709/po/gl.po --- telephony-service-0.1+15.10.20150608.4/po/gl.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/gl.po 2015-07-09 13:45:55.000000000 +0000 @@ -8,15 +8,15 @@ "Project-Id-Version: telephony-service\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2015-01-16 15:24-0200\n" -"PO-Revision-Date: 2015-01-17 19:29+0000\n" +"PO-Revision-Date: 2015-06-16 10:02+0000\n" "Last-Translator: Marcos Lans \n" "Language-Team: Galician \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format @@ -35,7 +35,7 @@ #: indicator/metrics.cpp:48 #, qt-format msgid "%1 calls made today" -msgstr "Hoxe fixo %1 chamadas" +msgstr "Hoxe fixo %1 chamada(s)" #: indicator/metrics.cpp:46 #, qt-format @@ -123,7 +123,7 @@ #: approver/approver.cpp:493 msgid "Message & decline" -msgstr "Mensaxe e rexeitar" +msgstr "Rexeitar cunha mensaxe" #: indicator/textchannelobserver.cpp:393 indicator/textchannelobserver.cpp:440 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/he.po telephony-service-0.1+15.10.20150709/po/he.po --- telephony-service-0.1+15.10.20150608.4/po/he.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/he.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: he\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/hu.po telephony-service-0.1+15.10.20150709/po/hu.po --- telephony-service-0.1+15.10.20150608.4/po/hu.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/hu.po 2015-07-09 13:45:55.000000000 +0000 @@ -8,15 +8,15 @@ "Project-Id-Version: telephony-service\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-01-16 15:24-0200\n" -"PO-Revision-Date: 2015-04-21 11:34+0000\n" +"PO-Revision-Date: 2015-06-30 19:08+0000\n" "Last-Translator: Richard Somlói \n" "Language-Team: Hungarian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: hu\n" #: indicator/messagingmenu.cpp:256 @@ -110,7 +110,7 @@ #: approver/approver.cpp:89 msgid "I'm busy at the moment. I'll call later." -msgstr "Jelenleg elfoglalt vagyok, később visszahívom." +msgstr "Elfoglalt vagyok, később visszahívom." #: indicator/messagingmenu.cpp:206 msgid "I'm busy at the moment. I'll call you later." @@ -196,7 +196,7 @@ #: indicator/messagingmenu.cpp:208 msgid "Sorry, I'm still busy. I'll call you later." -msgstr "Még mindig elfoglalt vagyok. Később visszahívom." +msgstr "Még elfoglalt vagyok. Később visszahívom." #: indicator/metrics.cpp:50 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/ia.po telephony-service-0.1+15.10.20150709/po/ia.po --- telephony-service-0.1+15.10.20150608.4/po/ia.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/ia.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/id.po telephony-service-0.1+15.10.20150709/po/id.po --- telephony-service-0.1+15.10.20150608.4/po/id.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/id.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/is.po telephony-service-0.1+15.10.20150709/po/is.po --- telephony-service-0.1+15.10.20150608.4/po/is.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/is.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/it.po telephony-service-0.1+15.10.20150709/po/it.po --- telephony-service-0.1+15.10.20150608.4/po/it.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/it.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: it\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/ja.po telephony-service-0.1+15.10.20150709/po/ja.po --- telephony-service-0.1+15.10.20150608.4/po/ja.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/ja.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/km.po telephony-service-0.1+15.10.20150709/po/km.po --- telephony-service-0.1+15.10.20150608.4/po/km.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/km.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/ko.po telephony-service-0.1+15.10.20150709/po/ko.po --- telephony-service-0.1+15.10.20150608.4/po/ko.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/ko.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: ko\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/lv.po telephony-service-0.1+15.10.20150709/po/lv.po --- telephony-service-0.1+15.10.20150608.4/po/lv.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/lv.po 2015-07-09 13:45:55.000000000 +0000 @@ -16,8 +16,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: lv\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/ms.po telephony-service-0.1+15.10.20150709/po/ms.po --- telephony-service-0.1+15.10.20150608.4/po/ms.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/ms.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/my.po telephony-service-0.1+15.10.20150709/po/my.po --- telephony-service-0.1+15.10.20150608.4/po/my.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/my.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: my\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/nb.po telephony-service-0.1+15.10.20150709/po/nb.po --- telephony-service-0.1+15.10.20150608.4/po/nb.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/nb.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: nb\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/nl.po telephony-service-0.1+15.10.20150709/po/nl.po --- telephony-service-0.1+15.10.20150608.4/po/nl.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/nl.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:58+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/oc.po telephony-service-0.1+15.10.20150709/po/oc.po --- telephony-service-0.1+15.10.20150608.4/po/oc.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/oc.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/pa.po telephony-service-0.1+15.10.20150709/po/pa.po --- telephony-service-0.1+15.10.20150608.4/po/pa.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/pa.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/pl.po telephony-service-0.1+15.10.20150709/po/pl.po --- telephony-service-0.1+15.10.20150608.4/po/pl.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/pl.po 2015-07-09 13:45:55.000000000 +0000 @@ -16,8 +16,8 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: pl\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/pt_BR.po telephony-service-0.1+15.10.20150709/po/pt_BR.po --- telephony-service-0.1+15.10.20150608.4/po/pt_BR.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/pt_BR.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: pt_BR\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/pt.po telephony-service-0.1+15.10.20150709/po/pt.po --- telephony-service-0.1+15.10.20150608.4/po/pt.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/pt.po 2015-07-09 13:45:55.000000000 +0000 @@ -8,15 +8,15 @@ "Project-Id-Version: telephony-service\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2015-01-16 15:24-0200\n" -"PO-Revision-Date: 2015-02-13 00:54+0000\n" +"PO-Revision-Date: 2015-06-18 17:29+0000\n" "Last-Translator: Ivo Xavier \n" "Language-Team: Portuguese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format @@ -29,8 +29,8 @@ #, qt-format msgid "%1 voicemail message" msgid_plural "%1 voicemail messages" -msgstr[0] "%1 mensagem de voicemail" -msgstr[1] "%1 mensagens de voicemail" +msgstr[0] "%1 mensagem de voz" +msgstr[1] "%1 mensagens de voz" #: indicator/metrics.cpp:48 #, qt-format @@ -84,7 +84,7 @@ #: indicator/textchannelobserver.cpp:207 msgid "Deactivate flight mode and try again from the messaging application." msgstr "" -"Desative o modo avião e tente novamente através da aplicação das mensagens." +"Desative o modo avião e tente novamente através da app das mensagens." #: approver/approver.cpp:485 msgid "Decline" @@ -100,7 +100,7 @@ #: indicator/messagingmenu.cpp:204 msgid "I missed your call - can you call me now?" -msgstr "Não atendi a sua chamada - pode ligar-me agora?" +msgstr "Não atendi a sua chamada - pode ligar agora?" #: indicator/messagingmenu.cpp:207 msgid "I'll be 20 minutes late." @@ -133,19 +133,19 @@ #: indicator/metrics.cpp:49 indicator/metrics.cpp:51 msgid "No calls made today" -msgstr "Nenhuma chamada feita hoje" +msgstr "Sem chamadas feitas hoje" #: indicator/metrics.cpp:47 msgid "No calls received today" -msgstr "Nenhuma chamada recebida hoje" +msgstr "Sem chamadas recebidas hoje" #: indicator/metrics.cpp:45 msgid "No text messages received today" -msgstr "Nenhuma mensagem de texto recebida hoje" +msgstr "Sem mensagens de texto recebidas hoje" #: indicator/metrics.cpp:43 msgid "No text messages sent today" -msgstr "Nenhuma mensagem de texto enviada hoje" +msgstr "Sem mensagens de texto enviadas hoje" #: indicator/ussdindicator.cpp:79 indicator/textchannelobserver.cpp:270 msgid "Ok" @@ -219,7 +219,7 @@ #: indicator/textchannelobserver.cpp:210 msgid "Try again from the messaging application." -msgstr "Tente novamente através da aplicação das mensagens." +msgstr "Tente novamente através da app das mensagens." #: Ubuntu/Telephony/contactwatcher.cpp:138 msgid "Unknown Number" @@ -236,8 +236,7 @@ #: indicator/textchannelobserver.cpp:205 msgid "Unlock your sim card and try again from the messaging application." msgstr "" -"Desbloqueie o seu cartão SIM e tente novamente através da aplicação das " -"mensagens." +"Desbloqueie o seu cartão SIM e tente novamente através da app das mensagens." #: indicator/textchannelobserver.cpp:227 indicator/textchannelobserver.cpp:411 msgid "View message" diff -Nru telephony-service-0.1+15.10.20150608.4/po/ro.po telephony-service-0.1+15.10.20150709/po/ro.po --- telephony-service-0.1+15.10.20150608.4/po/ro.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/ro.po 2015-07-09 13:45:55.000000000 +0000 @@ -16,8 +16,8 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n == 1 ? 0: (((n % 100 > 19) || ((n % 100 " "== 0) && (n != 0))) ? 2: 1));\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/ru.po telephony-service-0.1+15.10.20150709/po/ru.po --- telephony-service-0.1+15.10.20150608.4/po/ru.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/ru.po 2015-07-09 13:45:55.000000000 +0000 @@ -16,8 +16,8 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: ru\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/sl.po telephony-service-0.1+15.10.20150709/po/sl.po --- telephony-service-0.1+15.10.20150608.4/po/sl.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/sl.po 2015-07-09 13:45:55.000000000 +0000 @@ -16,8 +16,8 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || " "n%100==4 ? 3 : 0);\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/sr.po telephony-service-0.1+15.10.20150709/po/sr.po --- telephony-service-0.1+15.10.20150608.4/po/sr.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/sr.po 2015-07-09 13:45:55.000000000 +0000 @@ -16,8 +16,8 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/sv.po telephony-service-0.1+15.10.20150709/po/sv.po --- telephony-service-0.1+15.10.20150608.4/po/sv.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/sv.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: sv\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/tr.po telephony-service-0.1+15.10.20150709/po/tr.po --- telephony-service-0.1+15.10.20150608.4/po/tr.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/tr.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: tr\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/ug.po telephony-service-0.1+15.10.20150709/po/ug.po --- telephony-service-0.1+15.10.20150608.4/po/ug.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/ug.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" #: indicator/messagingmenu.cpp:256 #, qt-format diff -Nru telephony-service-0.1+15.10.20150608.4/po/uk.po telephony-service-0.1+15.10.20150709/po/uk.po --- telephony-service-0.1+15.10.20150608.4/po/uk.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/uk.po 2015-07-09 13:45:55.000000000 +0000 @@ -16,8 +16,8 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: uk\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/zh_CN.po telephony-service-0.1+15.10.20150709/po/zh_CN.po --- telephony-service-0.1+15.10.20150608.4/po/zh_CN.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/zh_CN.po 2015-07-09 13:45:55.000000000 +0000 @@ -8,15 +8,15 @@ "Project-Id-Version: telephony-service\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-01-16 15:24-0200\n" -"PO-Revision-Date: 2014-07-31 14:18+0000\n" -"Last-Translator: Anthony Wong \n" +"PO-Revision-Date: 2015-06-29 02:38+0000\n" +"Last-Translator: Ian Li \n" "Language-Team: Chinese (Simplified) \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: \n" #: indicator/messagingmenu.cpp:256 @@ -34,22 +34,22 @@ #: indicator/metrics.cpp:48 #, qt-format msgid "%1 calls made today" -msgstr "" +msgstr "今日呼出 %1 个通话" #: indicator/metrics.cpp:46 #, qt-format msgid "%1 calls received today" -msgstr "" +msgstr "今日接听 %1 个通话" #: indicator/metrics.cpp:44 #, qt-format msgid "%1 text messages received today" -msgstr "" +msgstr "今日收到 %1 条短信" #: indicator/metrics.cpp:42 #, qt-format msgid "%1 text messages sent today" -msgstr "" +msgstr "今日发送 %1 条短信" #: approver/approver.cpp:463 msgid "Accept" @@ -57,7 +57,7 @@ #: indicator/messagingmenu.cpp:199 msgid "Call back" -msgstr "" +msgstr "回电" #: approver/approver.cpp:429 msgid "Caller number is not available" @@ -70,7 +70,7 @@ #: approver/approver.cpp:422 msgid "Calling from private number" -msgstr "私人号码来电" +msgstr "私密号码来电" #: approver/approver.cpp:424 msgid "Calling from unknown number" @@ -82,7 +82,7 @@ #: indicator/textchannelobserver.cpp:207 msgid "Deactivate flight mode and try again from the messaging application." -msgstr "" +msgstr "关闭飞行模式并在短信应用中重试。" #: approver/approver.cpp:485 msgid "Decline" @@ -90,11 +90,11 @@ #: approver/approver.cpp:476 msgid "End + Answer" -msgstr "" +msgstr "挂断 + 应答" #: approver/approver.cpp:462 msgid "Hold + Answer" -msgstr "" +msgstr "挂起 + 应答" #: indicator/messagingmenu.cpp:204 msgid "I missed your call - can you call me now?" @@ -106,7 +106,7 @@ #: approver/approver.cpp:89 msgid "I'm busy at the moment. I'll call later." -msgstr "" +msgstr "此刻我正忙。稍后我将回电。" #: indicator/messagingmenu.cpp:206 msgid "I'm busy at the moment. I'll call you later." @@ -114,7 +114,7 @@ #: approver/approver.cpp:90 msgid "I'm running late, on my way now." -msgstr "" +msgstr "我迟了,正在路上。" #: indicator/messagingmenu.cpp:205 msgid "I'm running late. I'm on my way." @@ -122,28 +122,28 @@ #: approver/approver.cpp:493 msgid "Message & decline" -msgstr "" +msgstr "拒接并发送短信" #: indicator/textchannelobserver.cpp:393 indicator/textchannelobserver.cpp:440 #, qt-format msgid "Message from %1" -msgstr "" +msgstr "来自 %1 的短信" #: indicator/metrics.cpp:49 indicator/metrics.cpp:51 msgid "No calls made today" -msgstr "" +msgstr "今日无呼出" #: indicator/metrics.cpp:47 msgid "No calls received today" -msgstr "" +msgstr "今日无接听" #: indicator/metrics.cpp:45 msgid "No text messages received today" -msgstr "" +msgstr "今日未收到短信" #: indicator/metrics.cpp:43 msgid "No text messages sent today" -msgstr "" +msgstr "今日未发送短信" #: indicator/ussdindicator.cpp:79 indicator/textchannelobserver.cpp:270 msgid "Ok" @@ -155,19 +155,19 @@ #: approver/approver.cpp:91 msgid "Please call me back later." -msgstr "" +msgstr "请稍后再呼叫我。" #: indicator/textchannelobserver.cpp:539 msgid "Please, select a SIM card:" -msgstr "" +msgstr "请选择一张SIM卡:" #: Ubuntu/Telephony/contactwatcher.cpp:136 msgid "Private Number" -msgstr "" +msgstr "私密号码" #: indicator/messagingmenu.cpp:259 msgid "Private number" -msgstr "" +msgstr "私密号码" #: indicator/ussdindicator.cpp:82 msgid "Reply" @@ -176,7 +176,7 @@ #: handler/displaynamesettings.cpp:34 #, qt-format msgid "SIM %1" -msgstr "" +msgstr "SIM卡 %1" #: indicator/telephony-service-sms.desktop.in:3 msgid "SMS" @@ -188,7 +188,7 @@ #: indicator/messagingmenu.cpp:151 indicator/messagingmenu.cpp:214 msgid "Send" -msgstr "" +msgstr "发送" #: indicator/messagingmenu.cpp:208 msgid "Sorry, I'm still busy. I'll call you later." @@ -197,27 +197,27 @@ #: indicator/metrics.cpp:50 #, qt-format msgid "Spent %1 minutes in calls today" -msgstr "" +msgstr "今日通话时长 %1 分钟" #: indicator/messagingmenu.cpp:55 indicator/messagingmenu.cpp:59 msgid "Telephony Service" -msgstr "" +msgstr "电话服务" #: approver/main.cpp:46 msgid "Telephony Service Approver" -msgstr "" +msgstr "电话服务核准" #: indicator/main.cpp:50 msgid "Telephony Service Indicator" -msgstr "" +msgstr "电话服务指示器" #: indicator/textchannelobserver.cpp:215 msgid "The message could not be sent" -msgstr "" +msgstr "本短信无法被发送" #: indicator/textchannelobserver.cpp:210 msgid "Try again from the messaging application." -msgstr "" +msgstr "请使用短信应用重试。" #: Ubuntu/Telephony/contactwatcher.cpp:138 msgid "Unknown Number" @@ -229,11 +229,11 @@ #: indicator/messagingmenu.cpp:263 msgid "Unknown number" -msgstr "" +msgstr "未知号码" #: indicator/textchannelobserver.cpp:205 msgid "Unlock your sim card and try again from the messaging application." -msgstr "" +msgstr "请解锁你的SIM卡,然后在短信应用中重试。" #: indicator/textchannelobserver.cpp:227 indicator/textchannelobserver.cpp:411 msgid "View message" @@ -241,7 +241,7 @@ #: indicator/messagingmenu.cpp:313 msgid "Voicemail" -msgstr "" +msgstr "语音信箱" #: indicator/messagingmenu.cpp:305 msgid "Voicemail messages" diff -Nru telephony-service-0.1+15.10.20150608.4/po/zh_HK.po telephony-service-0.1+15.10.20150709/po/zh_HK.po --- telephony-service-0.1+15.10.20150608.4/po/zh_HK.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/zh_HK.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: zh_HK\n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/po/zh_TW.po telephony-service-0.1+15.10.20150709/po/zh_TW.po --- telephony-service-0.1+15.10.20150608.4/po/zh_TW.po 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/po/zh_TW.po 2015-07-09 13:45:55.000000000 +0000 @@ -15,8 +15,8 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Launchpad-Export-Date: 2015-05-29 05:36+0000\n" -"X-Generator: Launchpad (build 17532)\n" +"X-Launchpad-Export-Date: 2015-07-09 05:59+0000\n" +"X-Generator: Launchpad (build 17608)\n" "Language: \n" #: indicator/messagingmenu.cpp:256 diff -Nru telephony-service-0.1+15.10.20150608.4/protocols/CMakeLists.txt telephony-service-0.1+15.10.20150709/protocols/CMakeLists.txt --- telephony-service-0.1+15.10.20150608.4/protocols/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/protocols/CMakeLists.txt 2015-07-09 13:45:55.000000000 +0000 @@ -0,0 +1,2 @@ +file(GLOB PROTOCOL_FILES *.protocol) +install(FILES ${PROTOCOL_FILES} DESTINATION ${TELEPHONY_SERVICE_DIR}/protocols) diff -Nru telephony-service-0.1+15.10.20150608.4/protocols/mock.protocol telephony-service-0.1+15.10.20150709/protocols/mock.protocol --- telephony-service-0.1+15.10.20150608.4/protocols/mock.protocol 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/protocols/mock.protocol 2015-07-09 13:45:55.000000000 +0000 @@ -0,0 +1,4 @@ +[Protocol] +Name=mock +Features=text,voice +FallbackProtocol= diff -Nru telephony-service-0.1+15.10.20150608.4/protocols/multimedia.protocol telephony-service-0.1+15.10.20150709/protocols/multimedia.protocol --- telephony-service-0.1+15.10.20150608.4/protocols/multimedia.protocol 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/protocols/multimedia.protocol 2015-07-09 13:45:55.000000000 +0000 @@ -0,0 +1,4 @@ +[Protocol] +Name=multimedia +Features=text +FallbackProtocol=ofono diff -Nru telephony-service-0.1+15.10.20150608.4/protocols/ofono.protocol telephony-service-0.1+15.10.20150709/protocols/ofono.protocol --- telephony-service-0.1+15.10.20150608.4/protocols/ofono.protocol 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/protocols/ofono.protocol 2015-07-09 13:45:55.000000000 +0000 @@ -0,0 +1,4 @@ +[Protocol] +Name=ofono +Features=text,voice +FallbackProtocol= diff -Nru telephony-service-0.1+15.10.20150608.4/tests/approver/approvercontroller.cpp telephony-service-0.1+15.10.20150709/tests/approver/approvercontroller.cpp --- telephony-service-0.1+15.10.20150608.4/tests/approver/approvercontroller.cpp 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/approver/approvercontroller.cpp 2015-07-09 13:46:02.000000000 +0000 @@ -0,0 +1,49 @@ +/** + * Copyright (C) 2013-2015 Canonical, Ltd. + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License version 3, as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, + * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Authors: + * Gustavo Pichorim Boiko + */ + +#include +#include "approvercontroller.h" +#include +#include + +#define APPROVER_SERVICE "com.canonical.Approver" +#define APPROVER_OBJECT "/com/canonical/Approver" +#define APPROVER_INTERFACE "com.canonical.TelephonyServiceApprover" + +ApproverController *ApproverController::instance() +{ + static ApproverController *self = new ApproverController(); + return self; +} + +ApproverController::ApproverController(QObject *parent) : + QObject(parent), + mApproverInterface(APPROVER_SERVICE, APPROVER_OBJECT, APPROVER_INTERFACE) +{ +} + +void ApproverController::acceptCall() +{ + mApproverInterface.call("AcceptCall"); +} + +void ApproverController::hangUpAndAcceptCall() +{ + mApproverInterface.call("HangUpAndAcceptCall"); +} diff -Nru telephony-service-0.1+15.10.20150608.4/tests/approver/approvercontroller.h telephony-service-0.1+15.10.20150709/tests/approver/approvercontroller.h --- telephony-service-0.1+15.10.20150608.4/tests/approver/approvercontroller.h 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/approver/approvercontroller.h 2015-07-09 13:46:02.000000000 +0000 @@ -0,0 +1,41 @@ +/** + * Copyright (C) 2013-2015 Canonical, Ltd. + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License version 3, as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, + * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Authors: + * Gustavo Pichorim Boiko + */ + +#ifndef APPROVERCONTROLLER_H +#define APPROVERCONTROLLER_H + +#include +#include + +class ApproverController : public QObject +{ + Q_OBJECT +public: + static ApproverController *instance(); + +public Q_SLOTS: + void acceptCall(); + void hangUpAndAcceptCall(); + +private: + explicit ApproverController(QObject *parent = 0); + QDBusInterface mApproverInterface; +}; + +#endif // ApproverController_H diff -Nru telephony-service-0.1+15.10.20150608.4/tests/approver/ApproverTest.cpp telephony-service-0.1+15.10.20150709/tests/approver/ApproverTest.cpp --- telephony-service-0.1+15.10.20150608.4/tests/approver/ApproverTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/approver/ApproverTest.cpp 2015-07-09 13:46:02.000000000 +0000 @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2013-2015 Canonical, Ltd. + * + * This file is part of telephony-service. + * + * telephony-service is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 3. + * + * telephony-service is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include "telepathytest.h" +#include "approvercontroller.h" +#include "mockcontroller.h" +#include "accountentry.h" +#include "accountentryfactory.h" +#include "telepathyhelper.h" + +class ApproverTest : public TelepathyTest +{ + Q_OBJECT + +private Q_SLOTS: + void initTestCase(); + void init(); + void cleanup(); + void testSnapDecisionTimeout(); + void testAcceptCall(); + +private: + void waitForCallActive(const QString &callerId); + MockController *mMockController; + Tp::AccountPtr mTpAccount; +}; + +void ApproverTest::initTestCase() +{ + initialize(); + + QSignalSpy setupReadySpy(TelepathyHelper::instance(), SIGNAL(setupReady())); + TRY_COMPARE(setupReadySpy.count(), 1); +} + +void ApproverTest::init() +{ + mTpAccount = addAccount("mock", "mock", "the account"); + + // and create the mock controller + mMockController = new MockController("mock", this); +} + +void ApproverTest::cleanup() +{ + doCleanup(); + mMockController->deleteLater(); +} + +void ApproverTest::testSnapDecisionTimeout() +{ + QString callerId("12345"); + QVariantMap properties; + properties["Caller"] = callerId; + properties["State"] = "incoming"; + + QDBusInterface notificationsMock("org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications"); + QSignalSpy notificationSpy(¬ificationsMock, SIGNAL(MockNotificationReceived(QString, uint, QString, QString, QString, QStringList, QVariantMap, int))); + mMockController->placeCall(properties); + TRY_COMPARE(notificationSpy.count(), 1); + QVariantMap hints = notificationSpy.first()[6].toMap(); + QVERIFY(hints.contains("x-canonical-snap-decisions-timeout")); + QCOMPARE(hints["x-canonical-snap-decisions-timeout"].toInt(), -1); + mMockController->HangupCall(callerId); +} + +void ApproverTest::testAcceptCall() +{ + QString callerId("7654321"); + + QVariantMap properties; + properties["Caller"] = callerId; + properties["State"] = "incoming"; + + QDBusInterface notificationsMock("org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications"); + QSignalSpy notificationSpy(¬ificationsMock, SIGNAL(MockNotificationReceived(QString, uint, QString, QString, QString, QStringList, QVariantMap, int))); + QString objectPath = mMockController->placeCall(properties); + TRY_COMPARE(notificationSpy.count(), 1); + + // at this point we are already sure the approver has the call, as the notification was placed + QSignalSpy callStateSpy(mMockController, SIGNAL(CallStateChanged(QString,QString,QString))); + ApproverController::instance()->acceptCall(); + TRY_COMPARE(callStateSpy.count(), 1); + QCOMPARE(callStateSpy.first()[0].toString(), callerId); + QCOMPARE(callStateSpy.first()[1].toString(), objectPath); + QCOMPARE(callStateSpy.first()[2].toString(), QString("accepted")); + mMockController->HangupCall(callerId); +} + +QTEST_MAIN(ApproverTest) +#include "ApproverTest.moc" diff -Nru telephony-service-0.1+15.10.20150608.4/tests/approver/CMakeLists.txt telephony-service-0.1+15.10.20150709/tests/approver/CMakeLists.txt --- telephony-service-0.1+15.10.20150608.4/tests/approver/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/approver/CMakeLists.txt 2015-07-09 13:46:02.000000000 +0000 @@ -0,0 +1,16 @@ +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/../common + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/libtelephonyservice + ${CMAKE_BINARY_DIR}/tests/common + ${TP_QT5_INCLUDE_DIRS} + ${GSETTINGS_QT_INCLUDE_DIRS} + ) + +if (NOT ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64")) + generate_telepathy_test(ApproverTest + SOURCES ApproverTest.cpp approvercontroller.cpp + TASKS --task ${CMAKE_BINARY_DIR}/approver/telephony-service-approver --task-name telephony-service-approver --wait-for com.canonical.TelephonyServiceHandler --ignore-return + WAIT_FOR org.freedesktop.Telepathy.Client.TelephonyServiceApprover) +endif() diff -Nru telephony-service-0.1+15.10.20150608.4/tests/CMakeLists.txt telephony-service-0.1+15.10.20150709/tests/CMakeLists.txt --- telephony-service-0.1+15.10.20150608.4/tests/CMakeLists.txt 2015-06-08 23:04:06.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/CMakeLists.txt 2015-07-09 13:46:02.000000000 +0000 @@ -1,6 +1,7 @@ include (GenerateTest) add_subdirectory(common) +add_subdirectory(approver) add_subdirectory(handler) add_subdirectory(indicator) add_subdirectory(libtelephonyservice) diff -Nru telephony-service-0.1+15.10.20150608.4/tests/common/CMakeLists.txt telephony-service-0.1+15.10.20150709/tests/common/CMakeLists.txt --- telephony-service-0.1+15.10.20150608.4/tests/common/CMakeLists.txt 2015-06-08 23:04:01.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/common/CMakeLists.txt 2015-07-09 13:46:02.000000000 +0000 @@ -5,6 +5,9 @@ configure_file(dbus-session.conf.in ${CMAKE_CURRENT_BINARY_DIR}/dbus-session.conf) +add_executable(NotificationsMock NotificationsMock.cpp) +qt5_use_modules(NotificationsMock Core DBus) + qt5_add_dbus_interface(mockcontroller_SRCS mock/MockConnection.xml MockConnectionInterface) add_library(mockcontroller STATIC mockcontroller.cpp mockcontroller.h ${mockcontroller_SRCS}) qt5_use_modules(mockcontroller Core DBus) diff -Nru telephony-service-0.1+15.10.20150608.4/tests/common/mock/callchannel.cpp telephony-service-0.1+15.10.20150709/tests/common/mock/callchannel.cpp --- telephony-service-0.1+15.10.20150608.4/tests/common/mock/callchannel.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/common/mock/callchannel.cpp 2015-07-09 13:46:02.000000000 +0000 @@ -28,7 +28,7 @@ mTargetHandle(targetHandle), mState(state) { - Tp::BaseChannelPtr baseChannel = Tp::BaseChannel::create(mConnection, TP_QT_IFACE_CHANNEL_TYPE_CALL, targetHandle, Tp::HandleTypeContact); + 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, Tp::StreamTransportTypeUnknown, @@ -68,7 +68,15 @@ void MockCallChannel::onAccept(Tp::DBusError*) { - setCallState("active"); + setCallState("accepted"); + QTimer *timer = new QTimer(this); + timer->setSingleShot(true); + timer->setInterval(100); + connect(timer, &QTimer::timeout, [this, timer]() { + setCallState("active"); + timer->deleteLater(); + }); + timer->start(); } void MockCallChannel::init() @@ -195,6 +203,8 @@ } mCallChannel->setCallState(Tp::CallStateEnded, 0, reason, stateDetails); mBaseChannel->close(); + } else if (state == "accepted") { + mCallChannel->setCallState(Tp::CallStateAccepted, 0, reason, stateDetails); } else if (state == "active") { qDebug() << "active"; mHoldIface->setHoldState(Tp::LocalHoldStateUnheld, Tp::LocalHoldStateReasonNone); diff -Nru telephony-service-0.1+15.10.20150608.4/tests/common/mock/conferencecallchannel.cpp telephony-service-0.1+15.10.20150709/tests/common/mock/conferencecallchannel.cpp --- telephony-service-0.1+15.10.20150608.4/tests/common/mock/conferencecallchannel.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/common/mock/conferencecallchannel.cpp 2015-07-09 13:45:55.000000000 +0000 @@ -36,7 +36,7 @@ } } - Tp::BaseChannelPtr baseChannel = Tp::BaseChannel::create(mConnection, TP_QT_IFACE_CHANNEL_TYPE_CALL, 0, Tp::HandleTypeNone); + Tp::BaseChannelPtr baseChannel = Tp::BaseChannel::create(mConnection, TP_QT_IFACE_CHANNEL_TYPE_CALL, Tp::HandleTypeNone, 0); Tp::BaseChannelCallTypePtr callType = Tp::BaseChannelCallType::create(baseChannel.data(), true, Tp::StreamTransportTypeUnknown, diff -Nru telephony-service-0.1+15.10.20150608.4/tests/common/mock/connection.cpp telephony-service-0.1+15.10.20150709/tests/common/mock/connection.cpp --- telephony-service-0.1+15.10.20150608.4/tests/common/mock/connection.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/common/mock/connection.cpp 2015-07-09 13:45:55.000000000 +0000 @@ -78,7 +78,7 @@ // init presence interface simplePresenceIface = Tp::BaseConnectionSimplePresenceInterface::create(); simplePresenceIface->setSetPresenceCallback(Tp::memFun(this,&MockConnection::setPresenceFail)); - simplePresenceIface->setMaxmimumStatusMessageLength(255); + simplePresenceIface->setMaximumStatusMessageLength(255); plugInterface(Tp::AbstractConnectionInterfacePtr::dynamicCast(simplePresenceIface)); // Set Presence @@ -445,9 +445,11 @@ return mCallChannels[requestedId]->baseChannel(); } -Tp::BaseChannelPtr MockConnection::createChannel(const QString& channelType, uint targetHandleType, - uint targetHandle, const QVariantMap &hints, Tp::DBusError *error) +Tp::BaseChannelPtr MockConnection::createChannel(const QVariantMap &request, Tp::DBusError *error) { + const QString channelType = request.value(TP_QT_IFACE_CHANNEL + QLatin1String(".ChannelType")).toString(); + uint targetHandleType = request.value(TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandleType")).toUInt(); + uint targetHandle = request.value(TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandle")).toUInt(); qDebug() << "MockConnection::createChannel" << targetHandle; if (mSelfPresence.type != Tp::ConnectionPresenceTypeAvailable) { error->set(TP_QT_ERROR_NETWORK_ERROR, "No network available"); @@ -455,9 +457,9 @@ } if (channelType == TP_QT_IFACE_CHANNEL_TYPE_TEXT) { - return createTextChannel(targetHandleType, targetHandle, hints, error); + return createTextChannel(targetHandleType, targetHandle, request, error); } else if (channelType == TP_QT_IFACE_CHANNEL_TYPE_CALL) { - return createCallChannel(targetHandleType, targetHandle, hints, error); + return createCallChannel(targetHandleType, targetHandle, request, error); } else { error->set(TP_QT_ERROR_NOT_IMPLEMENTED, "Channel type not available"); } @@ -474,9 +476,14 @@ if (!channel) { // request the channel Tp::DBusError error; + QVariantMap request; bool yours; uint handle = newHandle(sender); - ensureChannel(TP_QT_IFACE_CHANNEL_TYPE_TEXT,Tp::HandleTypeContact, handle, yours, handle, false, QVariantMap(), &error); + request[TP_QT_IFACE_CHANNEL + QLatin1String(".ChannelType")] = TP_QT_IFACE_CHANNEL_TYPE_TEXT; + request[TP_QT_IFACE_CHANNEL + QLatin1String(".InitiatorHandle")] = handle; + request[TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandleType")] = Tp::HandleTypeContact; + request[TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandle")] = handle; + ensureChannel(request, yours, false, &error); if(error.isValid()) { qWarning() << "Error creating channel for incoming message" << error.name() << error.message(); return; @@ -562,8 +569,13 @@ mInitialCallStatus[callerId] = state; mIncomingCalls.append(callerId); - - Tp::BaseChannelPtr channel = ensureChannel(TP_QT_IFACE_CHANNEL_TYPE_CALL, Tp::HandleTypeContact, handle, yours, initiatorHandle, false, QVariantMap(), &error); + QVariantMap request; + request[TP_QT_IFACE_CHANNEL + QLatin1String(".ChannelType")] = TP_QT_IFACE_CHANNEL_TYPE_CALL; + request[TP_QT_IFACE_CHANNEL + QLatin1String(".InitiatorHandle")] = initiatorHandle; + request[TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandleType")] = Tp::HandleTypeContact; + request[TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandle")] = handle; + + Tp::BaseChannelPtr channel = ensureChannel(request, yours, false, &error); if (error.isValid() || channel.isNull()) { qWarning() << "error creating the channel " << error.name() << error.message(); return QString(); diff -Nru telephony-service-0.1+15.10.20150608.4/tests/common/mock/connection.h telephony-service-0.1+15.10.20150709/tests/common/mock/connection.h --- telephony-service-0.1+15.10.20150608.4/tests/common/mock/connection.h 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/common/mock/connection.h 2015-07-09 13:45:55.000000000 +0000 @@ -55,8 +55,7 @@ QStringList inspectHandles(uint handleType, const Tp::UIntList& handles, Tp::DBusError *error); Tp::UIntList requestHandles(uint handleType, const QStringList& identifiers, Tp::DBusError* error); - Tp::BaseChannelPtr createChannel(const QString& channelType, uint targetHandleType, - uint targetHandle, const QVariantMap& hints, Tp::DBusError *error); + Tp::BaseChannelPtr createChannel(const QVariantMap& request, Tp::DBusError *error); Tp::ContactAttributesMap getContactAttributes(const Tp::UIntList &handles, const QStringList &ifaces, Tp::DBusError *error); uint setPresence(const QString& status, const QString& statusMessage, Tp::DBusError *error); uint setPresenceFail(const QString& status, const QString& statusMessage, Tp::DBusError *error); diff -Nru telephony-service-0.1+15.10.20150608.4/tests/common/mock/main.cpp telephony-service-0.1+15.10.20150709/tests/common/mock/main.cpp --- telephony-service-0.1+15.10.20150608.4/tests/common/mock/main.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/common/mock/main.cpp 2015-07-09 13:45:55.000000000 +0000 @@ -39,8 +39,13 @@ Tp::BaseProtocolPtr phoneProto = Tp::BaseProtocol::create( QDBusConnection::sessionBus(), QLatin1String("ofono")); + // create a multimedia protocol + Tp::BaseProtocolPtr multimediaProto = Tp::BaseProtocol::create( + QDBusConnection::sessionBus(), QLatin1String("multimedia")); + Tp::BaseConnectionManagerPtr cm = Tp::BaseConnectionManager::create( QDBusConnection::sessionBus(), QLatin1String("mock")); + cm->addProtocol(multimediaProto); cm->addProtocol(phoneProto); cm->addProtocol(proto); cm->registerObject(); diff -Nru telephony-service-0.1+15.10.20150608.4/tests/common/mock/protocol.cpp telephony-service-0.1+15.10.20150709/tests/common/mock/protocol.cpp --- telephony-service-0.1+15.10.20150608.4/tests/common/mock/protocol.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/common/mock/protocol.cpp 2015-07-09 13:45:55.000000000 +0000 @@ -47,5 +47,5 @@ Tp::BaseConnectionPtr Protocol::createConnection(const QVariantMap ¶meters, Tp::DBusError *error) { Q_UNUSED(error); - return Tp::BaseConnection::create(QDBusConnection::sessionBus(), "mock", name().toLatin1(), parameters); + return Tp::BaseConnection::create("mock", name().toLatin1(), parameters); } diff -Nru telephony-service-0.1+15.10.20150608.4/tests/common/mock/textchannel.cpp telephony-service-0.1+15.10.20150709/tests/common/mock/textchannel.cpp --- telephony-service-0.1+15.10.20150608.4/tests/common/mock/textchannel.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/common/mock/textchannel.cpp 2015-07-09 13:45:55.000000000 +0000 @@ -51,8 +51,8 @@ Tp::BaseChannelPtr baseChannel = Tp::BaseChannel::create(mConnection, TP_QT_IFACE_CHANNEL_TYPE_TEXT, - targetHandle, - type); + type, + targetHandle); mBaseChannel = baseChannel; Tp::BaseChannelTextTypePtr textType = Tp::BaseChannelTextType::create(baseChannel.data()); baseChannel->plugInterface(Tp::AbstractChannelInterfacePtr::dynamicCast(textType)); diff -Nru telephony-service-0.1+15.10.20150608.4/tests/common/NotificationsMock.cpp telephony-service-0.1+15.10.20150709/tests/common/NotificationsMock.cpp --- telephony-service-0.1+15.10.20150608.4/tests/common/NotificationsMock.cpp 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/common/NotificationsMock.cpp 2015-07-09 13:46:02.000000000 +0000 @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2015 Canonical, Ltd. + * + * This file is part of telephony-service. + * + * telephony-service is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 3. + * + * telephony-service is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +#define NOTIFICATIONS_DBUS_SERVICE_NAME "org.freedesktop.Notifications" +#define NOTIFICATIONS_DBUS_OBJ_PATH "/org/freedesktop/Notifications" + +class NotificationsMock : public QObject +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", NOTIFICATIONS_DBUS_SERVICE_NAME) + +public: + Q_SCRIPTABLE uint Notify(QString app_name, uint replaces_id, QString app_icon, QString summary, QString body, QStringList actions, QVariantMap hints, int expire_timeout); + Q_SCRIPTABLE void CloseNotification(uint id); + Q_SCRIPTABLE QString GetServerInformation(QString& vendor, QString& version, QString& spec_version); + + // Mock specific method + Q_SCRIPTABLE void MockInvokeAction(uint id, QString action_key); + +Q_SIGNALS: + Q_SCRIPTABLE void NotificationClosed(uint id, uint reason); + Q_SCRIPTABLE void ActionInvoked(uint id, QString action_key); + + // Mock specific signal + Q_SCRIPTABLE void MockNotificationReceived(QString app_name, uint replaces_id, QString app_icon, QString summary, QString body, QStringList actions, QVariantMap hints, int expire_timeout); +}; + +uint NotificationsMock::Notify(QString app_name, uint replaces_id, QString app_icon, QString summary, QString body, QStringList actions, QVariantMap hints, int expire_timeout) +{ + Q_EMIT MockNotificationReceived(app_name, replaces_id, app_icon, summary, body, actions, hints, expire_timeout); + static uint id = 1; + return (replaces_id != 0 ? replaces_id : id++); +} + +void NotificationsMock::MockInvokeAction(uint id, QString action_key) +{ + Q_EMIT ActionInvoked(id, action_key); + Q_EMIT NotificationClosed(id, 2); // 2 is dismissed by user +} + +void NotificationsMock::CloseNotification(uint id) +{ + Q_EMIT NotificationClosed(id, 3); // 3 is closed by a CloseNotification() call +} + +QString NotificationsMock::GetServerInformation(QString &vendor, QString &version, QString &spec_version) +{ + return QString(); +} + +int main(int argc, char **argv) +{ + QCoreApplication a(argc, argv); + + QDBusConnection connection = QDBusConnection::sessionBus(); + + NotificationsMock notifications; + connection.registerObject(NOTIFICATIONS_DBUS_OBJ_PATH, ¬ifications, QDBusConnection::ExportScriptableContents); + connection.registerService(NOTIFICATIONS_DBUS_SERVICE_NAME); + + return a.exec(); +} + +#include "NotificationsMock.moc" diff -Nru telephony-service-0.1+15.10.20150608.4/tests/handler/approver.cpp telephony-service-0.1+15.10.20150709/tests/handler/approver.cpp --- telephony-service-0.1+15.10.20150608.4/tests/handler/approver.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/handler/approver.cpp 2015-07-09 13:46:02.000000000 +0000 @@ -107,11 +107,17 @@ } } -void Approver::acceptCall() +void Approver::acceptCall(bool callAcceptOnChannel) { Q_FOREACH (Tp::ChannelDispatchOperationPtr dispatchOperation, mDispatchOps) { QList channels = dispatchOperation->channels(); Q_FOREACH (Tp::ChannelPtr channel, channels) { + if (callAcceptOnChannel) { + Tp::CallChannelPtr callChannel = Tp::CallChannelPtr::dynamicCast(channel); + if (callChannel) { + callChannel->accept(); + } + } if (dispatchOperation->possibleHandlers().contains(TELEPHONY_SERVICE_HANDLER)) { dispatchOperation->handleWith(TELEPHONY_SERVICE_HANDLER); mDispatchOps.removeAll(dispatchOperation); diff -Nru telephony-service-0.1+15.10.20150608.4/tests/handler/approver.h telephony-service-0.1+15.10.20150709/tests/handler/approver.h --- telephony-service-0.1+15.10.20150608.4/tests/handler/approver.h 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/handler/approver.h 2015-07-09 13:46:02.000000000 +0000 @@ -44,7 +44,7 @@ void newCall(); public Q_SLOTS: - void acceptCall(); + void acceptCall(bool callAcceptOnChannel = true); void rejectCall(); private Q_SLOTS: diff -Nru telephony-service-0.1+15.10.20150608.4/tests/handler/handlercontroller.cpp telephony-service-0.1+15.10.20150709/tests/handler/handlercontroller.cpp --- telephony-service-0.1+15.10.20150608.4/tests/handler/handlercontroller.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/handler/handlercontroller.cpp 2015-07-09 13:46:02.000000000 +0000 @@ -99,6 +99,12 @@ mHandlerInterface.call("SendDTMF", objectPath, key); } +bool HandlerController::hasCalls() +{ + QDBusReply reply = mHandlerInterface.call("HasCalls"); + return reply.isValid() && reply.value(); +} + void HandlerController::createConferenceCall(const QStringList &objectPaths) { mHandlerInterface.call("CreateConferenceCall", objectPaths); diff -Nru telephony-service-0.1+15.10.20150608.4/tests/handler/handlercontroller.h telephony-service-0.1+15.10.20150709/tests/handler/handlercontroller.h --- telephony-service-0.1+15.10.20150608.4/tests/handler/handlercontroller.h 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/handler/handlercontroller.h 2015-07-09 13:46:02.000000000 +0000 @@ -40,6 +40,7 @@ void setMuted(const QString &objectPath, bool muted); void setSpeakerMode(const QString &objectPath, bool enabled); void sendDTMF(const QString &objectPath, const QString &key); + bool hasCalls(); // conference call methods void createConferenceCall(const QStringList &objectPaths); diff -Nru telephony-service-0.1+15.10.20150608.4/tests/handler/HandlerTest.cpp telephony-service-0.1+15.10.20150709/tests/handler/HandlerTest.cpp --- telephony-service-0.1+15.10.20150608.4/tests/handler/HandlerTest.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/handler/HandlerTest.cpp 2015-07-09 13:46:02.000000000 +0000 @@ -41,8 +41,11 @@ void testConferenceCall(); void testSendMessage(); void testActiveCallIndicator(); + void testNotApprovedChannels(); private: + void registerApprover(); + void unregisterApprover(); void waitForCallActive(const QString &callerId); Approver *mApprover; MockController *mMockController; @@ -56,11 +59,7 @@ QSignalSpy setupReadySpy(TelepathyHelper::instance(), SIGNAL(setupReady())); TRY_COMPARE(setupReadySpy.count(), 1); - // register the approver - mApprover = new Approver(this); - TelepathyHelper::instance()->registerClient(mApprover, "TelephonyTestApprover"); - // Tp-qt does not set registered status to approvers - TRY_VERIFY(QDBusConnection::sessionBus().interface()->isServiceRegistered(TELEPHONY_SERVICE_APPROVER)); + registerApprover(); } void HandlerTest::init() @@ -163,6 +162,8 @@ TRY_COMPARE(approverCallSpy.count(), 1); mApprover->acceptCall(); + waitForCallActive(callerId); + // wait until the call properties are changed TRY_VERIFY(handlerCallPropertiesSpy.count() > 0); QString objectPath = handlerCallPropertiesSpy.last()[0].toString(); @@ -302,21 +303,63 @@ QVERIFY(!HandlerController::instance()->callIndicatorVisible()); } +void HandlerTest::testNotApprovedChannels() +{ + QVariantMap properties; + properties["Caller"] = "123456"; + properties["State"] = "incoming"; + + QSignalSpy approverCallSpy(mApprover, SIGNAL(newCall())); + + QSignalSpy callStateSpy(mMockController, SIGNAL(CallStateChanged(QString,QString,QString))); + QString objectPath = mMockController->placeCall(properties); + QVERIFY(!objectPath.isEmpty()); + + // wait for the channel to hit the approver + TRY_COMPARE(approverCallSpy.count(), 1); + + // accept the call but do not call callChannel->accept() on the channel + mApprover->acceptCall(false); + + // wait for a few seconds + QTest::qWait(3000); + + // no state changes should happen, as the channel was not accepted + QVERIFY(callStateSpy.isEmpty()); +} + +void HandlerTest::registerApprover() +{ + // register the approver + mApprover = new Approver(); + QVERIFY(TelepathyHelper::instance()->registerClient(mApprover, "TelephonyTestApprover")); + // Tp-qt does not set registered status to approvers + TRY_VERIFY(QDBusConnection::sessionBus().interface()->isServiceRegistered(TELEPHONY_SERVICE_APPROVER)); +} + +void HandlerTest::unregisterApprover() +{ + QVERIFY(TelepathyHelper::instance()->unregisterClient(mApprover)); + mApprover->deleteLater(); + mApprover = NULL; + TRY_VERIFY(!QDBusConnection::sessionBus().interface()->isServiceRegistered(TELEPHONY_SERVICE_APPROVER)); +} + void HandlerTest::waitForCallActive(const QString &callerId) { - // wait until the call state is "accepted" QSignalSpy callStateSpy(mMockController, SIGNAL(CallStateChanged(QString,QString,QString))); QString state; QString objectPath; QString caller; int tries = 0; - while (state != "active" && caller != callerId && tries < 5) { + while ((state != "active" || caller != callerId) && tries < 5) { TRY_COMPARE(callStateSpy.count(), 1); caller = callStateSpy.first()[0].toString(); objectPath = callStateSpy.first()[1].toString(); state = callStateSpy.first()[2].toString(); callStateSpy.clear(); tries++; + qDebug() << "Waiting for call active, try " << tries << " failed."; } QCOMPARE(caller, callerId); diff -Nru telephony-service-0.1+15.10.20150608.4/tests/libtelephonyservice/CallEntryTest.cpp telephony-service-0.1+15.10.20150709/tests/libtelephonyservice/CallEntryTest.cpp --- telephony-service-0.1+15.10.20150608.4/tests/libtelephonyservice/CallEntryTest.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/libtelephonyservice/CallEntryTest.cpp 2015-07-09 13:46:02.000000000 +0000 @@ -122,7 +122,12 @@ void CallEntryTest::onCallChannelAvailable(const Tp::CallChannelPtr &channel) { - mCallChannel = channel; + channel->accept(); + connect(channel->becomeReady(Tp::Features() << Tp::CallChannel::FeatureCore + << Tp::CallChannel::FeatureCallState), + &Tp::PendingOperation::finished, [this, channel] { + mCallChannel = channel; + }); } QTEST_MAIN(CallEntryTest) diff -Nru telephony-service-0.1+15.10.20150608.4/tests/libtelephonyservice/CMakeLists.txt telephony-service-0.1+15.10.20150709/tests/libtelephonyservice/CMakeLists.txt --- telephony-service-0.1+15.10.20150608.4/tests/libtelephonyservice/CMakeLists.txt 2015-06-08 23:04:06.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/libtelephonyservice/CMakeLists.txt 2015-07-09 13:45:55.000000000 +0000 @@ -41,11 +41,19 @@ generate_test(ContactUtilsTest SOURCES ContactUtilsTest.cpp QT5_MODULES Contacts Core Test LIBRARIES telephonyservice USE_UI) generate_test(PhoneUtilsTest SOURCES PhoneUtilsTest.cpp LIBRARIES telephonyservice USE_UI) +generate_test(ProtocolTest + SOURCES ProtocolTest.cpp ${LIBTELEPHONYSERVICE_DIR}/protocol.cpp + ENVIRONMENT TELEPHONY_SERVICE_PROTOCOLS_DIR=${CMAKE_CURRENT_SOURCE_DIR}/testProtocols) +generate_test(ProtocolManagerTest + SOURCES ProtocolManagerTest.cpp ${LIBTELEPHONYSERVICE_DIR}/protocol.cpp ${LIBTELEPHONYSERVICE_DIR}/protocolmanager.cpp + QT5_MODULES Core Qml Test + ENVIRONMENT TELEPHONY_SERVICE_PROTOCOLS_DIR=${CMAKE_CURRENT_SOURCE_DIR}/testProtocols) generate_telepathy_test(AccountEntryFactoryTest SOURCES AccountEntryFactoryTest.cpp) generate_telepathy_test(AccountEntryTest SOURCES AccountEntryTest.cpp) generate_telepathy_test(CallEntryTest SOURCES CallEntryTest.cpp) generate_telepathy_test(ChatManagerTest SOURCES ChatManagerTest.cpp) +generate_telepathy_test(MultimediaAccountEntryTest SOURCES MultimediaAccountEntryTest.cpp) generate_telepathy_test(OfonoAccountEntryTest SOURCES OfonoAccountEntryTest.cpp) generate_telepathy_test(TelepathyHelperTest SOURCES TelepathyHelperTest.cpp) generate_telepathy_test(USSDManagerTest SOURCES USSDManagerTest.cpp) diff -Nru telephony-service-0.1+15.10.20150608.4/tests/libtelephonyservice/MultimediaAccountEntryTest.cpp telephony-service-0.1+15.10.20150709/tests/libtelephonyservice/MultimediaAccountEntryTest.cpp --- telephony-service-0.1+15.10.20150608.4/tests/libtelephonyservice/MultimediaAccountEntryTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/libtelephonyservice/MultimediaAccountEntryTest.cpp 2015-07-09 13:45:55.000000000 +0000 @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2015 Canonical, Ltd. + * + * This file is part of telephony-service. + * + * telephony-service is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 3. + * + * telephony-service is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include "telepathytest.h" +#include "multimediaaccountentry.h" +#include "accountentryfactory.h" +#include "mockcontroller.h" + +class MultimediaAccountEntryTest : public TelepathyTest +{ + Q_OBJECT + +private Q_SLOTS: + void initTestCase(); + void init(); + void cleanup(); + void testAccountType(); + +private: + MultimediaAccountEntry *mAccount; + Tp::AccountPtr mMultimediaAccount; + MockController *mMockController; +}; + +void MultimediaAccountEntryTest::initTestCase() +{ + initialize(); +} + +void MultimediaAccountEntryTest::init() +{ + mMultimediaAccount = addAccount("mock", "multimedia", "multimedia account"); + QVERIFY(!mMultimediaAccount.isNull()); + mAccount = qobject_cast(AccountEntryFactory::createEntry(mMultimediaAccount, this)); + QVERIFY(mAccount); + TRY_VERIFY(mAccount->ready()); + + // make sure the connection is available + TRY_VERIFY(mAccount->connected()); + + // and make sure the status and status message are the ones we expect + TRY_COMPARE(mAccount->status(), QString("available")); + + // create the mock controller + mMockController = new MockController("multimedia", this); +} + +void MultimediaAccountEntryTest::cleanup() +{ + doCleanup(); + mAccount->deleteLater(); + mMockController->deleteLater(); +} + +void MultimediaAccountEntryTest::testAccountType() +{ + QCOMPARE(mAccount->type(), AccountEntry::MultimediaAccount); +} + +QTEST_MAIN(MultimediaAccountEntryTest) +#include "MultimediaAccountEntryTest.moc" diff -Nru telephony-service-0.1+15.10.20150608.4/tests/libtelephonyservice/PhoneUtilsTest.cpp telephony-service-0.1+15.10.20150709/tests/libtelephonyservice/PhoneUtilsTest.cpp --- telephony-service-0.1+15.10.20150608.4/tests/libtelephonyservice/PhoneUtilsTest.cpp 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/libtelephonyservice/PhoneUtilsTest.cpp 2015-07-09 13:45:55.000000000 +0000 @@ -44,6 +44,7 @@ QTest::newRow("number with extension") << "12345678#123" << true; QTest::newRow("number with comma") << "33333333,1,1" << true; QTest::newRow("number with semicolon") << "33333333;1" << true; + QTest::newRow("number with slash") << "+421 2/123 456 78" << true; QTest::newRow("short/emergency number") << "190" << true; QTest::newRow("non phone numbers") << "abcdefg" << false; } diff -Nru telephony-service-0.1+15.10.20150608.4/tests/libtelephonyservice/ProtocolManagerTest.cpp telephony-service-0.1+15.10.20150709/tests/libtelephonyservice/ProtocolManagerTest.cpp --- telephony-service-0.1+15.10.20150608.4/tests/libtelephonyservice/ProtocolManagerTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/libtelephonyservice/ProtocolManagerTest.cpp 2015-07-09 13:45:55.000000000 +0000 @@ -0,0 +1,193 @@ +/* + * Copyright (C) 2015 Canonical, Ltd. + * + * This file is part of telephony-service. + * + * telephony-service is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 3. + * + * telephony-service is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include +#include + +#include "config.h" +#include "protocolmanager.h" + +Q_DECLARE_METATYPE(Protocols) +Q_DECLARE_METATYPE(Protocol::Features) + +// inheriting just to make the constructor public for testing +class ProtocolManagerWrapper : public ProtocolManager +{ + Q_OBJECT +public: + ProtocolManagerWrapper(const QString &dir, QObject *parent = 0) + : ProtocolManager(dir, parent) { } +}; + +class ProtocolManagerTest : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void initTestCase(); + void testNumberOfProtocols(); + void testFooProtocolLoaded(); + void testProtocolNames(); + void testProtocolByName(); + void testProtocolsForFeatures_data(); + void testProtocolsForFeatures(); + void testTextProtocols(); + void testVoiceProtocols(); + void testIsProtocolSupported_data(); + void testIsProtocolSupported(); + void testFileSystemWatch(); +}; + +void ProtocolManagerTest::initTestCase() +{ + qRegisterMetaType(); + qRegisterMetaType(); +} + +void ProtocolManagerTest::testNumberOfProtocols() +{ + QDir dir(protocolsDir()); + int count = dir.entryList(QDir::Files).count(); + QCOMPARE(ProtocolManager::instance()->protocols().count(), count); +} + +void ProtocolManagerTest::testFooProtocolLoaded() +{ + Protocol *fooProtocol = 0; + Q_FOREACH(Protocol *proto, ProtocolManager::instance()->protocols()) { + QVERIFY(proto); + if (proto->name() == "foo") { + fooProtocol = proto; + break; + } + } + QVERIFY(fooProtocol); +} + +void ProtocolManagerTest::testProtocolNames() +{ + Protocols protocols = ProtocolManager::instance()->protocols(); + QStringList protocolNames = ProtocolManager::instance()->protocolNames(); + for (int i = 0; i < protocols.count(); ++i) { + QCOMPARE(protocols[i]->name(), protocolNames[i]); + } +} + +void ProtocolManagerTest::testProtocolByName() +{ + Protocol *invalid = ProtocolManager::instance()->protocolByName("invalid"); + QVERIFY(!invalid); + + Protocol *bar = ProtocolManager::instance()->protocolByName("bar"); + QVERIFY(bar); + QCOMPARE(bar->name(), QString("bar")); +} + +void ProtocolManagerTest::testProtocolsForFeatures_data() +{ + QTest::addColumn("features"); + QTest::addColumn("protocols"); + + Protocols protocols; + protocols = ProtocolManager::instance()->protocols(); + QTest::newRow("both text and voice") << Protocol::Features(Protocol::TextChats | Protocol::VoiceCalls) << protocols; + + protocols.clear(); + protocols << ProtocolManager::instance()->protocolByName("foo") + << ProtocolManager::instance()->protocolByName("bar") + << ProtocolManager::instance()->protocolByName("text"); + QTest::newRow("only text") << Protocol::Features(Protocol::TextChats) << protocols; + + protocols.clear(); + protocols << ProtocolManager::instance()->protocolByName("foo") + << ProtocolManager::instance()->protocolByName("bar") + << ProtocolManager::instance()->protocolByName("voice"); + QTest::newRow("only voice") << Protocol::Features(Protocol::VoiceCalls) << protocols; + + QTest::newRow("no features") << Protocol::Features() << Protocols(); +} + +void ProtocolManagerTest::testProtocolsForFeatures() +{ + QFETCH(Protocol::Features, features); + QFETCH(Protocols, protocols); + + Protocols filtered = ProtocolManager::instance()->protocolsForFeatures(features); + QCOMPARE(filtered.count(), protocols.count()); + Q_FOREACH(Protocol *protocol, protocols) { + QVERIFY(filtered.contains(protocol)); + } +} + +void ProtocolManagerTest::testTextProtocols() +{ + QCOMPARE(ProtocolManager::instance()->textProtocols(), ProtocolManager::instance()->protocolsForFeatures(Protocol::TextChats)); +} + +void ProtocolManagerTest::testVoiceProtocols() +{ + QCOMPARE(ProtocolManager::instance()->voiceProtocols(), ProtocolManager::instance()->protocolsForFeatures(Protocol::VoiceCalls)); +} + +void ProtocolManagerTest::testIsProtocolSupported_data() +{ + QTest::addColumn("protocolName"); + QTest::addColumn("supported"); + + QTest::newRow("foo") << QString("foo") << true; + QTest::newRow("bar") << QString("bar") << true; + QTest::newRow("text") << QString("text") << true; + QTest::newRow("voice") << QString("voice") << true; + QTest::newRow("invalid") << QString("invalid") << false; +} + +void ProtocolManagerTest::testIsProtocolSupported() +{ + QFETCH(QString, protocolName); + QFETCH(bool, supported); + QCOMPARE(ProtocolManager::instance()->isProtocolSupported(protocolName), supported); +} + +void ProtocolManagerTest::testFileSystemWatch() +{ + QTemporaryDir tempDir; + tempDir.setAutoRemove(true); + QVERIFY(tempDir.isValid()); + + QDir dir(tempDir.path()); + + ProtocolManagerWrapper manager(tempDir.path()); + QSignalSpy protocolsChangedSpy(&manager, SIGNAL(protocolsChanged())); + + QFile foobar(dir.absoluteFilePath("foobar.protocol")); + QVERIFY(foobar.open(QFile::WriteOnly)); + + foobar.write("[Protocol]\nName=foobar\nFeatures=read,write\n"); + QVERIFY(foobar.flush()); + foobar.close(); + + QTRY_COMPARE(protocolsChangedSpy.count(), 1); + QCOMPARE(manager.protocols().count(), 1); + QCOMPARE(manager.protocols()[0]->name(), QString("foobar")); +} + +QTEST_MAIN(ProtocolManagerTest) +#include "ProtocolManagerTest.moc" diff -Nru telephony-service-0.1+15.10.20150608.4/tests/libtelephonyservice/ProtocolTest.cpp telephony-service-0.1+15.10.20150709/tests/libtelephonyservice/ProtocolTest.cpp --- telephony-service-0.1+15.10.20150608.4/tests/libtelephonyservice/ProtocolTest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/libtelephonyservice/ProtocolTest.cpp 2015-07-09 13:45:55.000000000 +0000 @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2015 Canonical, Ltd. + * + * This file is part of telephony-service. + * + * telephony-service is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 3. + * + * telephony-service is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include "config.h" +#include "protocol.h" + +// just to make the constructor public +class TestProtocol : public Protocol +{ + Q_OBJECT +public: + TestProtocol(const QString &name, Protocol::Features features, const QString &fallbackProtocol, QObject *parent = 0) + : Protocol(name, features, fallbackProtocol, parent) { } +}; + +class ProtocolTest : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void testBasicInfo(); + void testFromFile(); +}; + +void ProtocolTest::testBasicInfo() +{ + QString name("foobar"); + Protocol::Features features(Protocol::TextChats); + QString fallbackProtocol("theFallback"); + + TestProtocol protocol(name, features, fallbackProtocol, this); + QCOMPARE(protocol.name(), name); + QCOMPARE(protocol.features(), features); + QCOMPARE(protocol.fallbackProtocol(), fallbackProtocol); + QCOMPARE(protocol.parent(), this); +} + +void ProtocolTest::testFromFile() +{ + // check that calling fromFile() on an invalid path returns 0 + Protocol *nullProtocol = Protocol::fromFile("/non/existent/path/to/a/dummy.protocol"); + QVERIFY(!nullProtocol); + + // and now check a valid protocol + Protocol *protocol = Protocol::fromFile(protocolsDir() + "/foo.protocol"); + QVERIFY(protocol); + QCOMPARE(protocol->name(), QString("foo")); + QCOMPARE(protocol->features(), Protocol::Features(Protocol::TextChats | Protocol::VoiceCalls)); + QCOMPARE(protocol->fallbackProtocol(), QString("bar")); +} + +QTEST_MAIN(ProtocolTest) +#include "ProtocolTest.moc" diff -Nru telephony-service-0.1+15.10.20150608.4/tests/libtelephonyservice/testProtocols/bar.protocol telephony-service-0.1+15.10.20150709/tests/libtelephonyservice/testProtocols/bar.protocol --- telephony-service-0.1+15.10.20150608.4/tests/libtelephonyservice/testProtocols/bar.protocol 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/libtelephonyservice/testProtocols/bar.protocol 2015-07-09 13:45:55.000000000 +0000 @@ -0,0 +1,3 @@ +[Protocol] +Name=bar +Features=text,voice diff -Nru telephony-service-0.1+15.10.20150608.4/tests/libtelephonyservice/testProtocols/foo.protocol telephony-service-0.1+15.10.20150709/tests/libtelephonyservice/testProtocols/foo.protocol --- telephony-service-0.1+15.10.20150608.4/tests/libtelephonyservice/testProtocols/foo.protocol 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/libtelephonyservice/testProtocols/foo.protocol 2015-07-09 13:45:55.000000000 +0000 @@ -0,0 +1,4 @@ +[Protocol] +Name=foo +Features=text,voice +FallbackProtocol=bar diff -Nru telephony-service-0.1+15.10.20150608.4/tests/libtelephonyservice/testProtocols/text.protocol telephony-service-0.1+15.10.20150709/tests/libtelephonyservice/testProtocols/text.protocol --- telephony-service-0.1+15.10.20150608.4/tests/libtelephonyservice/testProtocols/text.protocol 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/libtelephonyservice/testProtocols/text.protocol 2015-07-09 13:45:55.000000000 +0000 @@ -0,0 +1,3 @@ +[Protocol] +Name=text +Features=text diff -Nru telephony-service-0.1+15.10.20150608.4/tests/libtelephonyservice/testProtocols/voice.protocol telephony-service-0.1+15.10.20150709/tests/libtelephonyservice/testProtocols/voice.protocol --- telephony-service-0.1+15.10.20150608.4/tests/libtelephonyservice/testProtocols/voice.protocol 1970-01-01 00:00:00.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tests/libtelephonyservice/testProtocols/voice.protocol 2015-07-09 13:45:55.000000000 +0000 @@ -0,0 +1,3 @@ +[Protocol] +Name=voice +Features=voice diff -Nru telephony-service-0.1+15.10.20150608.4/tools/ofono-setup telephony-service-0.1+15.10.20150709/tools/ofono-setup --- telephony-service-0.1+15.10.20150608.4/tools/ofono-setup 2015-06-08 23:03:53.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/tools/ofono-setup 2015-07-09 13:45:55.000000000 +0000 @@ -24,9 +24,6 @@ done } -# do not wait for a network connection to launch the connection managers -dconf write /org/gnome/empathy/use-conn false 2>&1 > /dev/null - retries=0 # make sure telepathy is correctly running before we setup the accounts while ! check_mission_control_running; do @@ -39,6 +36,12 @@ sleep 1 done +# FIXME mission control for some reason does not start tp-ofono if there is no connection +# even if always-dispatch is true on the account, this workaround fixes the problem +dconf write /org/gnome/empathy/use-conn false 2>&1 > /dev/null +# do not wait for a network connection to launch the connection managers +dconf write /org/gnome/empathy/use-conn true 2>&1 > /dev/null + EXISTING_OFONO_ACCOUNTS=$(get_telepathy_ofono_accounts) # iterate over all accounts to find duplicates diff -Nru telephony-service-0.1+15.10.20150608.4/Ubuntu/Telephony/components.cpp telephony-service-0.1+15.10.20150709/Ubuntu/Telephony/components.cpp --- telephony-service-0.1+15.10.20150608.4/Ubuntu/Telephony/components.cpp 2015-06-08 23:04:06.000000000 +0000 +++ telephony-service-0.1+15.10.20150709/Ubuntu/Telephony/components.cpp 2015-07-09 13:45:55.000000000 +0000 @@ -31,6 +31,7 @@ #include "contactwatcher.h" #include "greetercontacts.h" #include "phoneutils.h" +#include "protocolmanager.h" #include "accountentry.h" #include "audiooutput.h" @@ -57,6 +58,7 @@ mRootContext->setContextProperty("callManager", CallManager::instance()); mRootContext->setContextProperty("greeter", GreeterContacts::instance()); mRootContext->setContextProperty("callNotification", CallNotification::instance()); + mRootContext->setContextProperty("protocolManager", ProtocolManager::instance()); } @@ -68,6 +70,7 @@ qmlRegisterUncreatableType(uri, 0, 1, "AudioOutput", "Objects of this type are created in CallEntry and made available to QML for usage"); qmlRegisterUncreatableType(uri, 0, 1, "AccountEntry", "Objects of this type are created in TelepathyHelper and made available to QML"); qmlRegisterUncreatableType(uri, 0, 1, "USSDManager", "Objects of this type are created in AccountEntry and made available to QML"); + qmlRegisterUncreatableType(uri, 0, 1, "ProtocolManager", "Objects of this type are created in ProtocolManager and made available to QML"); qmlRegisterType(uri, 0, 1, "ContactWatcher"); qmlRegisterType(uri, 0, 1, "PhoneUtils"); }