From kde-devel Fri Mar 15 07:16:28 2013 From: Thiago Macieira Date: Fri, 15 Mar 2013 07:16:28 +0000 To: kde-devel Subject: Re: How to gracefully kill a KUniqueApplication and wait for its termination? Message-Id: <1774858.ScNBijb1Lf () tjmaciei-mobl2> X-MARC-Message: https://marc.info/?l=kde-devel&m=136333183530111 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============4782364028115708214==" --===============4782364028115708214== Content-Type: multipart/signed; boundary="nextPart1770318.qPdGHzTJYV"; micalg="pgp-sha1"; protocol="application/pgp-signature" Content-Transfer-Encoding: quoted-printable --nextPart1770318.qPdGHzTJYV Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" On sexta-feira, 15 de mar=E7o de 2013 06.10.37, Ilya Basin wrote: > Hi list! > There's such app called bluedevilmonolithic. It goes to background on= > start. > Current code to terminate it: >=20 > void BlueDevilDaemon::monolithicQuit(QDBusPendingCallWatcher* watch= er) > { > // can restart here? > } >=20 > QDBusMessage msg =3D QDBusMessage::createMethodCall( > "org.kde.bluedevilmonolithic", > "/MainApplication", > "org.kde.KApplication", > "quit" > ); > QDBusPendingCall pending =3D QDBusConnection::sessionBus().asyncC= all(msg); > QDBusPendingCallWatcher *watcher =3D new QDBusPendingCallWatcher(pend= ing); > connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), > SLOT(monolithicQuit(QDBusPendingCallWatcher*))); >=20 > Is it too soon to try starting a new instance in monolithicQuit() ? Yes. > I don't see a call to QDBusConnectionInterface::unregisterService() i= n > kuniqueapplication.cpp. Does it mean that it unregisters only when th= e > process dies? Yes. Use QDBusServiceWatcher to find out when the name unregisters. You do n= ot need=20 to wait for the reply to the method call in that case. Just send() it i= nstead=20 of using asyncCall(). --=20 Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Software Architect - Intel Open Source Technology Center PGP/GPG: 0x6EF45358; fingerprint: E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358 --nextPart1770318.qPdGHzTJYV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iD8DBQBRQsrMM/XwBW70U1gRAjC9AKCu+hEpoqpPLb0SVUrqBHxaU7odKQCfdUqt zK58c1SnMJYXuZ3IPzjZUxA= =9KA1 -----END PGP SIGNATURE----- --nextPart1770318.qPdGHzTJYV-- --===============4782364028115708214== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --===============4782364028115708214==--