Changeset View
Changeset View
Standalone View
Standalone View
debuggers/common/midebuggerplugin.cpp
Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Line(s) | |||||
164 | { | 164 | { | ||
165 | if (!m_drkonqi.isEmpty()) { | 165 | if (!m_drkonqi.isEmpty()) { | ||
166 | QDBusInterface drkonqiInterface(m_drkonqi, QStringLiteral("/MainApplication"), QStringLiteral("org.kde.KApplication")); | 166 | QDBusInterface drkonqiInterface(m_drkonqi, QStringLiteral("/MainApplication"), QStringLiteral("org.kde.KApplication")); | ||
167 | drkonqiInterface.call(QStringLiteral("quit")); | 167 | drkonqiInterface.call(QStringLiteral("quit")); | ||
168 | m_drkonqi.clear(); | 168 | m_drkonqi.clear(); | ||
169 | } | 169 | } | ||
170 | } | 170 | } | ||
171 | 171 | | |||
172 | ContextMenuExtension MIDebuggerPlugin::contextMenuExtension(Context* context) | 172 | ContextMenuExtension MIDebuggerPlugin::contextMenuExtension(Context* context, QWidget* parent) | ||
173 | { | 173 | { | ||
174 | ContextMenuExtension menuExt = IPlugin::contextMenuExtension(context); | 174 | ContextMenuExtension menuExt = IPlugin::contextMenuExtension(context, parent); | ||
175 | 175 | | |||
176 | if (context->type() != KDevelop::Context::EditorContext) | 176 | if (context->type() != KDevelop::Context::EditorContext) | ||
177 | return menuExt; | 177 | return menuExt; | ||
178 | 178 | | |||
179 | EditorContext *econtext = dynamic_cast<EditorContext*>(context); | 179 | EditorContext *econtext = dynamic_cast<EditorContext*>(context); | ||
180 | if (!econtext) | 180 | if (!econtext) | ||
181 | return menuExt; | 181 | return menuExt; | ||
182 | 182 | | |||
183 | QString contextIdent = econtext->currentWord(); | 183 | QString contextIdent = econtext->currentWord(); | ||
184 | 184 | | |||
185 | if (!contextIdent.isEmpty()) | 185 | if (!contextIdent.isEmpty()) | ||
186 | { | 186 | { | ||
187 | QString squeezed = KStringHandler::csqueeze(contextIdent, 30); | 187 | QString squeezed = KStringHandler::csqueeze(contextIdent, 30); | ||
188 | 188 | | |||
189 | QAction* action = new QAction(this); | 189 | QAction* action = new QAction(parent); | ||
190 | action->setText(i18n("Evaluate: %1", squeezed)); | 190 | action->setText(i18n("Evaluate: %1", squeezed)); | ||
191 | action->setWhatsThis(i18n("<b>Evaluate expression</b>" | 191 | action->setWhatsThis(i18n("<b>Evaluate expression</b>" | ||
192 | "<p>Shows the value of the expression under the cursor.</p>")); | 192 | "<p>Shows the value of the expression under the cursor.</p>")); | ||
193 | connect(action, &QAction::triggered, this, [this, contextIdent](){ | 193 | connect(action, &QAction::triggered, this, [this, contextIdent](){ | ||
194 | emit addWatchVariable(contextIdent); | 194 | emit addWatchVariable(contextIdent); | ||
195 | }); | 195 | }); | ||
196 | menuExt.addAction(ContextMenuExtension::DebugGroup, action); | 196 | menuExt.addAction(ContextMenuExtension::DebugGroup, action); | ||
197 | 197 | | |||
198 | action = new QAction(this); | 198 | action = new QAction(parent); | ||
199 | action->setText(i18n("Watch: %1", squeezed)); | 199 | action->setText(i18n("Watch: %1", squeezed)); | ||
200 | action->setWhatsThis(i18n("<b>Watch expression</b>" | 200 | action->setWhatsThis(i18n("<b>Watch expression</b>" | ||
201 | "<p>Adds the expression under the cursor to the Variables/Watch list.</p>")); | 201 | "<p>Adds the expression under the cursor to the Variables/Watch list.</p>")); | ||
202 | connect(action, &QAction::triggered, this, [this, contextIdent](){ | 202 | connect(action, &QAction::triggered, this, [this, contextIdent](){ | ||
203 | emit evaluateExpression(contextIdent); | 203 | emit evaluateExpression(contextIdent); | ||
204 | }); | 204 | }); | ||
205 | menuExt.addAction(ContextMenuExtension::DebugGroup, action); | 205 | menuExt.addAction(ContextMenuExtension::DebugGroup, action); | ||
206 | } | 206 | } | ||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |