本文整理汇总了C++中kio::TransferJob::isErrorPage方法的典型用法代码示例。如果您正苦于以下问题:C++ TransferJob::isErrorPage方法的具体用法?C++ TransferJob::isErrorPage怎么用?C++ TransferJob::isErrorPage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kio::TransferJob
的用法示例。
在下文中一共展示了TransferJob::isErrorPage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fetchFinished
void HttpContainer::fetchFinished(KJob *job)
{
if (!job->error()) {
// We now set the data on the source with the retrieved data and some
// additional stats. Note that we don't include the source name, as that
// is implied as this object *is* the DataContainer. setData is called
// with just key/value pairs.
setData("Contents", m_data);
setData("Size", job->processedAmount(KJob::Bytes));
// Since we only create TransferJobs, it's safe to just static_cast here.
// In many real-world situations, this isn't the safest thing to do and a
// qobject_cast with a test on the result is often safer and cleaner.
KIO::TransferJob *tjob = static_cast<KIO::TransferJob *>(job);
setData("Error Page", tjob->isErrorPage());
setData("Mimetype", tjob->mimetype());
// Let DataContainer know we have data that needs storing
setNeedsToBeStored(true);
// Notify DataContainer that now is a good time to check to see that
// data has been updated. This will cause visualizations to be updated.
checkForUpdate();
// Clean up behind ourselves so there isn't unecessary memory usage
m_data.clear();
}
}
示例2: onTransferJobResultReceived
void ShareProvider::onTransferJobResultReceived(KJob* job)
{
if (d->m_data.size() == 0) {
Q_EMIT finishedError(this, i18n("Service was not available"));
return;
}
KIO::TransferJob *tfJob = qobject_cast<KIO::TransferJob*>(job);
if (tfJob) {
QString mimeType = tfJob->mimetype();
AbstractSharer *sharer = d->getSharer();
if (sharer) {
sharer->parseResponse(d->m_data);
if (tfJob->isErrorPage() || sharer->hasError()) {
QString errorMessage = sharer->errorMessage();
if (!errorMessage.isEmpty()) {
Q_EMIT finishedError(this, errorMessage);
} else {
Q_EMIT finishedError(this, tfJob->errorString());
}
} else {
Q_EMIT finishedSuccess(this, sharer->imageUrl().url());
}
}
}
}
示例3: slotJobResult
void TestLinkItr::slotJobResult(KJob *job)
{
kDebug();
m_job = 0;
KIO::TransferJob *transfer = static_cast<KIO::TransferJob *>(job);
const QString modDate = transfer->queryMetaData("modified");
if (transfer->error() || transfer->isErrorPage()) {
kDebug()<<"***********"<<transfer->error()<<" "<<transfer->isErrorPage()<<endl;
// can we assume that errorString will contain no entities?
QString err = transfer->errorString();
err.replace("\n", " ");
setStatus(err);
} else {
if (!modDate.isEmpty())
setStatus(modDate);
else
setStatus(i18n("OK"));
}
holder()->addAffectedBookmark(KBookmark::parentAddress(currentBookmark().address()));
delayedEmitNextOne();
}
示例4: continueRead
void
OpmlParser::downloadResult( KJob *job )
{
// parse more data
continueRead();
KIO::TransferJob *transferJob = dynamic_cast<KIO::TransferJob *>( job );
if( job->error() || ( transferJob && transferJob->isErrorPage() ) )
{
QString errorMessage =
i18n( "Reading OPML podcast from %1 failed with error:\n", m_url.url() );
errorMessage = errorMessage.append( job->errorString() );
// emit statusBarSorryMessage( errorMessage );
}
m_transferJob = 0;
}
示例5: hasErrorPage
static bool hasErrorPage(KJob* job)
{
KIO::TransferJob* tJob = qobject_cast<KIO::TransferJob*>(job);
return (tJob && tJob->isErrorPage());
}