From 4a081cb386e31ec23667faf83750c97dd9362c64 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 9 Oct 2023 14:16:30 +0200 Subject: [PATCH] TextEditor: remove texteditor_p.h There is no need to have an extra file for one struct that is only used inside texteditor.cpp Change-Id: Iee8f7ce5e0d19da7b444660d81c350eb10b501ef Reviewed-by: hjk --- src/plugins/texteditor/CMakeLists.txt | 1 - src/plugins/texteditor/texteditor.cpp | 14 ++++++++++- src/plugins/texteditor/texteditor.qbs | 1 - src/plugins/texteditor/texteditor_p.h | 36 --------------------------- 4 files changed, 13 insertions(+), 39 deletions(-) delete mode 100644 src/plugins/texteditor/texteditor_p.h diff --git a/src/plugins/texteditor/CMakeLists.txt b/src/plugins/texteditor/CMakeLists.txt index 03efc189224..7d4577413bc 100644 --- a/src/plugins/texteditor/CMakeLists.txt +++ b/src/plugins/texteditor/CMakeLists.txt @@ -103,7 +103,6 @@ add_qtc_plugin(TextEditor texteditor.qrc texteditor_global.h texteditortr.h - texteditor_p.h texteditoractionhandler.cpp texteditoractionhandler.h texteditorconstants.cpp texteditorconstants.h texteditoroverlay.cpp texteditoroverlay.h diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 4905d745f9a..66efbcfda02 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -27,7 +27,6 @@ #include "tabsettings.h" #include "textdocument.h" #include "textdocumentlayout.h" -#include "texteditor_p.h" #include "texteditoractionhandler.h" #include "texteditorconstants.h" #include "texteditoroverlay.h" @@ -563,6 +562,19 @@ struct PaintEventBlockData struct ExtraAreaPaintEventData; +struct TextEditorPrivateHighlightBlocks +{ + QList open; + QList close; + QList visualIndent; + inline int count() const { return visualIndent.size(); } + inline bool isEmpty() const { return open.isEmpty() || close.isEmpty() || visualIndent.isEmpty(); } + inline bool operator==(const TextEditorPrivateHighlightBlocks &o) const { + return (open == o.open && close == o.close && visualIndent == o.visualIndent); + } + inline bool operator!=(const TextEditorPrivateHighlightBlocks &o) const { return !(*this == o); } +}; + class TextEditorWidgetPrivate : public QObject { public: diff --git a/src/plugins/texteditor/texteditor.qbs b/src/plugins/texteditor/texteditor.qbs index a041fbcaa66..0c25f5bf5c6 100644 --- a/src/plugins/texteditor/texteditor.qbs +++ b/src/plugins/texteditor/texteditor.qbs @@ -134,7 +134,6 @@ QtcPlugin { "texteditor.h", "texteditor.qrc", "texteditor_global.h", "texteditortr.h", - "texteditor_p.h", "texteditoractionhandler.cpp", "texteditoractionhandler.h", "texteditorconstants.cpp", diff --git a/src/plugins/texteditor/texteditor_p.h b/src/plugins/texteditor/texteditor_p.h deleted file mode 100644 index fa8232a0fb0..00000000000 --- a/src/plugins/texteditor/texteditor_p.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - - -#include "texteditor_global.h" - -#include -#include - -namespace TextEditor { - -class TextDocument; - -namespace Internal { - -// -// TextEditorPrivate -// - -struct TextEditorPrivateHighlightBlocks -{ - QList open; - QList close; - QList visualIndent; - inline int count() const { return visualIndent.size(); } - inline bool isEmpty() const { return open.isEmpty() || close.isEmpty() || visualIndent.isEmpty(); } - inline bool operator==(const TextEditorPrivateHighlightBlocks &o) const { - return (open == o.open && close == o.close && visualIndent == o.visualIndent); - } - inline bool operator!=(const TextEditorPrivateHighlightBlocks &o) const { return !(*this == o); } -}; - -} // namespace Internal -} // namespace TextEditor