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

chore: a bit cleanup

parent 6dfb127a
No related branches found
No related tags found
2 merge requests!22QDS-11332 Implement better qmlproject handling,!21Design studio connector
Pipeline #64570 passed
...@@ -131,7 +131,7 @@ bool Backend::connectDesignStudio() ...@@ -131,7 +131,7 @@ bool Backend::connectDesignStudio()
qDebug() << "Project unpacked to " << projectPath; qDebug() << "Project unpacked to " << projectPath;
updatePopup("Running project..."); updatePopup("Running project...");
if (!m_projectManager.runProject(projectPath, "UntitledProject35")) { if (!m_projectManager.runProject(projectPath)) {
qCritical() << "Could not run project. Please check the logs for more " qCritical() << "Could not run project. Please check the logs for more "
"information."; "information.";
} else { } else {
......
...@@ -164,13 +164,9 @@ QStringList ProjectManager::getImportPaths(const QString &projectPath, ...@@ -164,13 +164,9 @@ QStringList ProjectManager::getImportPaths(const QString &projectPath,
QStringList importPaths; QStringList importPaths;
for (const QString &path : importPathsMatch.captured(1).split(",")) { for (const QString &path : importPathsMatch.captured(1).split(",")) {
qDebug() << "verbose:: Found import path: " << path;
QString cleanedPath = path.trimmed(); QString cleanedPath = path.trimmed();
qDebug() << "verbose:: Cleaned import path: " << cleanedPath;
cleanedPath = projectPath + "/" + cleanedPath.mid(1, cleanedPath.length() - 2); cleanedPath = projectPath + "/" + cleanedPath.mid(1, cleanedPath.length() - 2);
qDebug() << "verbose:: Cleaned import path: " << cleanedPath;
if (QFileInfo::exists(cleanedPath)) { if (QFileInfo::exists(cleanedPath)) {
qDebug() << "verbose:: Adding import path: " << cleanedPath;
importPaths.append(cleanedPath); importPaths.append(cleanedPath);
} }
} }
...@@ -185,7 +181,7 @@ bool ProjectManager::isQt6Project(const QString &qmlProjectFileContent) ...@@ -185,7 +181,7 @@ bool ProjectManager::isQt6Project(const QString &qmlProjectFileContent)
return qt6ProjectMatch.hasMatch(); return qt6ProjectMatch.hasMatch();
} }
bool ProjectManager::runProject(const QString &projectPath, const QString &projectName) bool ProjectManager::runProject(const QString &projectPath)
{ {
qDebug() << "Project location: " << projectPath; qDebug() << "Project location: " << projectPath;
...@@ -396,11 +392,10 @@ bool ProjectManager::isProjectCached(const QJsonObject &projectInfo) ...@@ -396,11 +392,10 @@ bool ProjectManager::isProjectCached(const QJsonObject &projectInfo)
bool ProjectManager::runCachedProject(const QJsonObject &projectInfo) bool ProjectManager::runCachedProject(const QJsonObject &projectInfo)
{ {
const QString projectId = projectInfo.value("id").toString(); const QString projectId = projectInfo.value("id").toString();
const QString projectName = projectInfo.value("appName").toString();
qDebug() << "Running cached project " << projectId; qDebug() << "Running cached project " << projectId;
const QString projectPath = m_projectCachePath + "/" + projectId; const QString projectPath = m_projectCachePath + "/" + projectId;
return runProject(projectPath, projectName); return runProject(projectPath);
} }
bool ProjectManager::cacheDemoProject(const QByteArray &projectData, const QString &projectName) bool ProjectManager::cacheDemoProject(const QByteArray &projectData, const QString &projectName)
...@@ -460,7 +455,7 @@ bool ProjectManager::runDemoProject(const QString &projectName) ...@@ -460,7 +455,7 @@ bool ProjectManager::runDemoProject(const QString &projectName)
{ {
const QString demoProjectPath = m_demoProjectCachePath + "/" + projectName; const QString demoProjectPath = m_demoProjectCachePath + "/" + projectName;
qDebug() << "Running demo project " << projectName << " from " << demoProjectPath; qDebug() << "Running demo project " << projectName << " from " << demoProjectPath;
return runProject(demoProjectPath, projectName); return runProject(demoProjectPath);
} }
void ProjectManager::orientateWindow(Qt::ScreenOrientation orientation) void ProjectManager::orientateWindow(Qt::ScreenOrientation orientation)
......
...@@ -40,7 +40,7 @@ public: ...@@ -40,7 +40,7 @@ public:
explicit ProjectManager(QObject *parent = nullptr); explicit ProjectManager(QObject *parent = nullptr);
QString unpackProject(const QByteArray &project, bool extractZip = false); QString unpackProject(const QByteArray &project, bool extractZip = false);
bool runProject(const QString &projectPath, const QString &projectName); bool runProject(const QString &projectPath);
bool cacheProject(const QByteArray &projectData, const QJsonObject &projectInfo); bool cacheProject(const QByteArray &projectData, const QJsonObject &projectInfo);
bool isProjectCached(const QJsonObject &projectInfo); bool isProjectCached(const QJsonObject &projectInfo);
......
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