mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 18:32:53 +00:00
krfb: de-duplicate clientGoneHookNoop() function
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
3e30713758
commit
088d405def
3 changed files with 12 additions and 6 deletions
|
@ -41,13 +41,11 @@ struct PendingInvitationsRfbClient::Private
|
|||
bool askOnConnect;
|
||||
};
|
||||
|
||||
static void clientGoneHookNoop(rfbClientPtr cl) { Q_UNUSED(cl); }
|
||||
|
||||
PendingInvitationsRfbClient::PendingInvitationsRfbClient(rfbClientPtr client, QObject *parent) :
|
||||
PendingRfbClient(client, parent),
|
||||
d(new Private(client))
|
||||
{
|
||||
d->client->clientGoneHook = clientGoneHookNoop;
|
||||
d->client->clientGoneHook = RfbClient::clientGoneHookNoop;
|
||||
d->notifier = new QSocketNotifier(client->sock, QSocketNotifier::Read, this);
|
||||
d->notifier->setEnabled(true);
|
||||
connect(d->notifier, SIGNAL(activated(int)),
|
||||
|
|
|
@ -148,6 +148,11 @@ void RfbClient::onSocketActivated()
|
|||
}
|
||||
}
|
||||
|
||||
void RfbClient::clientGoneHookNoop(rfbClientPtr cl)
|
||||
{
|
||||
Q_UNUSED(cl);
|
||||
}
|
||||
|
||||
void RfbClient::update()
|
||||
{
|
||||
rfbUpdateClient(d->client);
|
||||
|
@ -187,14 +192,12 @@ void PendingRfbClient::accept(RfbClient *newClient)
|
|||
deleteLater();
|
||||
}
|
||||
|
||||
static void clientGoneHookNoop(rfbClientPtr cl) { Q_UNUSED(cl); }
|
||||
|
||||
void PendingRfbClient::reject()
|
||||
{
|
||||
kDebug() << "refused connection";
|
||||
|
||||
//override the clientGoneHook that was previously set by RfbServer
|
||||
m_rfbClient->clientGoneHook = clientGoneHookNoop;
|
||||
m_rfbClient->clientGoneHook = RfbClient::clientGoneHookNoop;
|
||||
rfbCloseClient(m_rfbClient);
|
||||
rfbClientConnectionGone(m_rfbClient);
|
||||
|
||||
|
|
|
@ -58,6 +58,11 @@ protected:
|
|||
private Q_SLOTS:
|
||||
void onSocketActivated();
|
||||
|
||||
protected:
|
||||
static void clientGoneHookNoop(rfbClientPtr cl);
|
||||
friend class PendingInvitationsRfbClient;
|
||||
friend class PendingRfbClient;
|
||||
|
||||
private:
|
||||
///called by RfbServerManager to send framebuffer updates
|
||||
///and check for possible disconnection
|
||||
|
|
Loading…
Add table
Reference in a new issue