Use the new QDBusConnectionPrivate::shouldWatchService function

That function was added in the previous commit, so deduplicate the code
from QDBusAbstractInterfacePrivate::initOwnerTracking().

Change-Id: Iee8cbc07c4434ce9b560ffff13d06f1d9fb0cde5
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
bb10
Thiago Macieira 2015-03-30 17:54:14 -07:00
parent f744aece9d
commit d8148edb23
1 changed files with 1 additions and 3 deletions

View File

@ -101,9 +101,7 @@ QDBusAbstractInterfacePrivate::QDBusAbstractInterfacePrivate(const QString &serv
void QDBusAbstractInterfacePrivate::initOwnerTracking()
{
if (!isValid || !connection.isConnected() || connectionPrivate()->mode == QDBusConnectionPrivate::PeerMode)
return;
if (service.isEmpty() || service.startsWith(QLatin1Char(':')))
if (!isValid || !connection.isConnected() || !connectionPrivate()->shouldWatchService(service))
return;
QObject::connect(new QDBusServiceWatcher(service, connection, QDBusServiceWatcher::WatchForOwnerChange, q_func()),
SIGNAL(serviceOwnerChanged(QString,QString,QString)),