Skip to content

Commit

Permalink
refactor: remove unused code
Browse files Browse the repository at this point in the history
Log:
Change-Id: Ib3f02e308ac0bcbb6d51fc0c5c765ffceb2a0b89
  • Loading branch information
deepin-mozart committed Jan 16, 2024
1 parent 594a09a commit 0ea438f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<QString, QStringList> &files)
Expand Down
3 changes: 0 additions & 3 deletions src/plugins/template/wizard/maindialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ void MainDialog::setupUI(TemplateVector &templateVec)
QStandardItem * rootItem = StandardModel->invisibleRootItem();

auto iterTpl = templateVec.begin();
DStandardItem *tpl = new DStandardItem(iterTpl->category);

QVector<TemplateCategory> tplVec = iterTpl->templateVec;
for (auto iterCate = tplVec.begin(); iterCate != tplVec.end(); ++iterCate) {
Expand Down Expand Up @@ -120,7 +119,6 @@ void MainDialog::setupUI(TemplateVector &templateVec)
QStandardItem * rootItem = StandardModel->invisibleRootItem();

auto iterTpl = templateVec.begin();
DStandardItem *tpl = new DStandardItem(iterTpl->category);

QVector<TemplateCategory> tplVec = iterTpl->templateVec;
for (auto iterCate = tplVec.begin(); iterCate != tplVec.end(); ++iterCate) {
Expand Down Expand Up @@ -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<TemplateCategory> tplVec = iterTpl->templateVec;
for (auto iterCate = tplVec.begin(); iterCate != tplVec.end(); ++iterCate) {

Expand Down
44 changes: 20 additions & 24 deletions src/services/project/projectinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,47 +24,43 @@ class ProjectInfo
ProjectInfo() : data({}) {}
ProjectInfo(const ProjectInfo &other) {data = other.data;}

Check warning on line 25 in src/services/project/projectinfo.h

View workflow job for this annotation

GitHub Actions / cppcheck

When an object of a class is created, the constructors of all member variables are called consecutively in the order the variables are declared, even if you don't explicitly write them to the initialization list. You could avoid assigning 'data' a value by passing the value to the constructor in the initialization list.

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<QString> &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<QString> &files) {data["SourceFiles"] = QVariant::fromValue(files);}
inline QSet<QString> sourceFiles() const {return qvariant_cast<QSet<QString>>(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)
Expand Down
6 changes: 0 additions & 6 deletions src/services/project/projectservice.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0ea438f

Please sign in to comment.