void TcpSocket::close() { if(!isAvaliable()) return; ::close(m_fd); onClosed(this); m_fd = -1; }
SyncProcess::SyncProcess(const QString & folder1, const QString & folder2, ProgressWidget * progress): folder1(folder1), folder2(folder2), progress(progress), index(0), count(0), closed(false) { connect(progress, SIGNAL(stopped()),this, SLOT(onClosed())); }
//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ void GameObjectType::destroyDocument(Zen::Memory::managed_weak_ptr<Zen::Studio::Workbench::I_Document> _wpDoc) { GameObjectTypeDocument* pDoc = dynamic_cast<GameObjectTypeDocument*>(_wpDoc.get()); if (pDoc) { onClosed(pDoc); delete pDoc; } else { // TODO Error? } }
void RWHandler::doWrite() { auto self(shared_from_this()); boost::asio::async_write(m_socket, boost::asio::buffer(m_write_buffer.front().data(), m_write_buffer.front().size()), [this, self](boost::system::error_code ec, std::size_t length) { (void)length; if (ec) { FAKE_LOG(ERROR) << "RWHandlerBase::doWrite error: " << ec.value() << ":" << ec.message(); onClosed(); return; } m_write_buffer.pop_front(); if (!m_write_buffer.empty()) { doWrite(); } }); }
NetworkControl::NetworkControl() { client = new Client(); QObject::connect(client, SIGNAL(connected()), this, SLOT(onConnected())); QObject::connect(client, SIGNAL(hostFound()), this, SLOT(onHostFound())); QObject::connect(client, SIGNAL(loggingIn()), this, SLOT(onLoggingIn())); QObject::connect(client, SIGNAL(successfullJoin()), this, SLOT(onConnectionAccepted())); QObject::connect(client, SIGNAL(disconnected()), this, SLOT(onDisconnected())); QObject::connect(client, SIGNAL(presentationReceived(QString, QList<QImage>)), this, SLOT(onPresentationReceived(QString, QList<QImage>))); server = new Server(); QObject::connect(server, SIGNAL(listening()), this, SLOT(onStarted())); QObject::connect(server, SIGNAL(connectionAccepted()), this, SLOT(onClientConnected())); QObject::connect(server, SIGNAL(clientVerified()), this, SLOT(onClientVerified())); QObject::connect(server, SIGNAL(clientLeft()), this, SLOT(onClientLeft())); QObject::connect(server, SIGNAL(closing()), this, SLOT(onClosed())); }
void Window::frame(const float& dTime) { window.clear(); //get input sf::Event event; while (window.pollEvent(event)) { switch (event.type) { case sf::Event::Closed: //x button clicked onClosed(); break; default: activeScene->processInput(event); break; } } activeScene->draw(window); //draw active node window.display(); }
NetworkControl::NetworkControl(PresentationControl* p) { pc = p; QObject::connect(pc, SIGNAL(presentationChanged()), this, SLOT(onPresentationChanged())); QThread* networkThread = new QThread(); client = new Client(); QObject::connect(client, SIGNAL(currentPageReceived(qint64)), pc, SLOT(onCurrenPageChanged(qint64))); QObject::connect(client, SIGNAL(connected()), this, SLOT(onConnected())); QObject::connect(client, SIGNAL(hostFound()), this, SLOT(onHostFound())); QObject::connect(client, SIGNAL(loggingIn()), this, SLOT(onLoggingIn())); QObject::connect(client, SIGNAL(successfullJoin()), this, SLOT(onConnectionAccepted())); QObject::connect(client, SIGNAL(disconnected()), this, SLOT(onDisconnected())); QObject::connect(client, SIGNAL(presentationReceived(QString, QList<QImage>)), this, SLOT(onPresentationReceived(QString, QList<QImage>))); server = new Server(); server->setPresentation(p->getPresentation()); QObject::connect(server, SIGNAL(listening()), this, SLOT(onStarted())); QObject::connect(server, SIGNAL(connectionAccepted()), this, SLOT(onClientConnected())); QObject::connect(server, SIGNAL(clientVerified()), this, SLOT(onClientVerified())); QObject::connect(server, SIGNAL(clientLeft()), this, SLOT(onClientLeft())); QObject::connect(server, SIGNAL(closing()), this, SLOT(onClosed())); }
void BOSHSessionStream::fakeStreamFooterReceipt(BOSHError::ref error) { std::string footer("</stream:stream>"); xmppLayer->handleDataRead(createSafeByteArray(footer)); onClosed(error); }
void BOSHSessionStream::handleXMPPError() { available = false; onClosed(std::make_shared<SessionStreamError>(SessionStreamError::ParseError)); }
void ClosableDockWidget::closeEvent( QCloseEvent* event ) { emit onClosed( this ); __super::closeEvent( event ); }
void QtChatWindow::closeEvent(QCloseEvent* event) { event->accept(); emit windowClosing(); onClosed(); }
void ClientController::fire_onClosed() { onClosed(); }