forked from qt-creator/qt-creator
DeviceShare: Initialize Output Pane after clearing
Change-Id: I98ca6791317763a5a148f1fd3138f573600208ab Reviewed-by: Knud Dollereder <knud.dollereder@qt.io>
This commit is contained in:
@@ -217,12 +217,12 @@ void AppOutputParentModel::setupRunControls()
|
||||
connect(explorerPlugin,
|
||||
&ProjectExplorer::ProjectExplorerPlugin::runControlStarted,
|
||||
[this](ProjectExplorer::RunControl *rc) {
|
||||
initializeRuns(rc);
|
||||
initializeRuns(rc->commandLine().displayName());
|
||||
connect(rc,
|
||||
&ProjectExplorer::RunControl::appendMessage,
|
||||
[this, rc](const QString &out, Utils::OutputFormat format) {
|
||||
if (m_runs.empty())
|
||||
initializeRuns(rc);
|
||||
initializeRuns(rc->commandLine().displayName());
|
||||
|
||||
int row = static_cast<int>(m_runs.size()) - 1;
|
||||
emit messageAdded(row, out.trimmed(), colorFromFormat(format));
|
||||
@@ -234,31 +234,26 @@ void AppOutputParentModel::setupRunControls()
|
||||
connect(&deviceManager,
|
||||
&QmlDesigner::DeviceShare::DeviceManager::projectStarted,
|
||||
[this](const QmlDesigner::DeviceShare::DeviceInfo &deviceInfo) {
|
||||
AppOutputParentModel::Run run;
|
||||
run.timestamp = QTime::currentTime().toString().toStdString();
|
||||
run.messages.push_back(
|
||||
{"Project started on device " + deviceInfo.deviceId(), m_messageColor});
|
||||
|
||||
beginResetModel();
|
||||
m_runs.push_back(run);
|
||||
endResetModel();
|
||||
initializeRuns("Project started on device " + deviceInfo.deviceId());
|
||||
});
|
||||
|
||||
connect(&deviceManager,
|
||||
&QmlDesigner::DeviceShare::DeviceManager::projectLogsReceived,
|
||||
[this](const QmlDesigner::DeviceShare::DeviceInfo &, const QString &logs) {
|
||||
if (!m_runs.empty()) {
|
||||
int row = static_cast<int>(m_runs.size()) - 1;
|
||||
emit messageAdded(row, logs.trimmed(), m_messageColor);
|
||||
}
|
||||
if (m_runs.empty())
|
||||
initializeRuns();
|
||||
|
||||
int row = static_cast<int>(m_runs.size()) - 1;
|
||||
emit messageAdded(row, logs.trimmed(), m_messageColor);
|
||||
});
|
||||
}
|
||||
|
||||
void AppOutputParentModel::initializeRuns(ProjectExplorer::RunControl *rc)
|
||||
void AppOutputParentModel::initializeRuns(const QString &message)
|
||||
{
|
||||
AppOutputParentModel::Run run;
|
||||
run.timestamp = QTime::currentTime().toString().toStdString();
|
||||
run.messages.push_back({rc->commandLine().displayName(), m_messageColor});
|
||||
if (!message.isEmpty())
|
||||
run.messages.push_back({message, m_messageColor});
|
||||
|
||||
beginResetModel();
|
||||
m_runs.push_back(run);
|
||||
|
@@ -108,7 +108,7 @@ public:
|
||||
|
||||
private:
|
||||
void setupRunControls();
|
||||
void initializeRuns(ProjectExplorer::RunControl *rc);
|
||||
void initializeRuns(const QString &message = {});
|
||||
QColor colorFromFormat(Utils::OutputFormat format) const;
|
||||
|
||||
QColor m_historyColor = Qt::gray;
|
||||
|
Reference in New Issue
Block a user