From 0ea438fd43cc9d0f03ec7787e4ccad7664ef1a09 Mon Sep 17 00:00:00 2001 From: Lu Zhen Date: Tue, 16 Jan 2024 15:01:48 +0800 Subject: [PATCH] refactor: remove unused code Log: Change-Id: Ib3f02e308ac0bcbb6d51fc0c5c765ffceb2a0b89 --- .../mainframe/cmakeprojectgenerator.cpp | 1 - src/plugins/template/wizard/maindialog.cpp | 3 -- src/services/project/projectinfo.h | 44 +++++++++---------- src/services/project/projectservice.h | 6 --- 4 files changed, 20 insertions(+), 34 deletions(-) diff --git a/src/plugins/cxx/cmake/project/mainframe/cmakeprojectgenerator.cpp b/src/plugins/cxx/cmake/project/mainframe/cmakeprojectgenerator.cpp index 434b8c8f0..e2de6e220 100644 --- a/src/plugins/cxx/cmake/project/mainframe/cmakeprojectgenerator.cpp +++ b/src/plugins/cxx/cmake/project/mainframe/cmakeprojectgenerator.cpp @@ -387,7 +387,6 @@ void CmakeProjectGenerator::doBuildCmdExecuteEnd(const BuildCommandInfo &info, i } else { createRootItem(d->configureProjectInfo); } - emit projectService->projectConfigureDone(QString()); } void CmakeProjectGenerator::runCMake(QStandardItem *root, const QPair &files) diff --git a/src/plugins/template/wizard/maindialog.cpp b/src/plugins/template/wizard/maindialog.cpp index f41e87681..9f5e2597a 100644 --- a/src/plugins/template/wizard/maindialog.cpp +++ b/src/plugins/template/wizard/maindialog.cpp @@ -89,7 +89,6 @@ void MainDialog::setupUI(TemplateVector &templateVec) QStandardItem * rootItem = StandardModel->invisibleRootItem(); auto iterTpl = templateVec.begin(); - DStandardItem *tpl = new DStandardItem(iterTpl->category); QVector tplVec = iterTpl->templateVec; for (auto iterCate = tplVec.begin(); iterCate != tplVec.end(); ++iterCate) { @@ -120,7 +119,6 @@ void MainDialog::setupUI(TemplateVector &templateVec) QStandardItem * rootItem = StandardModel->invisibleRootItem(); auto iterTpl = templateVec.begin(); - DStandardItem *tpl = new DStandardItem(iterTpl->category); QVector tplVec = iterTpl->templateVec; for (auto iterCate = tplVec.begin(); iterCate != tplVec.end(); ++iterCate) { @@ -151,7 +149,6 @@ void MainDialog::setupUI(TemplateVector &templateVec) QStandardItem * rootItem = StandardModel->invisibleRootItem(); auto iterTpl = templateVec.begin() +1 ; - DStandardItem *tpl = new DStandardItem(iterTpl->category); QVector tplVec = iterTpl->templateVec; for (auto iterCate = tplVec.begin(); iterCate != tplVec.end(); ++iterCate) { diff --git a/src/services/project/projectinfo.h b/src/services/project/projectinfo.h index 38df42c50..66feb4cac 100644 --- a/src/services/project/projectinfo.h +++ b/src/services/project/projectinfo.h @@ -24,47 +24,43 @@ class ProjectInfo ProjectInfo() : data({}) {} ProjectInfo(const ProjectInfo &other) {data = other.data;} - bool operator == (const ProjectInfo &other) const {return data == other.data;} - bool isEmpty() const {return data.isEmpty();} - inline bool hasKey(const QString &key) {return data.keys().contains(key);} - - inline void setProperty(const QString &key, QVariant value) {data[key] = value;} - inline QVariant property(const QString &key) const {return data[key];} - inline void setLanguage(const QString &language) {data["Language"] = language;} - inline void setKitName(const QString &kitName) {data["KitName"] = kitName;} - inline void setBuildFolder(const QString &buildPath) {data["BuildFolder"] = buildPath;} - inline void setWorkspaceFolder(const QString &workspaceFolder) {data["WorkspaceFolder"] = workspaceFolder;} - inline void setBuildType(const QString &buildType) {data["BuildType"] = buildType;} - inline void setBuildProgram(const QString &program) {data["BuildProgram"] = program;} - inline void setConfigCustomArgs(const QStringList &args) {data["ConfigCustomArgs"] = args;} - inline void setSourceFiles(const QSet &files) {data["SourceFiles"] = QVariant::fromValue(files);} - inline void setDetailInformation(bool isDetail) {data["DetailInformation"] = isDetail;} - - inline void setBuildCustomArgs(const QStringList &args) {data["BuildCustomArgs"] = args;} - inline void setCleanCustomArgs(const QStringList &args) {data["CleanCustomArgs"] = args;} - inline void setRunProgram(const QString &program) {data["RunProgram"] = program;} - inline void setRunCustomArgs(const QStringList &args) {data["RunCustomArgs"] = args;} - inline void setRunWorkspaceDir(const QString &workspaceDir) {data["RunWorkspaceDir"] = workspaceDir;} - inline void setRunEnvironment(const QStringList &envs) {data["RunEnvironment"] = envs;} - inline QString language() const {return data["Language"].toString();} + inline void setKitName(const QString &kitName) {data["KitName"] = kitName;} inline QString kitName() const {return data["KitName"].toString();} + inline void setBuildFolder(const QString &buildPath) {data["BuildFolder"] = buildPath;} inline QString buildFolder() const {return data["BuildFolder"].toString();} + inline void setWorkspaceFolder(const QString &workspaceFolder) {data["WorkspaceFolder"] = workspaceFolder;} inline QString workspaceFolder() const {return data["WorkspaceFolder"].toString();} + inline void setBuildType(const QString &buildType) {data["BuildType"] = buildType;} inline QString buildType() const {return data["BuildType"].toString();} + inline void setBuildProgram(const QString &program) {data["BuildProgram"] = program;} inline QString buildProgram() const {return data["BuildProgram"].toString();} + inline void setConfigCustomArgs(const QStringList &args) {data["ConfigCustomArgs"] = args;} inline QStringList configCustomArgs() const {return data["ConfigCustomArgs"].toStringList();} + inline void setSourceFiles(const QSet &files) {data["SourceFiles"] = QVariant::fromValue(files);} inline QSet sourceFiles() const {return qvariant_cast>(data["SourceFiles"]);} + inline void setDetailInformation(bool isDetail) {data["DetailInformation"] = isDetail;} inline bool detailInformation() const {return data["DetailInformation"].toBool();} - + inline void setBuildCustomArgs(const QStringList &args) {data["BuildCustomArgs"] = args;} inline QStringList buildCustomArgs() const {return data["BuildCustomArgs"].toStringList();} + inline void setCleanCustomArgs(const QStringList &args) {data["CleanCustomArgs"] = args;} inline QStringList cleanCustomArgs() const {return data["CleanCustomArgs"].toStringList();} + inline void setRunProgram(const QString &program) {data["RunProgram"] = program;} inline QString runProgram() const {return data["RunProgram"].toString();} + inline void setRunCustomArgs(const QStringList &args) {data["RunCustomArgs"] = args;} inline QStringList runCustomArgs() const {return data["RunCustomArgs"].toStringList();} + inline void setRunWorkspaceDir(const QString &workspaceDir) {data["RunWorkspaceDir"] = workspaceDir;} inline QString runWorkspaceDir() const {return data["RunWorkspaceDir"].toString();} + inline void setRunEnvironment(const QStringList &envs) {data["RunEnvironment"] = envs;} inline QStringList runEnvironment() const {return data["RunEnvironment"].toStringList();} + bool operator == (const ProjectInfo &other) const {return data == other.data;} + bool isEmpty() const {return data.isEmpty();} + inline bool hasKey(const QString &key) {return data.keys().contains(key);} + inline void setProperty(const QString &key, QVariant value) {data[key] = value;} + inline QVariant property(const QString &key) const {return data[key];} + inline static void set(QStandardItem *root, const ProjectInfo &info) { if (root) diff --git a/src/services/project/projectservice.h b/src/services/project/projectservice.h index b820a442c..204262da4 100644 --- a/src/services/project/projectservice.h +++ b/src/services/project/projectservice.h @@ -171,12 +171,6 @@ class ProjectService final : public dpf::PluginService, * \return Target */ DPF_INTERFACE(Target, getActiveTarget, TargetType); - -Q_SIGNALS: - /*! - * \brief projectConfigureDone - */ - void projectConfigureDone(const QString &buildDirectory); }; /* MainWindow codeediter workspace title,