plugin::plugin() { m_Buffer = 0; m_Http = new QHttp; connect(m_Http, SIGNAL(requestFinished(int, bool)), this, SLOT(requestFinished(int, bool)));}plugin::~plugin() { if (m_Http) delete m_Http; if (m_Buffer) delete m_Buffer;}void plugin::abort() { m_Http->abort(); if (m_Buffer) delete m_Buffer, m_Buffer = 0;}void plugin::post() { QHttpRequestHeader header("POST", c_Path); header.setContentType("text/xml"); m_Http->setHost(c_Host); m_Buffer = new QBuffer; if (m_Buffer->open(QIODevice::WriteOnly)) m_ID = m_Http->request(header, QByteArray("preved!"), m_Buffer); else delete m_Buffer, m_Buffer = 0;}void plugin::requestFinished(int id, bool error) { qDebug(qPrintable(QString("Request with ID %1 finished").arg(id))); if (id != m_ID) return; if (error) qDebug(qPrintable(m_Http->errorString())); if (m_Buffer->isOpen()) m_Buffer->close(); delete m_Buffer, m_Buffer = 0;}
void app::unload() { delete m_Plugin; m_Loader->unload(); delete m_Loader;}