当前位置: 首页>>代码示例>>C++>>正文


C++ Job::errorString方法代码示例

本文整理汇总了C++中kio::Job::errorString方法的典型用法代码示例。如果您正苦于以下问题:C++ Job::errorString方法的具体用法?C++ Job::errorString怎么用?C++ Job::errorString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kio::Job的用法示例。


在下文中一共展示了Job::errorString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: slotResult

void ImageshackTalker::slotResult(KJob* kjob)
{
    m_job = 0;
    KIO::Job* job = static_cast<KIO::Job*>(kjob);

    if (job->error())
    {
        if (m_loginInProgress)
        {
            checkRegistrationCodeDone(job->error(), job->errorString());
        }
        else if (m_state == IMGHCK_ADDPHOTO)
        {
            emit signalBusy(false);
            emit signalAddPhotoDone(job->error(), job->errorString());
        }
        return;
    }

    switch (m_state)
    {
        case IMGHCK_CHECKREGCODE:
            parseCheckRegistrationCode(m_buffer);
            break;
        case IMGHCK_ADDPHOTO:
            parseUploadPhotoDone(m_buffer);
            break;
        default:
            break;
    }
}
开发者ID:NathanDM,项目名称:kipi-plugins,代码行数:31,代码来源:imageshacktalker.cpp

示例2: slotResult

void ImageshackTalker::slotResult(KJob* kjob)
{
    KIO::Job* job = static_cast<KIO::Job*>(kjob);

    if (job->error())
    {
        if (m_loginInProgress)
        {
            checkRegistrationCodeDone(job->error(), job->errorString());
            m_loginInProgress = false;
        }
        else if (m_state == IMGHCK_GETGALLERIES)
        {
            emit signalBusy(false);
            emit signalGetGalleriesDone(job->error(), job->errorString());
        }
        else if (m_state == IMGHCK_ADDPHOTO || m_state == IMGHCK_ADDPHOTOGALLERY)
        {
            emit signalBusy(false);
            emit signalAddPhotoDone(job->error(), job->errorString());
        }
        m_state = IMGHCK_DONOTHING;
        m_job = 0;
        return;
    }

    int step;
    switch (m_state)
    {
        case IMGHCK_CHECKREGCODE:
            m_job = 0;
            parseCheckRegistrationCode(m_buffer);
            break;
        case IMGHCK_ADDPHOTOGALLERY:
            step = job->property("k_step").toInt();
            if (step == STEP_UPLOADITEM)
                parseUploadPhotoDone(m_buffer);
            else
                parseAddPhotoToGalleryDone(m_buffer);
            break;
        case IMGHCK_ADDVIDEO:
        case IMGHCK_ADDPHOTO:
            m_job = 0;
            parseUploadPhotoDone(m_buffer);
            break;
        case IMGHCK_GETGALLERIES:
            m_job = 0;
            parseGetGalleries(m_buffer);
            break;
        default:
            break;
    }
}
开发者ID:rickysarraf,项目名称:digikam,代码行数:53,代码来源:imageshacktalker.cpp

示例3: slotResult

void ImgurTalker::slotResult(KJob* kjob)
{
    KIO::Job* job = static_cast<KIO::Job*>(kjob);

    if ( job->error() )
    {
        ImgurError err;
        err.message = tr("Upload failed");
        emit signalError(err); //job->errorString()
        kDebug() << "Error :" << job->errorString();
    }

    bool parseOk = false;

    switch(m_state)
    {
        case IE_REMOVEPHOTO:
            parseOk = parseResponseImageRemove(m_buffer);
            break;

        case IE_ADDPHOTO:
            parseOk = parseResponseImageUpload(m_buffer);
            break;
        default:
            break;
    }

    m_buffer.resize(0);

    emit signalUploadDone();
    emit signalBusy(false);

    return;
}
开发者ID:UIKit0,项目名称:digikam-2012-kipi-plugins,代码行数:34,代码来源:imgurtalker.cpp

示例4: checkNetworkAccess

static bool checkNetworkAccess()
{
    if (s_networkAccess == Unknown) {
        QElapsedTimer tm;
        tm.start();
        KIO::Job *job = KIO::get(QUrl(s_iconUrl), KIO::NoReload, KIO::HideProgressInfo);
        if (job->exec()) {
            s_networkAccess = Yes;
            qDebug() << "Network access OK. Download time" << tm.elapsed() << "ms";
        } else {
            qWarning() << job->errorString();
            s_networkAccess = No;
        }
    }
    return s_networkAccess == Yes;
}
开发者ID:KDE,项目名称:kio,代码行数:16,代码来源:favicontest.cpp

