MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / handleEvents

Method handleEvents

src/plugins/debugger/runner/runner.cpp:108–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108void Runner::handleEvents(const dpf::Event &event)
109{
110 QString topic = event.topic();
111 QString data = event.data().toString();
112 if (topic == T_BUILDER) {
113 if (data == D_BUILD_STATE) {
114 int state = event.property(P_STATE).toInt();
115 BuildCommandInfo commandInfo = qvariant_cast<BuildCommandInfo>(event.property(P_ORIGINCMD));
116 if (commandInfo.uuid == d->currentBuildUuid) {
117 int buildSuccess = 0;
118 if (state == buildSuccess) {
119 running();
120 }
121 }
122 }
123 } else if (event.data() == editor.switchedFile.name) {
124 QString filePath = event.property(editor.switchedFile.pKeys[0]).toString();
125 if (d->currentOpenedFilePath != filePath) {
126 d->currentOpenedFilePath = filePath;
127 }
128 } else if (event.data() == editor.fileOpened.name) {
129 QString filePath = event.property(editor.switchedFile.pKeys[0]).toString();
130 d->currentOpenedFilePath = filePath;
131 } else if (event.data() == editor.fileClosed.name) {
132 QString filePath = event.property(editor.switchedFile.pKeys[0]).toString();
133 if (d->currentOpenedFilePath == filePath) {
134 d->currentOpenedFilePath.clear();
135 }
136 } else if (event.data() == project.activatedProject.name) {
137 QVariant proInfoVar = event.property("projectInfo");
138 dpfservice::ProjectInfo projectInfo = qvariant_cast<dpfservice::ProjectInfo>(proInfoVar);
139 auto programs = projectInfo.exePrograms();
140 d->runProgram->clear();
141 for (auto program : programs)
142 d->runProgram->addItem(QIcon::fromTheme("executable"), program);
143 d->runProgram->setCurrentText(projectInfo.currentProgram());
144 }
145}
146
147void Runner::running()
148{

Callers

nothing calls this directly

Calls 6

topicMethod · 0.80
toStringMethod · 0.45
dataMethod · 0.45
propertyMethod · 0.45
clearMethod · 0.45
addItemMethod · 0.45

Tested by

no test coverage detected