本文整理汇总了C++中kio::TransferJob::kill方法的典型用法代码示例。如果您正苦于以下问题:C++ TransferJob::kill方法的具体用法?C++ TransferJob::kill怎么用?C++ TransferJob::kill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kio::TransferJob
的用法示例。
在下文中一共展示了TransferJob::kill方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotData
void FavIconRequestJobPrivate::slotData(Job *job, const QByteArray &data)
{
KIO::TransferJob *tjob = static_cast<KIO::TransferJob *>(job);
unsigned int oldSize = m_iconData.size();
// Size limit. Stop downloading if the file is huge.
// Testcase (as of june 2008, at least): http://planet-soc.com/favicon.ico, 136K and strange format.
// Another case: sites which redirect from "/favicon.ico" to "/" and return the main page.
if (oldSize > 0x10000) { // 65K
qCDebug(FAVICONS_LOG) << "Favicon too big, aborting download of" << tjob->url();
const QUrl iconUrl = tjob->url();
KIO::FavIconsCache::instance()->addFailedDownload(iconUrl);
tjob->kill(KJob::EmitResult);
} else {
m_iconData.resize(oldSize + data.size());
memcpy(m_iconData.data() + oldSize, data.data(), data.size());
}
}
示例2: slotLocalCanResume
void DccTransferRecv::slotLocalCanResume( KIO::Job* job, KIO::filesize_t size )
{
kdDebug() << "DccTransferRecv::slotLocalCanResume() [BEGIN]" << endl
<< "DccTransferRecv::slotLocalCanResume(): size: " << QString::number( size ) << endl;
if ( size != 0 )
{
KIO::TransferJob* transferJob = static_cast<KIO::TransferJob*>( job );
disconnect( transferJob, 0, 0, 0 );
transferJob->kill();
if ( KonversationApplication::instance()->getDccTransferManager()->isLocalFileInWritingProcess( m_fileURL ) )
{
askAndPrepareLocalKio( i18n( "<b>The file is used by another transfer.</b><br>"
"%1<br>" )
.arg( m_fileURL.prettyURL() ),
DccResumeDialog::RA_Rename | DccResumeDialog::RA_Cancel,
DccResumeDialog::RA_Rename );
}
else if ( Preferences::dccAutoResume() )
{
prepareLocalKio( false, true, size );
}
else
{
askAndPrepareLocalKio( i18n( "<b>A partial file exists.</b><br>"
"%1<br>"
"Size of the partial file: %2 bytes<br>" )
.arg( m_fileURL.prettyURL() )
.arg( KGlobal::locale()->formatNumber( size, 0 ) ),
DccResumeDialog::RA_Resume | DccResumeDialog::RA_Overwrite | DccResumeDialog::RA_Rename | DccResumeDialog::RA_Cancel,
DccResumeDialog::RA_Resume,
size );
}
}
kdDebug() << "DccTransferRecv::slotLocalCanResume() [END]" << endl;
}