コード例 #1
0
ファイル: kjob.cpp プロジェクト: crayonink/calligra-2
bool KJob::exec()
{
    Q_D(KJob);
    // Usually this job would delete itself, via deleteLater() just after
    // emitting result() (unless configured otherwise). Since we use an event
    // loop below, that event loop will process the deletion event and we'll
    // have been deleted when exec() returns. This crashes, so temporarily
    // suspend autodeletion and manually do it afterwards.
    const bool wasAutoDelete = isAutoDelete();
    setAutoDelete( false );

    Q_ASSERT( ! d->eventLoop );

    QEventLoop loop( this );
    d->eventLoop = &loop;

    start();
    if( !d->isFinished ) {
        d->eventLoop->exec(QEventLoop::ExcludeUserInputEvents);
    }
    d->eventLoop = 0;

    if ( wasAutoDelete ) {
        deleteLater();
    }
    return ( d->error == NoError );
}
コード例 #2
0
ファイル: kjob.cpp プロジェクト: crayonink/calligra-2
bool KJob::kill( KillVerbosity verbosity )
{
    Q_D(KJob);
    if ( doKill() )
    {
        setError( KilledJobError );

        if ( verbosity!=Quietly )
        {
            emitResult();
        }
        else
        {
            // If we are displaying a progress dialog, remove it first.
            d->isFinished = true;
            emit finished(this);

            if ( isAutoDelete() )
                deleteLater();
        }

        return true;
    }
    else
    {
        return false;
    }
}
コード例 #3
0
ファイル: kjob.cpp プロジェクト: crayonink/calligra-2
void KJob::emitResult()
{
    Q_D(KJob);
    d->isFinished = true;

    if ( d->eventLoop ) {
        d->eventLoop->quit();
    }

    // If we are displaying a progress dialog, remove it first.
    emit finished( this );

    emit result( this );

    if ( isAutoDelete() )
        deleteLater();
}
コード例 #4
0
// Destructor.
qtractorPluginCommand::~qtractorPluginCommand (void)
{
	if (isAutoDelete())
		qDeleteAll(m_plugins);
	m_plugins.clear();
}
コード例 #5
0
ファイル: qtractorTrackCommand.cpp プロジェクト: EQ4/qtractor
// Destructor.
qtractorTrackCommand::~qtractorTrackCommand (void)
{
	if (isAutoDelete())
		delete m_pTrack;
}