diff options
Diffstat (limited to 'src/plugins/beautifier/clangformat/clangformat.cpp')
-rw-r--r-- | src/plugins/beautifier/clangformat/clangformat.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/plugins/beautifier/clangformat/clangformat.cpp b/src/plugins/beautifier/clangformat/clangformat.cpp index d7a657bf3f..a0e3a2b3c4 100644 --- a/src/plugins/beautifier/clangformat/clangformat.cpp +++ b/src/plugins/beautifier/clangformat/clangformat.cpp @@ -40,7 +40,6 @@ #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/ieditor.h> #include <coreplugin/idocument.h> -#include <cppeditor/cppeditorconstants.h> #include <texteditor/formattexteditor.h> #include <texteditor/texteditor.h> #include <utils/algorithm.h> @@ -54,30 +53,27 @@ using namespace TextEditor; namespace Beautifier { namespace Internal { -namespace ClangFormat { ClangFormat::ClangFormat() { - Core::ActionContainer *menu = Core::ActionManager::createMenu(Constants::ClangFormat::MENU_ID); + Core::ActionContainer *menu = Core::ActionManager::createMenu("ClangFormat.Menu"); menu->menu()->setTitle(tr("&ClangFormat")); m_formatFile = new QAction(BeautifierPlugin::msgFormatCurrentFile(), this); Core::Command *cmd - = Core::ActionManager::registerAction(m_formatFile, - Constants::ClangFormat::ACTION_FORMATFILE); + = Core::ActionManager::registerAction(m_formatFile, "ClangFormat.FormatFile"); menu->addAction(cmd); connect(m_formatFile, &QAction::triggered, this, &ClangFormat::formatFile); m_formatRange = new QAction(BeautifierPlugin::msgFormatAtCursor(), this); - cmd = Core::ActionManager::registerAction(m_formatRange, - Constants::ClangFormat::ACTION_FORMATATCURSOR); + cmd = Core::ActionManager::registerAction(m_formatRange, "ClangFormat.FormatAtCursor"); menu->addAction(cmd); connect(m_formatRange, &QAction::triggered, this, &ClangFormat::formatAtCursor); m_disableFormattingSelectedText = new QAction(BeautifierPlugin::msgDisableFormattingSelectedText(), this); cmd = Core::ActionManager::registerAction( - m_disableFormattingSelectedText, Constants::ClangFormat::ACTION_DISABLEFORMATTINGSELECTED); + m_disableFormattingSelectedText, "ClangFormat.DisableFormattingSelectedText"); menu->addAction(cmd); connect(m_disableFormattingSelectedText, &QAction::triggered, this, &ClangFormat::disableFormattingSelectedText); @@ -90,7 +86,7 @@ ClangFormat::ClangFormat() QString ClangFormat::id() const { - return QLatin1String(Constants::ClangFormat::DISPLAY_NAME); + return QLatin1String(Constants::CLANGFORMAT_DISPLAY_NAME); } void ClangFormat::updateActions(Core::IEditor *editor) @@ -201,6 +197,5 @@ Command ClangFormat::command(int offset, int length) const return c; } -} // namespace ClangFormat } // namespace Internal } // namespace Beautifier |