示例5: slotResult

void BackendOsmRG::slotResult(KJob* kJob)
{
    KIO::Job* kioJob = qobject_cast<KIO::Job*>(kJob);

    if (kioJob->error())
    {
        d->errorMessage = kioJob->errorString();
        emit(signalRGReady(d->jobs.first().request));
        d->jobs.clear();
        
        return;
    }

    for (int i = 0; i < d->jobs.count(); ++i)
    {
        if (d->jobs.at(i).kioJob == kioJob)
        {
            QString dataString;
            dataString = QString::fromUtf8(d->jobs[i].data.constData(),qstrlen(d->jobs[i].data.constData()));

            int pos = dataString.indexOf("<reversegeocode");
            dataString.remove(0,pos);

            QMap<QString, QString> resultMap = makeQMapFromXML(dataString);

            for (int j = 0; j < d->jobs[i].request.count(); ++j)
            {
                d->jobs[i].request[j].rgData = resultMap;
            }
            emit(signalRGReady(d->jobs[i].request));
 
            d->jobs.removeAt(i);

            if (!d->jobs.empty())
            {    
                QTimer::singleShot(500, this, SLOT(nextPhoto()));
            }

            break;
        }
    }
}
开发者ID:UIKit0,项目名称:digikam,代码行数:42,代码来源:backend-osm-rg.cpp

示例6: slotResult

void PiwigoTalker::slotResult(KJob* job)
{
    KIO::Job* tempjob = static_cast<KIO::Job*>(job);
    State state = m_state; // Can change in the treatment itself
    // so we cache it

    if (tempjob->error())
    {
        if (state == GE_LOGIN)
        {
            emit signalLoginFailed(tempjob->errorString());
            kDebug() << tempjob->errorString();
        }
        else if (state == GE_GETVERSION) {
            kDebug() << tempjob->errorString();
            // Version isn't mandatory and errors can be ignored
            // As login succeeded, albums can be listed
            listAlbums();
        }
        else if (state == GE_CHECKPHOTOEXIST || state == GE_GETINFO ||
                 state == GE_SETINFO         || state == GE_ADDPHOTOCHUNK ||
                 state == GE_ADDPHOTOSUMMARY || state == GE_OLD_ADDPHOTOCHUNK ||
                 state == GE_OLD_ADDTHUMB    || state == GE_OLD_ADDHQ ||
                 state == GE_OLD_ADDPHOTOSUMMARY)
        {
            emit signalAddPhotoFailed(tempjob->errorString());
        }
        else
        {
            tempjob->ui()->setWindow(m_parent);
            tempjob->ui()->showErrorMessage();
        }
        emit signalBusy(false);
        return;
    }

    switch (state)
    {
    case(GE_LOGIN):
        parseResponseLogin(m_talker_buffer);
        break;
    case(GE_GETVERSION):
        parseResponseGetVersion(m_talker_buffer);
        break;
    case(GE_LISTALBUMS):
        parseResponseListAlbums(m_talker_buffer);
        break;
    case(GE_CHECKPHOTOEXIST):
        parseResponseDoesPhotoExist(m_talker_buffer);
        break;
    case(GE_GETINFO):
        parseResponseGetInfo(m_talker_buffer);
        break;
    case(GE_SETINFO):
        parseResponseSetInfo(m_talker_buffer);
        break;
    // Support for Web API >= 2.4
    case(GE_ADDPHOTOCHUNK):
        parseResponseAddPhotoChunk(m_talker_buffer);
        break;
    case(GE_ADDPHOTOSUMMARY):
        parseResponseAddPhotoSummary(m_talker_buffer);
        break;
    // Support for Web API < 2.4
    case(GE_OLD_ADDPHOTOCHUNK):
        parseResponseOldAddPhoto(m_talker_buffer);
        break;
    case(GE_OLD_ADDTHUMB):
        parseResponseOldAddThumbnail(m_talker_buffer);
        break;
    case(GE_OLD_ADDHQ):
        parseResponseOldAddHQPhoto(m_talker_buffer);
        break;
    case(GE_OLD_ADDPHOTOSUMMARY):
        parseResponseOldAddPhotoSummary(m_talker_buffer);
        break;
    }

    tempjob->kill();
    m_job = 0;

    if (state == GE_GETVERSION && m_loggedIn)
    {
        listAlbums();
    }
    emit signalBusy(false);
}
开发者ID:NathanDM,项目名称:kipi-plugins,代码行数:87,代码来源:piwigotalker.cpp

