本文整理汇总了C++中KJob::setAutoDelete方法的典型用法代码示例。如果您正苦于以下问题:C++ KJob::setAutoDelete方法的具体用法?C++ KJob::setAutoDelete怎么用?C++ KJob::setAutoDelete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KJob
的用法示例。
在下文中一共展示了KJob::setAutoDelete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: debug
void
IpodCopyTracksJob::slotStartOrTranscodeCopyJob( const KUrl &sourceUrl, const KUrl &destUrl )
{
KJob *job = 0;
if( m_transcodingConfig.isJustCopy() )
{
if( m_goingToRemoveSources && m_coll &&
sourceUrl.toLocalFile().startsWith( m_coll.data()->mountPoint() ) )
{
// special case for "add orphaned tracks" to either save space and significantly
// speed-up the process:
debug() << "Moving from" << sourceUrl << "to" << destUrl;
job = KIO::file_move( sourceUrl, destUrl, -1, KIO::HideProgressInfo | KIO::Overwrite );
}
else
{
debug() << "Copying from" << sourceUrl << "to" << destUrl;
job = KIO::file_copy( sourceUrl, destUrl, -1, KIO::HideProgressInfo | KIO::Overwrite );
}
}
else
{
debug() << "Transcoding from" << sourceUrl << "to" << destUrl;
job = new Transcoding::Job( sourceUrl, destUrl, m_transcodingConfig );
}
job->setUiDelegate( 0 ); // be non-interactive
job->setAutoDelete( true );
connect( job, SIGNAL(finished(KJob*)), // we must use this instead of result() to prevent deadlock
SLOT(slotCopyOrTranscodeJobFinished()) );
job->start(); // no-op for KIO job, but matters for transcoding job
}
示例2: start
void XmlValidatorJob::start()
{
if(m_documentUrl.isEmpty()) {
m_result = Failed;
m_errors.append(i18n("No document to validate"));
setError(m_result);
emitResult();
return;
}
QString localUrl;
KJob *copyJob = 0;
//DTD inline
if(m_dtdUrl.isEmpty() && m_schemaUrl.isEmpty()) {
emit signalReady(this);
return;
}
if(!m_dtdUrl.isEmpty()) {
localUrl = getLocalURLForSchema(m_documentUrl, m_dtdUrl);
if(QFile::exists(localUrl)) {
m_dtdUrl = localUrl;
emit signalReady(this);
return;
} else {
copyJob = KIO::copy(m_dtdUrl, localUrl, KIO::HideProgressInfo);
m_dtdUrl = localUrl;
}
}
if(!m_schemaUrl.isEmpty()) {
localUrl = getLocalURLForSchema(m_documentUrl, m_schemaUrl);
if(QFile::exists(localUrl)) {
m_schemaUrl = localUrl;
emit signalReady(this);
return;
} else {
copyJob = KIO::copy(m_schemaUrl, localUrl, KIO::HideProgressInfo);
m_schemaUrl = localUrl;
}
}
copyJob->setAutoDelete(true);
copyJob->setUiDelegate(0);
connect(copyJob, SIGNAL(result(KJob *)), this, SLOT(ready(KJob *)));
copyJob->start();
}