forked from qt-creator/qt-creator
ClangTools: Fix warning
Change-Id: Ic02ff5905988f289fb16c53de9aaeed3dbd25376 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -155,8 +155,7 @@ void ClangToolsPlugin::registerAnalyzeActions()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add button to tool bar of C++ source files
|
// add button to tool bar of C++ source files
|
||||||
connect(EditorManager::instance(), &EditorManager::editorOpened, this,
|
connect(EditorManager::instance(), &EditorManager::editorOpened, this, [](IEditor *editor) {
|
||||||
[this](IEditor *editor) {
|
|
||||||
if (editor->document()->filePath().isEmpty()
|
if (editor->document()->filePath().isEmpty()
|
||||||
|| !Utils::mimeTypeForName(editor->document()->mimeType()).inherits("text/x-c++src"))
|
|| !Utils::mimeTypeForName(editor->document()->mimeType()).inherits("text/x-c++src"))
|
||||||
return;
|
return;
|
||||||
@@ -181,7 +180,7 @@ void ClangToolsPlugin::registerAnalyzeActions()
|
|||||||
Constants::RUN_CLAZY_ON_CURRENT_FILE)}) {
|
Constants::RUN_CLAZY_ON_CURRENT_FILE)}) {
|
||||||
ClangTool * const tool = toolInfo.first;
|
ClangTool * const tool = toolInfo.first;
|
||||||
Command * const cmd = ActionManager::command(toolInfo.second);
|
Command * const cmd = ActionManager::command(toolInfo.second);
|
||||||
QAction * const action = toolsMenu->addAction(tool->name(), [this, editor, tool] {
|
QAction *const action = toolsMenu->addAction(tool->name(), [editor, tool] {
|
||||||
tool->startTool(editor->document()->filePath());
|
tool->startTool(editor->document()->filePath());
|
||||||
});
|
});
|
||||||
cmd->augmentActionWithShortcutToolTip(action);
|
cmd->augmentActionWithShortcutToolTip(action);
|
||||||
|
Reference in New Issue
Block a user