From 6fed7c662ee6a569b7b78fc69dfcb194ac3d4df1 Mon Sep 17 00:00:00 2001 From: Tobias Hunger <tobias.hunger@nokia.com> Date: Fri, 13 Aug 2010 12:53:36 +0200 Subject: [PATCH] Replace some struct with classes * Fixes warnings about struct/class mixup in windows Reviewed-by: thorbjorn --- src/plugins/texteditor/basetexteditor.h | 10 +++++----- src/plugins/texteditor/behaviorsettings.h | 3 ++- src/plugins/texteditor/behaviorsettingspage.h | 9 +++++---- src/plugins/texteditor/completionsettings.h | 3 ++- src/plugins/texteditor/completionsupport.h | 2 +- src/plugins/texteditor/completionwidget.h | 2 +- src/plugins/texteditor/displaysettings.h | 3 ++- src/plugins/texteditor/displaysettingspage.h | 5 +++-- .../texteditor/generichighlighter/highlighter.h | 2 +- src/plugins/texteditor/icompletioncollector.h | 5 +++-- src/plugins/texteditor/indenter.h | 2 +- src/plugins/texteditor/storagesettings.h | 3 ++- src/plugins/texteditor/tabsettings.h | 3 ++- src/plugins/texteditor/texteditorsettings.h | 10 +++++----- 14 files changed, 35 insertions(+), 27 deletions(-) diff --git a/src/plugins/texteditor/basetexteditor.h b/src/plugins/texteditor/basetexteditor.h index 2aa8f39f31e..afa439ed9fd 100644 --- a/src/plugins/texteditor/basetexteditor.h +++ b/src/plugins/texteditor/basetexteditor.h @@ -47,7 +47,7 @@ namespace Utils { } namespace TextEditor { -struct TabSettings; +class TabSettings; namespace Internal { class BaseTextEditorPrivate; @@ -85,10 +85,10 @@ class ITextMarkable; class BaseTextDocument; class BaseTextEditorEditable; class FontSettings; -struct BehaviorSettings; -struct CompletionSettings; -struct DisplaySettings; -struct StorageSettings; +class BehaviorSettings; +class CompletionSettings; +class DisplaySettings; +class StorageSettings; class TEXTEDITOR_EXPORT BaseTextEditorAnimator : public QObject { diff --git a/src/plugins/texteditor/behaviorsettings.h b/src/plugins/texteditor/behaviorsettings.h index dcb92693136..156525e3f43 100644 --- a/src/plugins/texteditor/behaviorsettings.h +++ b/src/plugins/texteditor/behaviorsettings.h @@ -42,8 +42,9 @@ namespace TextEditor { * Settings that describe how the text editor behaves. This does not include * the TabSettings and StorageSettings. */ -struct TEXTEDITOR_EXPORT BehaviorSettings +class TEXTEDITOR_EXPORT BehaviorSettings { +public: BehaviorSettings(); void toSettings(const QString &category, QSettings *s) const; diff --git a/src/plugins/texteditor/behaviorsettingspage.h b/src/plugins/texteditor/behaviorsettingspage.h index 8d2040bc684..b973519ae60 100644 --- a/src/plugins/texteditor/behaviorsettingspage.h +++ b/src/plugins/texteditor/behaviorsettingspage.h @@ -36,12 +36,13 @@ namespace TextEditor { -struct TabSettings; -struct StorageSettings; -struct BehaviorSettings; +class TabSettings; +class StorageSettings; +class BehaviorSettings; -struct BehaviorSettingsPageParameters +class BehaviorSettingsPageParameters { +public: QString id; QString displayName; QString settingsPrefix; diff --git a/src/plugins/texteditor/completionsettings.h b/src/plugins/texteditor/completionsettings.h index dcec5cc4f1f..80796bb3897 100644 --- a/src/plugins/texteditor/completionsettings.h +++ b/src/plugins/texteditor/completionsettings.h @@ -53,8 +53,9 @@ enum CompletionTrigger { /** * Settings that describe how the code completion behaves. */ -struct TEXTEDITOR_EXPORT CompletionSettings +class TEXTEDITOR_EXPORT CompletionSettings { +public: CompletionSettings(); void toSettings(const QString &category, QSettings *s) const; diff --git a/src/plugins/texteditor/completionsupport.h b/src/plugins/texteditor/completionsupport.h index 6cf43cd6a91..ec83e49aed4 100644 --- a/src/plugins/texteditor/completionsupport.h +++ b/src/plugins/texteditor/completionsupport.h @@ -36,7 +36,7 @@ namespace TextEditor { -struct CompletionItem; +class CompletionItem; class ICompletionCollector; class ITextEditable; diff --git a/src/plugins/texteditor/completionwidget.h b/src/plugins/texteditor/completionwidget.h index abaf50f7f94..a550b3c1e23 100644 --- a/src/plugins/texteditor/completionwidget.h +++ b/src/plugins/texteditor/completionwidget.h @@ -36,7 +36,7 @@ namespace TextEditor { -struct CompletionItem; +class CompletionItem; class ITextEditable; namespace Internal { diff --git a/src/plugins/texteditor/displaysettings.h b/src/plugins/texteditor/displaysettings.h index 424a276e46a..0be9d9af849 100644 --- a/src/plugins/texteditor/displaysettings.h +++ b/src/plugins/texteditor/displaysettings.h @@ -38,8 +38,9 @@ QT_END_NAMESPACE namespace TextEditor { -struct TEXTEDITOR_EXPORT DisplaySettings +class TEXTEDITOR_EXPORT DisplaySettings { +public: DisplaySettings(); void toSettings(const QString &category, QSettings *s) const; diff --git a/src/plugins/texteditor/displaysettingspage.h b/src/plugins/texteditor/displaysettingspage.h index 2ba246a042a..dc43ee5a683 100644 --- a/src/plugins/texteditor/displaysettingspage.h +++ b/src/plugins/texteditor/displaysettingspage.h @@ -36,10 +36,11 @@ namespace TextEditor { -struct DisplaySettings; +class DisplaySettings; -struct DisplaySettingsPageParameters +class DisplaySettingsPageParameters { +public: QString id; QString displayName; QString settingsPrefix; diff --git a/src/plugins/texteditor/generichighlighter/highlighter.h b/src/plugins/texteditor/generichighlighter/highlighter.h index a7135982f21..f633eb93d3d 100644 --- a/src/plugins/texteditor/generichighlighter/highlighter.h +++ b/src/plugins/texteditor/generichighlighter/highlighter.h @@ -44,7 +44,7 @@ namespace TextEditor { -struct TabSettings; +class TabSettings; namespace Internal { diff --git a/src/plugins/texteditor/icompletioncollector.h b/src/plugins/texteditor/icompletioncollector.h index 7db7e9a9459..5ec3574326e 100644 --- a/src/plugins/texteditor/icompletioncollector.h +++ b/src/plugins/texteditor/icompletioncollector.h @@ -44,10 +44,11 @@ class ICompletionCollectorPrivate; class ICompletionCollector; class ITextEditable; -struct CompletionSettings; +class CompletionSettings; -struct CompletionItem +class CompletionItem { +public: CompletionItem(ICompletionCollector *collector = 0) : relevance(0), duplicateCount(0), diff --git a/src/plugins/texteditor/indenter.h b/src/plugins/texteditor/indenter.h index c6aff2ac7fe..51b2131b287 100644 --- a/src/plugins/texteditor/indenter.h +++ b/src/plugins/texteditor/indenter.h @@ -41,7 +41,7 @@ QT_END_NAMESPACE namespace TextEditor { -struct TabSettings; +class TabSettings; class TEXTEDITOR_EXPORT Indenter { diff --git a/src/plugins/texteditor/storagesettings.h b/src/plugins/texteditor/storagesettings.h index e3627eca58b..531e928a111 100644 --- a/src/plugins/texteditor/storagesettings.h +++ b/src/plugins/texteditor/storagesettings.h @@ -38,8 +38,9 @@ QT_END_NAMESPACE namespace TextEditor { -struct TEXTEDITOR_EXPORT StorageSettings +class TEXTEDITOR_EXPORT StorageSettings { +public: StorageSettings(); void toSettings(const QString &category, QSettings *s) const; diff --git a/src/plugins/texteditor/tabsettings.h b/src/plugins/texteditor/tabsettings.h index edccbbe1986..75ec461f0c1 100644 --- a/src/plugins/texteditor/tabsettings.h +++ b/src/plugins/texteditor/tabsettings.h @@ -42,8 +42,9 @@ namespace TextEditor { // Tab settings: Data type the GeneralSettingsPage acts on // with some convenience functions for formatting. -struct TEXTEDITOR_EXPORT TabSettings +class TEXTEDITOR_EXPORT TabSettings { +public: // This enum must match the indexes of tabKeyBehavior widget enum TabKeyBehavior { TabNeverIndents = 0, diff --git a/src/plugins/texteditor/texteditorsettings.h b/src/plugins/texteditor/texteditorsettings.h index 8e44d597181..737b68dd56d 100644 --- a/src/plugins/texteditor/texteditorsettings.h +++ b/src/plugins/texteditor/texteditorsettings.h @@ -38,11 +38,11 @@ namespace TextEditor { class BaseTextEditor; class FontSettings; -struct TabSettings; -struct StorageSettings; -struct BehaviorSettings; -struct DisplaySettings; -struct CompletionSettings; +class TabSettings; +class StorageSettings; +class BehaviorSettings; +class DisplaySettings; +class CompletionSettings; class HighlighterSettings; namespace Internal { -- GitLab