D10712: balooctl monitor: Resume to wait for service

Milian Wolff noreply at phabricator.kde.org
Wed Mar 7 09:45:05 UTC 2018


mwolff requested changes to this revision.
mwolff added a comment.
This revision now requires changes to proceed.


  some minor comments, otherwise lgtm

INLINE COMMENTS

> monitorcommand.cpp:45
> +    connect(m_dbusServiceWatcher, &QDBusServiceWatcher::serviceUnregistered, [this]() {
> +        m_err << i18nc("Application", "%1 died", "Baloo") << endl;
> +    });

just make it i18n("Baloo died"), though I personally think that message should be improved - maybe "Baloo became unavailable" ?

also, call `balooIsNotAvailable()` from the slot here, that way you safe one connection. Or just move the m_err output to the `balooIsNotAvailable` slot.

> monitorcommand.cpp:61
> +    if (m_dbusInterface->isValid()) {
> +        m_err << i18n("Press ctrl+c to exit monitor") << endl;
> +        balooIsAvailable();

`Press Ctrl + C to stop monitoring`

> monitorcommand.cpp:65
> +        balooIsNotAvailable();
> +    }
> +}

add a

  m_dbusServiceWatcher->setWatchMode(QDBusServiceWatcher::WatchForOwnerChange);

> monitorcommand.cpp:71
> +    m_dbusInterface->unregisterMonitor();
> +    m_err << i18nc("Application", "Waiting for %1 to start", "Baloo") << endl;
> +    m_err << i18n("Press ctrl+c to exit monitor") << endl;

see above: `i18n("Waiting for Baloo to start")`

> monitorcommand.cpp:72
> +    m_err << i18nc("Application", "Waiting for %1 to start", "Baloo") << endl;
> +    m_err << i18n("Press ctrl+c to exit monitor") << endl;
> +

see above

> monitorcommand.cpp:74
> +
> +    m_dbusServiceWatcher->setWatchMode(QDBusServiceWatcher::WatchForRegistration);
> +}

remove this

> monitorcommand.cpp:80
> +    m_dbusInterface->registerMonitor();
> +    m_err << i18nc("Application", "%1 is running", "Baloo") << endl;
> +

see above: i18n("Baloo is running")

> monitorcommand.cpp:82
> +
> +    m_dbusServiceWatcher->setWatchMode(QDBusServiceWatcher::WatchForUnregistration);
> + 

remove this

REPOSITORY
  R293 Baloo

REVISION DETAIL
  https://phabricator.kde.org/D10712

To: michaelh, #baloo, #frameworks, dfaure, alexeymin, mwolff
Cc: mwolff, ashaposhnikov, michaelh, spoorun, nicolasfella, alexeymin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180307/275cb429/attachment.html>


More information about the Kde-frameworks-devel mailing list