aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2023-06-08 16:23:06 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2023-06-09 07:27:38 +0000
commitd93d1743fd9197febc69d3b2801113830e8e47a8 (patch)
tree1bb28df86acb0f95bc2ef2db0897d212fef78068
parent2caf4efbb2fc49a86c553e249f3f67381c615fc2 (diff)
DiffEditor: Use nested using namespace declarations
Change-Id: Iaf695a7c95f4267b5480036dedfa0485b841ca6e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
-rw-r--r--src/plugins/diffeditor/diffeditor.cpp6
-rw-r--r--src/plugins/diffeditor/diffeditor.h6
-rw-r--r--src/plugins/diffeditor/diffeditordocument.cpp6
-rw-r--r--src/plugins/diffeditor/diffeditorfactory.cpp6
-rw-r--r--src/plugins/diffeditor/diffeditorfactory.h6
-rw-r--r--src/plugins/diffeditor/diffeditorplugin.cpp6
-rw-r--r--src/plugins/diffeditor/diffeditorplugin.h6
-rw-r--r--src/plugins/diffeditor/diffeditorwidgetcontroller.cpp7
-rw-r--r--src/plugins/diffeditor/diffview.cpp6
-rw-r--r--src/plugins/diffeditor/selectabletexteditorwidget.cpp6
-rw-r--r--src/plugins/diffeditor/selectabletexteditorwidget.h6
-rw-r--r--src/plugins/diffeditor/sidebysidediffeditorwidget.cpp6
-rw-r--r--src/plugins/diffeditor/unifieddiffeditorwidget.cpp6
-rw-r--r--src/plugins/git/gitclient.h1
14 files changed, 26 insertions, 54 deletions
diff --git a/src/plugins/diffeditor/diffeditor.cpp b/src/plugins/diffeditor/diffeditor.cpp
index 929c30c339..ddf91b4e1e 100644
--- a/src/plugins/diffeditor/diffeditor.cpp
+++ b/src/plugins/diffeditor/diffeditor.cpp
@@ -51,8 +51,7 @@ using namespace Core;
using namespace TextEditor;
using namespace Utils;
-namespace DiffEditor {
-namespace Internal {
+namespace DiffEditor::Internal {
class DescriptionEditorWidget : public TextEditorWidget
{
@@ -618,7 +617,6 @@ void DiffEditor::showDiffView(IDiffView *view)
setupView(view);
}
-} // namespace Internal
-} // namespace DiffEditor
+} // namespace DiffEditor::Internal
#include "diffeditor.moc"
diff --git a/src/plugins/diffeditor/diffeditor.h b/src/plugins/diffeditor/diffeditor.h
index 49922d323e..24f89d5503 100644
--- a/src/plugins/diffeditor/diffeditor.h
+++ b/src/plugins/diffeditor/diffeditor.h
@@ -18,9 +18,8 @@ QT_END_NAMESPACE
namespace TextEditor { class TextEditorWidget; }
-namespace DiffEditor {
+namespace DiffEditor::Internal {
-namespace Internal {
class DescriptionEditorWidget;
class DiffEditorDocument;
class IDiffView;
@@ -95,5 +94,4 @@ private:
bool m_showDescription = true;
};
-} // namespace Internal
-} // namespace DiffEditor
+} // namespace DiffEditor::Internal
diff --git a/src/plugins/diffeditor/diffeditordocument.cpp b/src/plugins/diffeditor/diffeditordocument.cpp
index 1d43064d60..ed89d69c4f 100644
--- a/src/plugins/diffeditor/diffeditordocument.cpp
+++ b/src/plugins/diffeditor/diffeditordocument.cpp
@@ -24,8 +24,7 @@
using namespace Core;
using namespace Utils;
-namespace DiffEditor {
-namespace Internal {
+namespace DiffEditor::Internal {
DiffEditorDocument::DiffEditorDocument() :
Core::BaseTextDocument()
@@ -388,5 +387,4 @@ void DiffEditorDocument::endReload(bool success)
emit reloadFinished(success);
}
-} // namespace Internal
-} // namespace DiffEditor
+} // namespace DiffEditor::Internal
diff --git a/src/plugins/diffeditor/diffeditorfactory.cpp b/src/plugins/diffeditor/diffeditorfactory.cpp
index a771fda53a..70537dd3f7 100644
--- a/src/plugins/diffeditor/diffeditorfactory.cpp
+++ b/src/plugins/diffeditor/diffeditorfactory.cpp
@@ -15,8 +15,7 @@ using namespace Core;
using namespace TextEditor;
using namespace Utils;
-namespace DiffEditor {
-namespace Internal {
+namespace DiffEditor::Internal {
DiffEditorFactory::DiffEditorFactory() :
descriptionHandler {
@@ -50,5 +49,4 @@ DiffEditorFactory::DiffEditorFactory() :
setEditorCreator([] { return new DiffEditor(new DiffEditorDocument); });
}
-} // namespace Internal
-} // namespace DiffEditor
+} // namespace DiffEditor::Internal
diff --git a/src/plugins/diffeditor/diffeditorfactory.h b/src/plugins/diffeditor/diffeditorfactory.h
index bebabb208a..e39f0fc46f 100644
--- a/src/plugins/diffeditor/diffeditorfactory.h
+++ b/src/plugins/diffeditor/diffeditorfactory.h
@@ -7,8 +7,7 @@
#include <texteditor/texteditoractionhandler.h>
-namespace DiffEditor {
-namespace Internal {
+namespace DiffEditor::Internal {
class DiffEditorFactory : public Core::IEditorFactory
{
@@ -22,5 +21,4 @@ private:
TextEditor::TextEditorActionHandler rightHandler;
};
-} // namespace Internal
-} // namespace DiffEditor
+} // namespace DiffEditor::Internal
diff --git a/src/plugins/diffeditor/diffeditorplugin.cpp b/src/plugins/diffeditor/diffeditorplugin.cpp
index 10ae3b76a2..3112170bc4 100644
--- a/src/plugins/diffeditor/diffeditorplugin.cpp
+++ b/src/plugins/diffeditor/diffeditorplugin.cpp
@@ -29,8 +29,7 @@ using namespace Core;
using namespace TextEditor;
using namespace Utils;
-namespace DiffEditor {
-namespace Internal {
+namespace DiffEditor::Internal {
class ReloadInput {
public:
@@ -535,8 +534,7 @@ void DiffEditorPlugin::initialize()
d = new DiffEditorPluginPrivate;
}
-} // namespace Internal
-} // namespace DiffEditor
+} // namespace DiffEditor::Internal
#ifdef WITH_TESTS
diff --git a/src/plugins/diffeditor/diffeditorplugin.h b/src/plugins/diffeditor/diffeditorplugin.h
index 17b6a2d430..9888628daa 100644
--- a/src/plugins/diffeditor/diffeditorplugin.h
+++ b/src/plugins/diffeditor/diffeditorplugin.h
@@ -6,8 +6,7 @@
#include <coreplugin/diffservice.h>
#include <extensionsystem/iplugin.h>
-namespace DiffEditor {
-namespace Internal {
+namespace DiffEditor::Internal {
class DiffEditorServiceImpl : public QObject, public Core::DiffService
{
@@ -46,5 +45,4 @@ private slots:
#endif // WITH_TESTS
};
-} // namespace Internal
-} // namespace DiffEditor
+} // namespace DiffEditor::Internal
diff --git a/src/plugins/diffeditor/diffeditorwidgetcontroller.cpp b/src/plugins/diffeditor/diffeditorwidgetcontroller.cpp
index 26d94b7367..0f3a57ee08 100644
--- a/src/plugins/diffeditor/diffeditorwidgetcontroller.cpp
+++ b/src/plugins/diffeditor/diffeditorwidgetcontroller.cpp
@@ -29,8 +29,7 @@ using namespace Core;
using namespace TextEditor;
using namespace Utils;
-namespace DiffEditor {
-namespace Internal {
+namespace DiffEditor::Internal {
DiffEditorWidgetController::DiffEditorWidgetController(QWidget *diffEditorWidget)
: QObject(diffEditorWidget)
@@ -330,6 +329,4 @@ DiffEditorInput::DiffEditorInput(DiffEditorWidgetController *controller)
, m_charFormat{&controller->m_charFormat[LeftSide], &controller->m_charFormat[RightSide]}
{ }
-
-} // namespace Internal
-} // namespace DiffEditor
+} // namespace DiffEditor::Internal
diff --git a/src/plugins/diffeditor/diffview.cpp b/src/plugins/diffeditor/diffview.cpp
index 686f9798b2..1b513aefc3 100644
--- a/src/plugins/diffeditor/diffview.cpp
+++ b/src/plugins/diffeditor/diffview.cpp
@@ -14,8 +14,7 @@
#include <QCoreApplication>
-namespace DiffEditor {
-namespace Internal {
+namespace DiffEditor::Internal {
IDiffView::IDiffView(QObject *parent) : QObject(parent)
{ }
@@ -230,5 +229,4 @@ void SideBySideView::setSync(bool sync)
m_widget->setHorizontalSync(sync);
}
-} // namespace Internal
-} // namespace DiffEditor
+} // namespace DiffEditor::Internal
diff --git a/src/plugins/diffeditor/selectabletexteditorwidget.cpp b/src/plugins/diffeditor/selectabletexteditorwidget.cpp
index bbf0480a6b..e0c95f6abd 100644
--- a/src/plugins/diffeditor/selectabletexteditorwidget.cpp
+++ b/src/plugins/diffeditor/selectabletexteditorwidget.cpp
@@ -13,8 +13,7 @@
using namespace TextEditor;
-namespace DiffEditor {
-namespace Internal {
+namespace DiffEditor::Internal {
SelectableTextEditorWidget::SelectableTextEditorWidget(Utils::Id id, QWidget *parent)
: TextEditorWidget(parent)
@@ -142,5 +141,4 @@ void SelectableTextEditorWidget::paintBlock(QPainter *painter,
TextEditorWidget::paintBlock(painter, block, offset, newSelections, clipRect);
}
-} // namespace Internal
-} // namespace DiffEditor
+} // namespace DiffEditor::Internal
diff --git a/src/plugins/diffeditor/selectabletexteditorwidget.h b/src/plugins/diffeditor/selectabletexteditorwidget.h
index ca128aa28e..4b0d465204 100644
--- a/src/plugins/diffeditor/selectabletexteditorwidget.h
+++ b/src/plugins/diffeditor/selectabletexteditorwidget.h
@@ -7,8 +7,7 @@
namespace TextEditor { class DisplaySettings; }
-namespace DiffEditor {
-namespace Internal {
+namespace DiffEditor::Internal {
class DiffSelection
{
@@ -46,5 +45,4 @@ private:
DiffSelections m_diffSelections;
};
-} // namespace Internal
-} // namespace DiffEditor
+} // namespace DiffEditor::Internal
diff --git a/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp b/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp
index ef8e250497..341edce733 100644
--- a/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp
+++ b/src/plugins/diffeditor/sidebysidediffeditorwidget.cpp
@@ -35,8 +35,7 @@ using namespace Utils;
using namespace std::placeholders;
-namespace DiffEditor {
-namespace Internal {
+namespace DiffEditor::Internal {
static DiffSide oppositeSide(DiffSide side)
{
@@ -1104,7 +1103,6 @@ void SideBySideDiffEditorWidget::syncCursor(SideDiffEditorWidget *source, SideDi
dest->horizontalScrollBar()->setValue(oldHSliderPos);
}
-} // namespace Internal
-} // namespace DiffEditor
+} // namespace DiffEditor::Internal
#include "sidebysidediffeditorwidget.moc"
diff --git a/src/plugins/diffeditor/unifieddiffeditorwidget.cpp b/src/plugins/diffeditor/unifieddiffeditorwidget.cpp
index 0c06c85bae..d5633d50ec 100644
--- a/src/plugins/diffeditor/unifieddiffeditorwidget.cpp
+++ b/src/plugins/diffeditor/unifieddiffeditorwidget.cpp
@@ -28,8 +28,7 @@ using namespace Core;
using namespace TextEditor;
using namespace Utils;
-namespace DiffEditor {
-namespace Internal {
+namespace DiffEditor::Internal {
UnifiedDiffEditorWidget::UnifiedDiffEditorWidget(QWidget *parent)
: SelectableTextEditorWidget("DiffEditor.UnifiedDiffEditor", parent)
@@ -589,5 +588,4 @@ void UnifiedDiffEditorWidget::setCurrentDiffFileIndex(int diffFileIndex)
verticalScrollBar()->setValue(blockNumber);
}
-} // namespace Internal
-} // namespace DiffEditor
+} // namespace DiffEditor::Internal
diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h
index 6e2878be02..3604eb9f3c 100644
--- a/src/plugins/git/gitclient.h
+++ b/src/plugins/git/gitclient.h
@@ -21,7 +21,6 @@
#include <QWidget>
QT_BEGIN_NAMESPACE
-class QProcessEnvironment;
class QMenu;
QT_END_NAMESPACE