| 402 | } |
| 403 | |
| 404 | int CBackendVnc::SetChannelConnect(QSharedPointer<CChannel> channel) |
| 405 | { |
| 406 | bool check = false; |
| 407 | check = connect(channel.data(), SIGNAL(sigConnected()), |
| 408 | this, SLOT(slotConnected())); |
| 409 | Q_ASSERT(check); |
| 410 | check = connect(channel.data(), SIGNAL(sigDisconnected()), |
| 411 | this, SLOT(slotDisConnected())); |
| 412 | Q_ASSERT(check); |
| 413 | check = connect(channel.data(), SIGNAL(readyRead()), |
| 414 | this, SLOT(slotReadyRead())); |
| 415 | Q_ASSERT(check); |
| 416 | check = connect(channel.data(), SIGNAL(sigError(int, const QString&)), |
| 417 | this, SLOT(slotChannelError(int, const QString&))); |
| 418 | Q_ASSERT(check); |
| 419 | if(m_pOperate && m_pOperate->GetStats()) { |
| 420 | check = connect(channel.data(), SIGNAL(sigReceive(quint64)), |
| 421 | m_pOperate->GetStats(), SLOT(AddReceives(quint64))); |
| 422 | Q_ASSERT(check); |
| 423 | check = connect(channel.data(), SIGNAL(sigSend(quint64)), |
| 424 | m_pOperate->GetStats(), SLOT(AddSends(quint64))); |
| 425 | Q_ASSERT(check); |
| 426 | } |
| 427 | return 0; |
| 428 | } |
| 429 | |
| 430 | int CBackendVnc::OnClean() |
| 431 | { |