From 8ddd5a35be9116bb89a177b7c4d10abdd44a7c90 Mon Sep 17 00:00:00 2001
From: Burak Hancerli <burak.hancerli@qt.io>
Date: Fri, 17 Nov 2023 17:51:27 +0100
Subject: [PATCH] chore: a bit cleanup

---
 src/backend.cpp        |  2 +-
 src/projectManager.cpp | 11 +++--------
 src/projectManager.h   |  2 +-
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/backend.cpp b/src/backend.cpp
index 08f88c5..7f59810 100644
--- a/src/backend.cpp
+++ b/src/backend.cpp
@@ -131,7 +131,7 @@ bool Backend::connectDesignStudio()
                         qDebug() << "Project unpacked to " << projectPath;
                         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 "
                                            "information.";
                         } else {
diff --git a/src/projectManager.cpp b/src/projectManager.cpp
index bbece42..99868b2 100644
--- a/src/projectManager.cpp
+++ b/src/projectManager.cpp
@@ -164,13 +164,9 @@ QStringList ProjectManager::getImportPaths(const QString &projectPath,
 
     QStringList importPaths;
     for (const QString &path : importPathsMatch.captured(1).split(",")) {
-        qDebug() << "verbose:: Found import path: " << path;
         QString cleanedPath = path.trimmed();
-        qDebug() << "verbose:: Cleaned import path: " << cleanedPath;
         cleanedPath = projectPath + "/" + cleanedPath.mid(1, cleanedPath.length() - 2);
-        qDebug() << "verbose:: Cleaned import path: " << cleanedPath;
         if (QFileInfo::exists(cleanedPath)) {
-            qDebug() << "verbose:: Adding import path: " << cleanedPath;
             importPaths.append(cleanedPath);
         }
     }
@@ -185,7 +181,7 @@ bool ProjectManager::isQt6Project(const QString &qmlProjectFileContent)
     return qt6ProjectMatch.hasMatch();
 }
 
-bool ProjectManager::runProject(const QString &projectPath, const QString &projectName)
+bool ProjectManager::runProject(const QString &projectPath)
 {
     qDebug() << "Project location: " << projectPath;
 
@@ -396,11 +392,10 @@ bool ProjectManager::isProjectCached(const QJsonObject &projectInfo)
 bool ProjectManager::runCachedProject(const QJsonObject &projectInfo)
 {
     const QString projectId = projectInfo.value("id").toString();
-    const QString projectName = projectInfo.value("appName").toString();
     qDebug() << "Running cached project " << projectId;
 
     const QString projectPath = m_projectCachePath + "/" + projectId;
-    return runProject(projectPath, projectName);
+    return runProject(projectPath);
 }
 
 bool ProjectManager::cacheDemoProject(const QByteArray &projectData, const QString &projectName)
@@ -460,7 +455,7 @@ bool ProjectManager::runDemoProject(const QString &projectName)
 {
     const QString demoProjectPath = m_demoProjectCachePath + "/" + projectName;
     qDebug() << "Running demo project " << projectName << " from " << demoProjectPath;
-    return runProject(demoProjectPath, projectName);
+    return runProject(demoProjectPath);
 }
 
 void ProjectManager::orientateWindow(Qt::ScreenOrientation orientation)
diff --git a/src/projectManager.h b/src/projectManager.h
index 3a2cfdb..6fad257 100644
--- a/src/projectManager.h
+++ b/src/projectManager.h
@@ -40,7 +40,7 @@ public:
     explicit ProjectManager(QObject *parent = nullptr);
 
     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 isProjectCached(const QJsonObject &projectInfo);
-- 
GitLab