示例7: slotResult

void GalleryTalker::slotResult(KJob *job)
{
    KIO::Job *tempjob = static_cast<KIO::Job*>(job);

    if (tempjob->error())
    {
        if (m_state == GE_LOGIN)
        {
            emit signalLoginFailed(tempjob->errorString());
        }
        else
        {
            if (m_state == GE_ADDPHOTO)
            {
                emit signalAddPhotoFailed(tempjob->errorString());
            }
            else
            {
                tempjob->ui()->setWindow(m_parent);
                tempjob->ui()->showErrorMessage();
            }
        }
        emit signalBusy(false);
        return;
    }

    switch (m_state)
    {
        case(GE_LOGIN):
            parseResponseLogin(m_talker_buffer);
            break;
        case(GE_LISTALBUMS):
            parseResponseListAlbums(m_talker_buffer);
            break;
        case(GE_LISTPHOTOS):
            parseResponseListPhotos(m_talker_buffer);
            break;
        case(GE_CREATEALBUM):
            parseResponseCreateAlbum(m_talker_buffer);
            break;
        case(GE_ADDPHOTO):
            parseResponseAddPhoto(m_talker_buffer);
            break;
    }

    if (m_state == GE_LOGIN && m_loggedIn)
    {
        const QStringList cookielist = (tempjob->queryMetaData("setcookies")).split('\n');
        m_cookie = "Cookie:";


        if(!cookielist.isEmpty())
        {
            QRegExp rx("^GALLERYSID=.+");
            QString app;
            foreach(const QString &str, cookielist)
            {
                if(str.contains("Set-Cookie: "))
                {
                    const QStringList cl = str.split(' ');
                    int n = cl.lastIndexOf(rx);
                    if(n!= -1)
                    {
                        app = cl.at(n);
                    }
                }
            }
            m_cookie += app;
        }

        tempjob->kill();
        listAlbums();
    }
开发者ID:,项目名称:,代码行数:73,代码来源:

示例8: slotResult

void FlickrTalker::slotResult(KJob* kjob)
{
    m_job = 0;
    emit signalBusy(false);
    KIO::Job* job = static_cast<KIO::Job*>(kjob);

    if (job->error())
    {
        if (m_state == FE_ADDPHOTO)
        {
            emit signalAddPhotoFailed(job->errorString());
        }
        else
        {
            job->ui()->setWindow(m_parent);
            job->ui()->showErrorMessage();
        }

        return;
    }

    switch (m_state)
    {
        case (FE_LOGIN):
            //parseResponseLogin(m_buffer);
            break;

        case (FE_LISTPHOTOSETS):
            parseResponseListPhotoSets(m_buffer);
            break;

        case (FE_GETFROB):
            parseResponseGetFrob(m_buffer);
            break;

        case (FE_GETTOKEN):
            parseResponseGetToken(m_buffer);
            break;

        case (FE_CHECKTOKEN):
            parseResponseCheckToken(m_buffer);
            break;

        case (FE_GETAUTHORIZED):
            //parseResponseGetToken(m_buffer);
            break;

        case (FE_LISTPHOTOS):
            parseResponseListPhotos(m_buffer);
            break;

        case (FE_GETPHOTOPROPERTY):
            parseResponsePhotoProperty(m_buffer);
            break;

        case (FE_ADDPHOTO):
            parseResponseAddPhoto(m_buffer);
            break;

        case (FE_ADDPHOTOTOPHOTOSET):
            parseResponseAddPhotoToPhotoSet(m_buffer);
            break;

        case (FE_CREATEPHOTOSET):
            parseResponseCreatePhotoSet(m_buffer);
            break;
    }
}
开发者ID:NathanDM,项目名称:kipi-plugins,代码行数:68,代码来源:flickrtalker.cpp


注:本文中的kio::Job::errorString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。