Beispiel #1
0
void BuildManager::cancel()
{
    if (d->m_running) {
        d->m_canceling = true;
        d->m_watcher.cancel();
        if (d->m_currentBuildStep->runInGuiThread()) {
            // This is evil. A nested event loop.
            d->m_currentBuildStep->cancel();
            if (d->m_doNotEnterEventLoop) {
                d->m_doNotEnterEventLoop = false;
            } else {
                d->m_eventLoop = new QEventLoop;
                d->m_eventLoop->exec();
                delete d->m_eventLoop;
                d->m_eventLoop = 0;
            }
        } else {
            d->m_watcher.waitForFinished();
        }

        // The cancel message is added to the output window via a single shot timer
        // since the canceling is likely to have generated new addToOutputWindow signals
        // which are waiting in the event queue to be processed
        // (And we want those to be before the cancel message.)
        QTimer::singleShot(0, this, SLOT(emitCancelMessage()));

        disconnectOutput(d->m_currentBuildStep);
        decrementActiveBuildSteps(d->m_currentBuildStep);

        d->m_progressFutureInterface->setProgressValueAndText(d->m_progress*100, tr("Build/Deployment canceled")); //TODO NBS fix in qtconcurrent
        clearBuildQueue();
    }
    return;
}
Beispiel #2
0
/*! Assigns a module as an output from this module. This is not a reciprocal operation. 
\param out The module to asssign as an output. */
void ModuleBase::_assignOutput(ModuleBase* out) {
	if (_maxOutputs() == 0) {
		return;
	}

	if (std::find(_outputs.begin(), _outputs.end(), out) == _outputs.end()) {

		if (_outputs.size() == _maxOutputs()) {
			disconnectOutput(_outputs.back());
		}

		_outputs.push_back(out);
		_setDataIfNotSet(out);
		_outputAssignedEvent(out);
	}
}