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


C++ KJob::setAutoDelete方法代码示例

本文整理汇总了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
}
开发者ID:ErrAza,项目名称:amarok,代码行数:31,代码来源:IpodCopyTracksJob.cpp

示例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();
}
开发者ID:KDE,项目名称:kdev-xml,代码行数:49,代码来源:xmlvalidatorjob.cpp


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