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

chore: get rid of sitringified function invokations

parent 84f10312
No related branches found
No related tags found
1 merge request!80chore: get rid of sitringified function invokations
Pipeline #79854 passed
......@@ -67,10 +67,10 @@ Backend::Backend(QObject *parent)
if (m_projectManager && !m_lastSessionId.isEmpty()
&& m_lastSessionId == m_projectManager->sessionId()) {
QMetaObject::invokeMethod(m_dsManager.get(),
"sendProjectLogs",
&DesignStudioManager::sendProjectLogs,
Qt::QueuedConnection,
Q_ARG(QString, m_lastProjectSenderId),
Q_ARG(QString, msg));
m_lastProjectSenderId,
msg);
}
});
......@@ -81,7 +81,8 @@ Backend::Backend(QObject *parent)
qDebug() << "Application state changed to" << state;
if (state == Qt::ApplicationState::ApplicationSuspended) {
if (m_projectManager && !m_projectManager->sessionId().isEmpty())
QMetaObject::invokeMethod(m_projectManager.get(), "stopProject");
QMetaObject::invokeMethod(m_projectManager.get(),
&ProjectManager::stopProject);
m_dsManager->disconnectAllDesignStudios();
popupClose();
}
......@@ -164,9 +165,9 @@ void Backend::initProjectManager()
return;
QMetaObject::invokeMethod(m_dsManager.get(),
"sendProjectStopped",
&DesignStudioManager::sendProjectStopped,
Qt::QueuedConnection,
Q_ARG(QString, m_lastProjectSenderId));
m_lastProjectSenderId);
});
}
......@@ -186,7 +187,7 @@ void Backend::initDsManager()
this,
[this](const QString &id, const QString &ipAddr) {
if (id == m_lastProjectSenderId) {
QMetaObject::invokeMethod(m_projectManager.get(), "stopProject");
QMetaObject::invokeMethod(m_projectManager.get(), &ProjectManager::stopProject);
}
emit popupClose();
});
......@@ -206,7 +207,7 @@ void Backend::initDsManager()
m_lastProjectSenderId = id;
m_lastSessionId = QUuid::createUuid().toString(QUuid::WithoutBraces);
QMetaObject::invokeMethod(m_projectManager.get(),
"stopProject",
&ProjectManager::stopProject,
Qt::QueuedConnection);
});
......@@ -223,27 +224,18 @@ void Backend::initDsManager()
qDebug() << "Project stop requested";
emit popupClose();
QMetaObject::invokeMethod(m_projectManager.get(),
"stopProject",
&ProjectManager::stopProject,
Qt::QueuedConnection);
QMetaObject::invokeMethod(m_dsManager.get(),
"sendProjectStopped",
&DesignStudioManager::sendProjectStopped,
Qt::QueuedConnection,
Q_ARG(QString, m_lastProjectSenderId));
m_lastProjectSenderId);
});
m_dsManager->init();
qDebug() << "Design Studio Manager initialized";
}
void Backend::connectDesignStudio(const QString &ipAddr)
{
QMetaObject::invokeMethod(m_dsManager.get(),
"initDesignStudio",
Q_ARG(QString, ipAddr),
Q_ARG(QString, ""));
emit updatePopupText("Connecting in the background...", 1500);
}
void Backend::runProject(const QString &id, const QByteArray &projectData)
{
emit updatePopupText("Running project...");
......@@ -251,17 +243,21 @@ void Backend::runProject(const QString &id, const QByteArray &projectData)
QTimer::singleShot(1000, [this, id, projectData] {
bool retVal;
QMetaObject::invokeMethod(m_projectManager.get(),
"runProject",
&ProjectManager::runProject,
Q_RETURN_ARG(bool, retVal),
Q_ARG(QByteArray, projectData),
Q_ARG(bool, autoScaleProject()),
Q_ARG(QString, m_lastSessionId));
projectData,
autoScaleProject(),
m_lastSessionId);
if (!retVal)
QMetaObject::invokeMethod(m_dsManager.get(), "sendProjectStopped", Q_ARG(QString, id));
QMetaObject::invokeMethod(m_dsManager.get(),
&DesignStudioManager::sendProjectStopped,
id);
else {
QMetaObject::invokeMethod(m_projectManager.get(), "showAppWindow");
QMetaObject::invokeMethod(m_dsManager.get(), "sendProjectStarted", Q_ARG(QString, id));
QMetaObject::invokeMethod(m_projectManager.get(), &ProjectManager::showAppWindow);
QMetaObject::invokeMethod(m_dsManager.get(),
&DesignStudioManager::sendProjectStarted,
id);
}
emit popupClose();
......@@ -295,7 +291,7 @@ void Backend::parseDesignViewerUrl(const QUrl &url)
return;
}
connectDesignStudio(url.host());
// connectDesignStudio(url.host());
}
void Backend::popupInterrupted()
......
......@@ -83,7 +83,6 @@ signals:
public slots:
QString buildInfo() const;
void scanQrCode();
void connectDesignStudio(const QString &ipAddr);
void parseDesignViewerUrl(const QUrl &url);
void popupInterrupted();
QJsonArray getIpAddresses() const;
......
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