[Merge] lp:~phablet-team/telephony-service/connect-disconnect-accounts into lp:telephony-service/staging

Gustavo Pichorim Boiko gustavo.boiko at canonical.com
Wed Mar 22 13:46:03 UTC 2017


Review: Needs Fixing

Just one request, looks good otherwise.

Diff comments:

> 
> === modified file 'handler/texthandler.cpp'
> --- handler/texthandler.cpp	2017-03-07 18:46:14 +0000
> +++ handler/texthandler.cpp	2017-03-07 18:46:16 +0000
> @@ -35,10 +35,32 @@
>  
>  TextHandler::TextHandler(QObject *parent)
>  : QObject(parent)
> +  , mMessagingAppMonitor("com.canonical.MessagingApp", QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForRegistration|QDBusServiceWatcher::WatchForUnregistration)
>  {
>      qDBusRegisterMetaType<AttachmentStruct>();
>      qDBusRegisterMetaType<AttachmentList>();
>      qRegisterMetaType<PendingMessage>();
> +    connect(&mMessagingAppMonitor, SIGNAL(serviceRegistered(const QString&)), SLOT(onMessagingAppOpen()));
> +    connect(&mMessagingAppMonitor, SIGNAL(serviceUnregistered(const QString&)), SLOT(onMessagingAppClosed()));

I think this code would be more suited to be in libtelephonyservice/applicationutils.{h,cpp}. Maybe having a monitorApplication(serviceName) and the opened and closed signals?

> +}
> +
> +void TextHandler::onMessagingAppOpen()
> +{
> +    Q_FOREACH(AccountEntry *account, TelepathyHelper::instance()->accounts()) {
> +        if (!account->active() && account->protocolInfo()->leaveRoomsOnClose()) {
> +            account->reconnect();
> +        }
> +    }
> +}
> +
> +void TextHandler::onMessagingAppClosed()
> +{
> +    Q_FOREACH(AccountEntry *account, TelepathyHelper::instance()->accounts()) {
> +        if (account->protocolInfo()->leaveRoomsOnClose()) {
> +            account->requestDisconnect();
> +        }
> +    }
> +
>  }
>  
>  TextHandler *TextHandler::instance()


-- 
https://code.launchpad.net/~phablet-team/telephony-service/connect-disconnect-accounts/+merge/318944
Your team Ubuntu Phablet Team is subscribed to branch lp:~phablet-team/telephony-service/online-account-match.



More information about the Ubuntu-reviews mailing list