Skip to content
Snippets Groups Projects

Fix log forwarding

Merged Burak Hançerli requested to merge fix-log-forwarding into master
4 files
+ 14
9
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 4
3
@@ -64,7 +64,7 @@ Backend::Backend(QObject *parent)
@@ -64,7 +64,7 @@ Backend::Backend(QObject *parent)
connect(&Logger::instance(), &Logger::logMessage, this, [this](QtMsgType type, QString &msg) {
connect(&Logger::instance(), &Logger::logMessage, this, [this](QtMsgType type, QString &msg) {
// if we have any active project running, then reroute
// if we have any active project running, then reroute
// all the logs to the dsmanager with the last project sender id
// all the logs to the dsmanager with the last project sender id
if (m_projectManager && m_projectManager->isRunning()) {
if (m_projectManager && m_lastSessionId == m_projectManager->sessionId()) {
QMetaObject::invokeMethod(m_dsManager.get(),
QMetaObject::invokeMethod(m_dsManager.get(),
"sendProjectLogs",
"sendProjectLogs",
Qt::QueuedConnection,
Qt::QueuedConnection,
@@ -142,8 +142,9 @@ void Backend::initProjectManager()
@@ -142,8 +142,9 @@ void Backend::initProjectManager()
&ProjectManager::closingProject,
&ProjectManager::closingProject,
this,
this,
[this](const QString &sessionId) {
[this](const QString &sessionId) {
// most likely the project was running from the leftover session
// if seesion ids are same, it's most likely the project was running
// (DS connected, project started, DS disconnected without stopping the project)
// from the leftover session (DS connected, project started,
 
// DS disconnected without stopping the project)
// so we'll stop the project and do not send any signals to the DS
// so we'll stop the project and do not send any signals to the DS
if (sessionId != m_lastSessionId)
if (sessionId != m_lastSessionId)
return;
return;
Loading