OTHER: Rework the 'Quit server on close' option
Quit server on close is now implemented in a cleaner and easier understandable way. It also doesn't impact the application shutdown time any more.
This commit is contained in:
parent
5e8d83ca8e
commit
11b7e5e6e7
4 changed files with 30 additions and 32 deletions
|
@ -81,13 +81,21 @@ void XClient::disconnect ()
|
|||
emit disconnected (this);
|
||||
}
|
||||
|
||||
bool
|
||||
XClient::quit ()
|
||||
void
|
||||
XClient::shutdownServer ()
|
||||
{
|
||||
if (!m_client)
|
||||
return false;
|
||||
return;
|
||||
m_client->quit ();
|
||||
return true;
|
||||
/* OnWrite is called here to make sure all pending messeages get sent
|
||||
* to the server, even if an application is closing down.
|
||||
* If this call is removed it can no longer be guaranted that the
|
||||
* quit messeage is sent to the server
|
||||
*/
|
||||
XmmsQT4 *notifier = dynamic_cast<XmmsQT4 *>(&m_client->getMainLoop());
|
||||
notifier->OnWrite ();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -93,7 +93,7 @@ class XClient : public QObject {
|
|||
|
||||
public slots:
|
||||
void disconnect ();
|
||||
bool quit ();
|
||||
void shutdownServer ();
|
||||
|
||||
protected:
|
||||
Xmms::Client *m_client;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue