Exemple #1
0
void
TtbDialog::finishSettings(QNetworkReply *reply)
{
    progressBar->setValue(4);

    TtbSettingsParser handler;
    QXmlInputSource source( reply );

    QXmlSimpleReader reader;
    reader.setContentHandler( &handler );

    if( ! reader.parse( source ) ){
        progressLabel->setText(tr("failed to parse Settings response: ")
            +handler.errorString());
        closeButton->setText(tr("&Close"));
        return;
    }

    if( handler.error.length() > 0 ){
        progressLabel->setText(tr("failed to get settings: ")
            +handler.error );
        closeButton->setText(tr("&Close"));
        return;
    }

    sessionId = handler.session;
    proMember = handler.pro;

    if( sessionId.length() == 0 ){
        requestSession();
    } else {
        requestUpload();
    }
}
void
TrainingstagebuchUploader::finishSettings(QNetworkReply *reply)
{
    parent->progressBar->setValue(parent->progressBar->value()+5/parent->shareSiteCount);

    TtbSettingsParser handler;
    QXmlInputSource source( reply );

    QXmlSimpleReader reader;
    reader.setContentHandler( &handler );

    if( ! reader.parse( source ) ){
        parent->errorLabel->setText(tr("failed to parse Settings response: ")
            +handler.errorString());

        eventLoop.quit();
        return;
    }

    if( handler.error.length() > 0 ){
        parent->errorLabel->setText(tr("failed to get settings: ")
            +handler.error );

        eventLoop.quit();
        return;
    }

    sessionId = handler.session;
    proMember = handler.pro;

    if( sessionId.length() == 0 ){
        requestSession();
    } else {
        requestUpload();
    }
}