forked from qt-creator/qt-creator
EditorManager: Use static pattern, adjust surrounding code
Change-Id: I3255a0150cd9a730336456c5a9f986eb74fefbff Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -60,8 +60,7 @@ static const quint8 RESET = 5;
|
||||
FindMacroHandler::FindMacroHandler():
|
||||
IMacroHandler()
|
||||
{
|
||||
const Core::EditorManager *editorManager = Core::EditorManager::instance();
|
||||
connect(editorManager, SIGNAL(currentEditorChanged(Core::IEditor*)),
|
||||
connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)),
|
||||
this, SLOT(changeEditor(Core::IEditor*)));
|
||||
}
|
||||
|
||||
|
||||
@@ -290,7 +290,7 @@ void MacroManager::startMacro()
|
||||
QString executeShortcut = Core::ActionManager::command(Constants::EXECUTE_LAST_MACRO)->defaultKeySequence().toString();
|
||||
QString help = tr("Macro mode. Type \"%1\" to stop recording and \"%2\" to play it")
|
||||
.arg(endShortcut).arg(executeShortcut);
|
||||
Core::EditorManager::instance()->showEditorStatusBar(
|
||||
Core::EditorManager::showEditorStatusBar(
|
||||
QLatin1String(Constants::M_STATUS_BUFFER),
|
||||
help,
|
||||
tr("Stop Recording Macro"), this, SLOT(endMacro()));
|
||||
@@ -298,7 +298,7 @@ void MacroManager::startMacro()
|
||||
|
||||
void MacroManager::endMacro()
|
||||
{
|
||||
Core::EditorManager::instance()->hideEditorStatusBar(QLatin1String(Constants::M_STATUS_BUFFER));
|
||||
Core::EditorManager::hideEditorStatusBar(QLatin1String(Constants::M_STATUS_BUFFER));
|
||||
|
||||
Core::ActionManager::command(Constants::START_MACRO)->action()->setEnabled(true);
|
||||
Core::ActionManager::command(Constants::END_MACRO)->action()->setEnabled(false);
|
||||
|
||||
@@ -61,7 +61,7 @@ static quint8 COUNT = 5;
|
||||
TextEditorMacroHandler::TextEditorMacroHandler():
|
||||
IMacroHandler()
|
||||
{
|
||||
const Core::EditorManager *editorManager = Core::EditorManager::instance();
|
||||
const QObject *editorManager = Core::EditorManager::instance();
|
||||
connect(editorManager, SIGNAL(currentEditorChanged(Core::IEditor*)),
|
||||
this, SLOT(changeEditor(Core::IEditor*)));
|
||||
connect(editorManager, SIGNAL(editorAboutToClose(Core::IEditor*)),
|
||||
|
||||
Reference in New Issue
Block a user