本文整理汇总了C++中kio::TransferJob::error方法的典型用法代码示例。如果您正苦于以下问题:C++ TransferJob::error方法的具体用法?C++ TransferJob::error怎么用?C++ TransferJob::error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kio::TransferJob
的用法示例。
在下文中一共展示了TransferJob::error方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotLocalGotResult
void DccTransferRecv::slotLocalGotResult( KIO::Job* job )
{
kdDebug() << "DccTransferRecv::slotLocalGotResult() [BEGIN]" << endl;
KIO::TransferJob* transferJob = static_cast<KIO::TransferJob*>( job );
disconnect( transferJob, 0, 0, 0 );
switch ( transferJob->error() )
{
case 0: // no error
kdDebug() << "DccTransferRecv::slotLocalGotResult(): job->error() returned 0." << endl
<< "DccTransferRecv::slotLocalGotResult(): Why was I called in spite of no error?" << endl;
break;
case KIO::ERR_FILE_ALREADY_EXIST:
askAndPrepareLocalKio( i18n( "<b>The file already exists.</b><br>"
"%1<br>" )
.arg( m_fileURL.prettyURL() ),
DccResumeDialog::RA_Overwrite | DccResumeDialog::RA_Rename | DccResumeDialog::RA_Cancel,
DccResumeDialog::RA_Overwrite );
break;
default:
askAndPrepareLocalKio( i18n( "<b>Could not open the file.<br>"
"Error: %1</b><br>"
"%2<br>" )
.arg( transferJob->error() )
.arg( m_fileURL.prettyURL() ),
DccResumeDialog::RA_Rename | DccResumeDialog::RA_Cancel,
DccResumeDialog::RA_Rename );
}
kdDebug() << "DccTransferRecv::slotLocalGotResult() [END]" << endl;
}
示例2: _k_contentTypeCheckFailed
void _k_contentTypeCheckFailed(KJob* job)
{
KIO::TransferJob* tJob = qobject_cast<KIO::TransferJob*>(job);
// On error simply call downloadResource which will probably fail as well.
if (tJob && tJob->error()) {
(void)downloadResource(tJob->url(), QString(), window, tJob->metaData());
}
}
示例3: _k_receivedContentType
void _k_receivedContentType(KIO::Job* job, const QString& mimetype)
{
KIO::TransferJob* tJob = qobject_cast<KIO::TransferJob*>(job);
if (tJob && !tJob->error()) {
tJob->putOnHold();
KIO::Scheduler::publishSlaveOnHold();
// Get suggested file name...
mimeType = mimetype;
const QString suggestedFileName (tJob->queryMetaData(QL1S("content-disposition-filename")));
// kDebug(800) << "suggested filename:" << suggestedFileName << ", mimetype:" << mimetype;
(void) downloadResource(tJob->url(), suggestedFileName, window, tJob->metaData());
}
}
示例4: scanFile
void KonqRun::scanFile()
{
KParts::BrowserRun::scanFile();
// could be a static cast as of now, but who would notify when
// BrowserRun changes
KIO::TransferJob *job = dynamic_cast<KIO::TransferJob*>(KRun::job());
if (job && !job->error()) {
connect(job, SIGNAL(redirection(KIO::Job*,KUrl)),
SLOT(slotRedirection(KIO::Job*,KUrl)));
if (m_pView && m_pView->service()->desktopEntryName() != "konq_sidebartng") {
connect(job, SIGNAL(infoMessage(KJob*,QString,QString)),
m_pView, SLOT(slotInfoMessage(KJob*,QString)));
}
}
}
示例5: 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();
}