Changeset View
Changeset View
Standalone View
Standalone View
languages/clang/clangsupport.cpp
Show First 20 Lines • Show All 283 Lines • ▼ Show 20 Line(s) | 275 | { | |||
---|---|---|---|---|---|
284 | 284 | | |||
285 | QAction* moveIntoSourceAction = actions.addAction(QStringLiteral("code_move_definition")); | 285 | QAction* moveIntoSourceAction = actions.addAction(QStringLiteral("code_move_definition")); | ||
286 | moveIntoSourceAction->setText(i18n("Move into Source")); | 286 | moveIntoSourceAction->setText(i18n("Move into Source")); | ||
287 | actions.setDefaultShortcut(moveIntoSourceAction, Qt::CTRL | Qt::ALT | Qt::Key_S); | 287 | actions.setDefaultShortcut(moveIntoSourceAction, Qt::CTRL | Qt::ALT | Qt::Key_S); | ||
288 | connect(moveIntoSourceAction, &QAction::triggered, | 288 | connect(moveIntoSourceAction, &QAction::triggered, | ||
289 | m_refactoring, &ClangRefactoring::executeMoveIntoSourceAction); | 289 | m_refactoring, &ClangRefactoring::executeMoveIntoSourceAction); | ||
290 | } | 290 | } | ||
291 | 291 | | |||
292 | KDevelop::ContextMenuExtension ClangSupport::contextMenuExtension(KDevelop::Context* context) | 292 | KDevelop::ContextMenuExtension ClangSupport::contextMenuExtension(KDevelop::Context* context, QWidget* parent) | ||
293 | { | 293 | { | ||
294 | ContextMenuExtension cm; | 294 | ContextMenuExtension cm; | ||
295 | EditorContext *ec = dynamic_cast<KDevelop::EditorContext *>(context); | 295 | EditorContext *ec = dynamic_cast<KDevelop::EditorContext *>(context); | ||
296 | 296 | | |||
297 | if (ec && ICore::self()->languageController()->languagesForUrl(ec->url()).contains(this)) { | 297 | if (ec && ICore::self()->languageController()->languagesForUrl(ec->url()).contains(this)) { | ||
298 | // It's a C++ file, let's add our context menu. | 298 | // It's a C++ file, let's add our context menu. | ||
299 | m_refactoring->fillContextMenu(cm, context); | 299 | m_refactoring->fillContextMenu(cm, context, parent); | ||
300 | } | 300 | } | ||
301 | return cm; | 301 | return cm; | ||
302 | } | 302 | } | ||
303 | 303 | | |||
304 | KTextEditor::Range ClangSupport::specialLanguageObjectRange(const QUrl &url, const KTextEditor::Cursor& position) | 304 | KTextEditor::Range ClangSupport::specialLanguageObjectRange(const QUrl &url, const KTextEditor::Cursor& position) | ||
305 | { | 305 | { | ||
306 | DUChainReadLocker lock; | 306 | DUChainReadLocker lock; | ||
307 | const QPair<TopDUContextPointer, Use> macroExpansion = macroExpansionForPosition(url, position); | 307 | const QPair<TopDUContextPointer, Use> macroExpansion = macroExpansionForPosition(url, position); | ||
▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines |