forked from qt-creator/qt-creator
Macros: Remove Q_OBJECT macro from some classes that don't need it
Plus some code cosmetics. Change-Id: Ifa9c4e7322ae7a2d5c1480f7afc58f020efcbc1c Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -21,10 +21,9 @@
|
||||
using namespace Core;
|
||||
using namespace Utils;
|
||||
|
||||
namespace Macros {
|
||||
namespace Internal {
|
||||
namespace Macros::Internal {
|
||||
|
||||
static const char EVENTNAME[] = "Action";
|
||||
const char EVENTNAME[] = "Action";
|
||||
static quint8 ACTIONNAME = 0;
|
||||
|
||||
ActionMacroHandler::ActionMacroHandler()
|
||||
@@ -82,5 +81,4 @@ void ActionMacroHandler::addCommand(Id id)
|
||||
registerCommand(id);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Macros
|
||||
} // namespace Macros::Internal
|
||||
|
||||
@@ -9,13 +9,10 @@
|
||||
|
||||
#include <QSet>
|
||||
|
||||
namespace Macros {
|
||||
namespace Internal {
|
||||
namespace Macros::Internal {
|
||||
|
||||
class ActionMacroHandler : public IMacroHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ActionMacroHandler();
|
||||
|
||||
@@ -31,5 +28,4 @@ private:
|
||||
QSet<Utils::Id> m_commandIds;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Macros
|
||||
} // namespace Macros::Internal
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
|
||||
#include <aggregation/aggregate.h>
|
||||
|
||||
using namespace Macros;
|
||||
using namespace Macros::Internal;
|
||||
using namespace Utils;
|
||||
|
||||
namespace Macros::Internal {
|
||||
|
||||
static const char EVENTNAME[] = "Find";
|
||||
static const quint8 TYPE = 0;
|
||||
static const quint8 BEFORE = 1;
|
||||
@@ -202,3 +202,5 @@ void FindMacroHandler::startRecording(Macro* macro)
|
||||
if (current)
|
||||
changeEditor(current);
|
||||
}
|
||||
|
||||
} // namespace Macros::Internal
|
||||
|
||||
@@ -6,21 +6,19 @@
|
||||
#include "imacrohandler.h"
|
||||
|
||||
#include <coreplugin/find/textfindconstants.h>
|
||||
|
||||
#include <utils/filesearch.h>
|
||||
|
||||
namespace Core { class IEditor; }
|
||||
|
||||
namespace Macros {
|
||||
namespace Internal {
|
||||
namespace Macros::Internal {
|
||||
|
||||
class FindMacroHandler : public IMacroHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FindMacroHandler();
|
||||
|
||||
void startRecording(Macro* macro) override;
|
||||
void startRecording(Macro *macro) override;
|
||||
|
||||
bool canExecuteEvent(const MacroEvent ¯oEvent) override;
|
||||
bool executeEvent(const MacroEvent ¯oEvent) override;
|
||||
@@ -36,5 +34,4 @@ private:
|
||||
void changeEditor(Core::IEditor *editor);
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Macros
|
||||
} // namespace Macros::Internal
|
||||
|
||||
@@ -5,26 +5,23 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace Macros {
|
||||
namespace Internal {
|
||||
namespace Macros::Internal {
|
||||
|
||||
class Macro;
|
||||
class MacroEvent;
|
||||
class MacroManager;
|
||||
|
||||
class IMacroHandler: public QObject
|
||||
class IMacroHandler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
virtual void startRecording(Macro* macro);
|
||||
virtual void endRecordingMacro(Macro* macro);
|
||||
virtual void startRecording(Macro *macro);
|
||||
virtual void endRecordingMacro(Macro *macro);
|
||||
|
||||
virtual bool canExecuteEvent(const MacroEvent ¯oEvent) = 0;
|
||||
virtual bool executeEvent(const MacroEvent ¯oEvent) = 0;
|
||||
|
||||
protected:
|
||||
void addMacroEvent(const MacroEvent& event);
|
||||
void addMacroEvent(const MacroEvent &event);
|
||||
|
||||
void setCurrentMacro(Macro *macro);
|
||||
|
||||
@@ -36,5 +33,4 @@ private:
|
||||
Macro *m_currentMacro = nullptr;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Macros
|
||||
} // namespace Macros::Internal
|
||||
|
||||
@@ -18,8 +18,7 @@
|
||||
#include <QKeyEvent>
|
||||
#include <QApplication>
|
||||
|
||||
using namespace Macros;
|
||||
using namespace Macros::Internal;
|
||||
namespace Macros::Internal {
|
||||
|
||||
static const char KEYEVENTNAME[] = "TextEditorKey";
|
||||
static quint8 TEXT = 0;
|
||||
@@ -118,3 +117,5 @@ void TextEditorMacroHandler::closeEditor(Core::IEditor *editor)
|
||||
m_currentEditor->widget()->removeEventFilter(this);
|
||||
m_currentEditor = nullptr;
|
||||
}
|
||||
|
||||
} // namespace Macro::Internal
|
||||
|
||||
@@ -9,13 +9,10 @@ namespace Core { class IEditor; }
|
||||
|
||||
namespace TextEditor { class BaseTextEditor; }
|
||||
|
||||
namespace Macros {
|
||||
namespace Internal {
|
||||
namespace Macros::Internal {
|
||||
|
||||
class TextEditorMacroHandler : public IMacroHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TextEditorMacroHandler();
|
||||
|
||||
@@ -34,5 +31,4 @@ private:
|
||||
TextEditor::BaseTextEditor *m_currentEditor = nullptr;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Macros
|
||||
} // namespace Macros::Internal
|
||||
|
||||
Reference in New Issue
Block a user