Skip to content

Commit

Permalink
refactor: [service] move code to java plugin
Browse files Browse the repository at this point in the history
Log:
Change-Id: I4bab8d163855f097eed515d509779ec9d868bab4
  • Loading branch information
deepin-mozart committed Jan 26, 2024
1 parent 40070e5 commit 86c253a
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/plugins/java/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ set(CXX_H
maven/project/mavenprojectgenerator.h
maven/project/properties/mavenconfigpropertywidget.h
maven/project/properties/mavenconfigutil.h
maven/project/projectactioninfo.h
maven/option/mavenwidget.h
maven/option/mavenoptionwidget.h
maven/option/optionmavengenerator.h
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/java/maven/project/mavenasynparse.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define MAVENASYNPARSE_H

#include "services/project/projectinfo.h"
#include "projectactioninfo.h"
#include "common/common.h"

#include <QFileSystemWatcher>
Expand All @@ -24,7 +25,7 @@ class MavenAsynParse : public QFileSystemWatcher
virtual ~MavenAsynParse();

signals:
void parsedActions(const dpfservice::ProjectActionInfos &info);
void parsedActions(const ProjectActionInfos &info);
void parsedError(const QString &info);
void itemsModified(const QList<QStandardItem*> &info);

Expand Down
6 changes: 3 additions & 3 deletions src/plugins/java/maven/project/mavenprojectgenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@ void MavenProjectGenerator::itemModified(const QList<QStandardItem *> &items)
}
}

void MavenProjectGenerator::doAddMavenMeue(const dpfservice::ProjectActionInfos &infos)
void MavenProjectGenerator::doAddMavenMeue(const ProjectActionInfos &infos)
{
if (d->mavenMenu) {
for (auto actionInfo : infos) {
QAction *action = new QAction(actionInfo.displyText, d->mavenMenu);
dpfservice::ProjectMenuActionInfo::set(action, actionInfo);
ProjectMenuActionInfo::set(action, actionInfo);
d->mavenMenu->addAction(action);
QObject::connect(action, &QAction::triggered,
this, &MavenProjectGenerator::doActionTriggered,
Expand All @@ -195,7 +195,7 @@ void MavenProjectGenerator::doActionTriggered()
{
QAction *action = qobject_cast<QAction*>(sender());
if (action) {
auto value = dpfservice::ProjectMenuActionInfo::get(action);
auto value = ProjectMenuActionInfo::get(action);

auto &ctx = dpfInstance.serviceContext();
auto builderService = ctx.service<dpfservice::BuilderService>(dpfservice::BuilderService::name());
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/java/maven/project/mavenprojectgenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MavenProjectGenerator : public dpfservice::ProjectGenerator
virtual QMenu* createItemMenu(const QStandardItem *item) override;
private slots:
void itemModified(const QList<QStandardItem*> &item);
void doAddMavenMeue(const dpfservice::ProjectActionInfos &infos);
void doAddMavenMeue(const ProjectActionInfos &infos);
void doActionTriggered();
void actionProperties(const dpfservice::ProjectInfo &info, QStandardItem *item);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#include <QString>
#include <QAction>

namespace dpfservice {

struct ProjectMenuActionInfo
{
QString displyText;
Expand Down Expand Up @@ -45,8 +43,6 @@ struct ProjectMenuActionInfo

typedef QList<ProjectMenuActionInfo> ProjectActionInfos;

} // namespace dpfservice

Q_DECLARE_METATYPE(dpfservice::ProjectMenuActionInfo);
Q_DECLARE_METATYPE(ProjectMenuActionInfo);

#endif // PROJECTACTIONINFO_H
1 change: 0 additions & 1 deletion src/services/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ set(CXX_H
window/windowcontroller.h
debugger/debuggerservice.h
# container/containerservice.h
project/projectactioninfo.h
project/projectviewinterface.h
project/projectinfo.h
project/projectgenerator.h
Expand Down
2 changes: 0 additions & 2 deletions src/services/project/projectinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#ifndef PROJECTINFO_H
#define PROJECTINFO_H

#include "projectactioninfo.h"

#include <QSet>
#include <QVariantHash>
#include <QStandardItem>
Expand Down

0 comments on commit 86c253a

Please sign in to comment.