forked from qt-creator/qt-creator
ProjectExplorer: Use std::function for SimpleTargetRunner::start()
This spares us the typical r = runnable(); modify(r); setRunnable(r) roundtrip and the m_runnable storage that might or might not be the same as runControl->runnable. Similar for m_device. Change-Id: I8300260dd8dd7cd395e40bcd3d2ae45089085008 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -123,12 +123,14 @@ LocalQmlPreviewSupport::LocalQmlPreviewSupport(ProjectExplorer::RunControl *runC
|
||||
addStopDependency(preview);
|
||||
addStartDependency(preview);
|
||||
|
||||
ProjectExplorer::Runnable run = runnable();
|
||||
setStarter([this, runControl, serverUrl] {
|
||||
ProjectExplorer::Runnable run = runControl->runnable();
|
||||
|
||||
Utils::QtcProcess::addArg(&run.commandLineArguments,
|
||||
QmlDebug::qmlDebugLocalArguments(QmlDebug::QmlPreviewServices,
|
||||
serverUrl.path()));
|
||||
setRunnable(run);
|
||||
Utils::QtcProcess::addArg(&run.commandLineArguments,
|
||||
QmlDebug::qmlDebugLocalArguments(QmlDebug::QmlPreviewServices,
|
||||
serverUrl.path()));
|
||||
doStart(run, {});
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace QmlPreview
|
||||
|
||||
Reference in New Issue
Block a user