aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2023-11-10 15:00:12 +0100
committerhjk <hjk@qt.io>2023-11-10 14:49:18 +0000
commit812b3e2ee5bccc96937332e541043f339fc30a24 (patch)
tree3b0bcc4aed19fcab7f7ab1c322a796700a152f60
parentab8ba7f264aed3758ee52a1a1bb7bf4bd5a7060d (diff)
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>
-rw-r--r--src/plugins/macros/actionmacrohandler.cpp8
-rw-r--r--src/plugins/macros/actionmacrohandler.h8
-rw-r--r--src/plugins/macros/findmacrohandler.cpp6
-rw-r--r--src/plugins/macros/findmacrohandler.h11
-rw-r--r--src/plugins/macros/imacrohandler.h16
-rw-r--r--src/plugins/macros/texteditormacrohandler.cpp5
-rw-r--r--src/plugins/macros/texteditormacrohandler.h8
7 files changed, 24 insertions, 38 deletions
diff --git a/src/plugins/macros/actionmacrohandler.cpp b/src/plugins/macros/actionmacrohandler.cpp
index 0dc4fd9577..c6510171d8 100644
--- a/src/plugins/macros/actionmacrohandler.cpp
+++ b/src/plugins/macros/actionmacrohandler.cpp
@@ -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
diff --git a/src/plugins/macros/actionmacrohandler.h b/src/plugins/macros/actionmacrohandler.h
index 32bd1c7042..f8251f03b7 100644
--- a/src/plugins/macros/actionmacrohandler.h
+++ b/src/plugins/macros/actionmacrohandler.h
@@ -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
diff --git a/src/plugins/macros/findmacrohandler.cpp b/src/plugins/macros/findmacrohandler.cpp
index 878854e7b1..319a7cfc49 100644
--- a/src/plugins/macros/findmacrohandler.cpp
+++ b/src/plugins/macros/findmacrohandler.cpp
@@ -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
diff --git a/src/plugins/macros/findmacrohandler.h b/src/plugins/macros/findmacrohandler.h
index ef157051c7..32469ebd27 100644
--- a/src/plugins/macros/findmacrohandler.h
+++ b/src/plugins/macros/findmacrohandler.h
@@ -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 &macroEvent) override;
bool executeEvent(const MacroEvent &macroEvent) override;
@@ -36,5 +34,4 @@ private:
void changeEditor(Core::IEditor *editor);
};
-} // namespace Internal
-} // namespace Macros
+} // namespace Macros::Internal
diff --git a/src/plugins/macros/imacrohandler.h b/src/plugins/macros/imacrohandler.h
index 53eb744fc1..fcaf743cd1 100644
--- a/src/plugins/macros/imacrohandler.h
+++ b/src/plugins/macros/imacrohandler.h
@@ -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 &macroEvent) = 0;
virtual bool executeEvent(const MacroEvent &macroEvent) = 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
diff --git a/src/plugins/macros/texteditormacrohandler.cpp b/src/plugins/macros/texteditormacrohandler.cpp
index 1125b1e8cd..1147c02b0d 100644
--- a/src/plugins/macros/texteditormacrohandler.cpp
+++ b/src/plugins/macros/texteditormacrohandler.cpp
@@ -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
diff --git a/src/plugins/macros/texteditormacrohandler.h b/src/plugins/macros/texteditormacrohandler.h
index 57a9e1982b..60e742fb32 100644
--- a/src/plugins/macros/texteditormacrohandler.h
+++ b/src/plugins/macros/texteditormacrohandler.h
@@ -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