Skip to content
Snippets Groups Projects
Commit 0f9400c0 authored by Burak Hançerli's avatar Burak Hançerli :headphones:
Browse files

* fix: sessionId is not empty even though there are no running projects

* fix: logs are not forwarded to DS before the error popup is closed
* add: qtcharts support (QDS-14435)
parent 4fef4ab0
No related branches found
No related tags found
1 merge request!68QtCharts support and a couple more fixes for log forwarding
Pipeline #78695 passed
......@@ -64,7 +64,8 @@ Backend::Backend(QObject *parent)
connect(&Logger::instance(), &Logger::logMessage, this, [this](QtMsgType type, QString &msg) {
// if we have any active project running, then reroute
// all the logs to the dsmanager with the last project sender id
if (m_projectManager && m_lastSessionId == m_projectManager->sessionId()) {
if (m_projectManager && !m_lastSessionId.isEmpty()
&& m_lastSessionId == m_projectManager->sessionId()) {
QMetaObject::invokeMethod(m_dsManager.get(),
"sendProjectLogs",
Qt::QueuedConnection,
......
......@@ -31,6 +31,8 @@ import QtQuick.Timeline.BlendTrees
import QtQuickUltralite.Extras
import QtQuickUltralite.Layers
import QtCharts
import FlowView
import Qt.labs.folderlistmodel
......
......@@ -56,12 +56,12 @@ public:
fprintf(stderr, "%s", qPrintable(newLog));
#endif
emit logMessage(type, newLog);
if (type == QtCriticalMsg || type == QtFatalMsg) {
QMessageBox msgBox{QMessageBox::Critical, "Critical:", msg, QMessageBox::Ok};
msgBox.exec();
}
emit logMessage(type, newLog);
}
private:
......
......@@ -198,13 +198,8 @@ bool ProjectManager::isQt6Project(const QString &qmlProjectFileContent)
return qt6ProjectMatch.hasMatch();
}
bool ProjectManager::runProject(const QByteArray &project,
const bool autoScaleProject,
const QString &sessionId)
bool ProjectManager::runProjectInternal(const QByteArray &project)
{
m_autoScaleProject = autoScaleProject;
m_sessionId = sessionId;
const QString projectPath = unpackProject(project);
qDebug() << "Project location: " << projectPath;
......@@ -312,6 +307,21 @@ bool ProjectManager::runProject(const QByteArray &project,
return true;
}
bool ProjectManager::runProject(const QByteArray &project,
const bool autoScaleProject,
const QString &sessionId)
{
m_autoScaleProject = autoScaleProject;
m_sessionId = sessionId;
const bool retVal = runProjectInternal(project);
if (!retVal)
m_sessionId.clear();
return retVal;
}
void ProjectManager::orientateWindow(Qt::ScreenOrientation orientation)
{
if (!m_autoScaleProject)
......@@ -379,11 +389,6 @@ void ProjectManager::stopProject()
m_quickWindow->close();
}
bool ProjectManager::isRunning()
{
return !m_sessionId.isEmpty();
}
QString ProjectManager::sessionId() const
{
return m_sessionId;
......
......@@ -34,7 +34,6 @@ public:
explicit ProjectManager(QObject *parent = nullptr);
~ProjectManager();
bool isRunning();
QString sessionId() const;
public slots:
......@@ -61,7 +60,8 @@ private:
bool copyResourceToFs(const QString &sourcePath, const QString &targetPath);
QString unpackProject(const QByteArray &project);
// project parsers
// project management
bool runProjectInternal(const QByteArray &project);
QString findFile(const QString &dir, const QString &filter);
QString readQmlProjectFile(const QString &qmlProjectFilePath);
QString getMainQmlFile(const QString &projectPath, const QString &qmlProjectFileContent);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment