From 5c46e329935e7038651fe87f2a765e6298c91bd4 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Sat, 14 Jan 2017 01:05:54 +0100 Subject: [PATCH] Q_ENUMS -> Q_ENUM and Q_FLAGS -> Q_FLAG REVIEW: 129826 --- src/declarativeimports/calendar/calendar.h | 3 +- .../calendar/calendardata.h | 3 +- src/declarativeimports/core/framesvgitem.h | 1 - .../plasmacomponents/enums.h | 6 ++-- src/plasma/framesvg.h | 2 +- src/plasma/plasma.h | 32 +++++++++---------- src/plasma/svg.h | 3 +- src/plasma/theme.h | 2 +- src/plasmaquick/dialog.h | 4 +-- 9 files changed, 27 insertions(+), 29 deletions(-) diff --git a/src/declarativeimports/calendar/calendar.h b/src/declarativeimports/calendar/calendar.h index e622fc546..b0bbc7e7f 100644 --- a/src/declarativeimports/calendar/calendar.h +++ b/src/declarativeimports/calendar/calendar.h @@ -119,7 +119,6 @@ class Calendar : public QObject */ Q_PROPERTY(QAbstractListModel *daysModel READ daysModel CONSTANT) - Q_ENUMS(Type DateMatchingPrecision) public: enum Type { @@ -128,6 +127,7 @@ public: Todo = 4, Journal = 8 }; + Q_ENUM(Type) Q_DECLARE_FLAGS(Types, Type) enum DateMatchingPrecision { @@ -135,6 +135,7 @@ public: MatchYearAndMonth, MatchYearMonthAndDay }; + Q_ENUM(DateMatchingPrecision) explicit Calendar(QObject *parent = 0); diff --git a/src/declarativeimports/calendar/calendardata.h b/src/declarativeimports/calendar/calendardata.h index b8ee7b933..860d22b16 100644 --- a/src/declarativeimports/calendar/calendardata.h +++ b/src/declarativeimports/calendar/calendardata.h @@ -37,8 +37,6 @@ class CalendarData : public QObject Q_PROPERTY(bool loading READ loading NOTIFY loadingChanged) // Q_PROPERTY(QAbstractItemModel* model READ model CONSTANT) - Q_ENUMS(Type) - public: enum Type { Holiday = 1, @@ -46,6 +44,7 @@ public: Todo = 4, Journal = 8 }; + Q_ENUM(Type) Q_DECLARE_FLAGS(Types, Type) explicit CalendarData(QObject *parent = 0); diff --git a/src/declarativeimports/core/framesvgitem.h b/src/declarativeimports/core/framesvgitem.h index df50742dc..e2a48e8e7 100644 --- a/src/declarativeimports/core/framesvgitem.h +++ b/src/declarativeimports/core/framesvgitem.h @@ -133,7 +133,6 @@ class FrameSvgItem : public QQuickItem */ Q_PROPERTY(QObject *fixedMargins READ fixedMargins CONSTANT) - Q_FLAGS(Plasma::FrameSvg::EnabledBorders) /** * The borders that will be rendered, it's a flag combination of: * NoBorder diff --git a/src/declarativeimports/plasmacomponents/enums.h b/src/declarativeimports/plasmacomponents/enums.h index c769067ac..4535a1add 100644 --- a/src/declarativeimports/plasmacomponents/enums.h +++ b/src/declarativeimports/plasmacomponents/enums.h @@ -25,7 +25,6 @@ class DialogStatus : public QObject { Q_OBJECT - Q_ENUMS(Status) public: enum Status { @@ -34,12 +33,12 @@ public: Closing, Closed }; + Q_ENUM(Status) }; class PageOrientation : public QObject { Q_OBJECT - Q_ENUMS(Orientation) public: enum Orientation { @@ -49,12 +48,12 @@ public: LockPrevious, Manual }; + Q_ENUM(Orientation) }; class PageStatus : public QObject { Q_OBJECT - Q_ENUMS(Status) public: enum Status { @@ -63,6 +62,7 @@ public: Active, Deactivating }; + Q_ENUM(Status) }; #endif // ENUMS_H diff --git a/src/plasma/framesvg.h b/src/plasma/framesvg.h index dbb6b50c9..139482acb 100644 --- a/src/plasma/framesvg.h +++ b/src/plasma/framesvg.h @@ -77,7 +77,6 @@ class PLASMA_EXPORT FrameSvg : public Svg { Q_OBJECT - Q_FLAGS(EnabledBorders) Q_PROPERTY(EnabledBorders enabledBorders READ enabledBorders WRITE setEnabledBorders) public: @@ -93,6 +92,7 @@ public: AllBorders = TopBorder | BottomBorder | LeftBorder | RightBorder }; Q_DECLARE_FLAGS(EnabledBorders, EnabledBorder) + Q_FLAG(EnabledBorders) /** * Constructs a new FrameSvg that paints the proper named subelements diff --git a/src/plasma/plasma.h b/src/plasma/plasma.h index 523e32915..92da3ca1d 100644 --- a/src/plasma/plasma.h +++ b/src/plasma/plasma.h @@ -61,7 +61,7 @@ public: AllConstraints = FormFactorConstraint | LocationConstraint | ScreenConstraint | ImmutableConstraint }; - Q_ENUMS(Constraint) + Q_ENUM(Constraint) Q_DECLARE_FLAGS(Constraints, Constraint) /** @@ -87,7 +87,7 @@ public: Application /**< The Applet lives in a plane and should be optimized to look as a full application, for the desktop or the particular device. */ }; - Q_ENUMS(FormFactor) + Q_ENUM(FormFactor) /** * This enumeration describes the type of the Containment. @@ -103,7 +103,7 @@ public: CustomPanelContainment = 128, /**< A customized desktop panel */ CustomEmbeddedContainment = 129 /**< A customized containment embedded in another applet */ }; - Q_ENUMS(ContainmentType) + Q_ENUM(ContainmentType) /** * A descriptrive type for QActions, to help categorizing them when presented to the user @@ -116,7 +116,7 @@ public: DestructiveAction = 400, /** A dangerous action, such as deletion of objects, plasmoids and files. They are intended to be shown separed from other actions */ UserAction = DestructiveAction + 1000 /** If new types are needed in a C++ implementation, define them as ids more than UserAction*/ }; - Q_ENUMS(ActionType) + Q_ENUM(ActionType) /** * The Direction enumeration describes in which direction, relative to the @@ -130,7 +130,7 @@ public: Left, /**< Display to the left */ Right /**< Display to the right */ }; - Q_ENUMS(Direction) + Q_ENUM(Direction) /** * The Location enumeration describes where on screen an element, such as an @@ -147,7 +147,7 @@ public: LeftEdge, /**< Along the left side of the screen */ RightEdge /**< Along the right side of the screen */ }; - Q_ENUMS(Location) + Q_ENUM(Location) /** * The position enumeration @@ -160,7 +160,7 @@ public: BottomPositioned, /**< Positioned bottom */ CenterPositioned /**< Positioned in the center */ }; - Q_ENUMS(Position) + Q_ENUM(Position) /** * The popup position enumeration relatively to his attached widget @@ -185,7 +185,7 @@ public: RightPosedBottomAlignedPopup /**< Popup positioned on the right, aligned to the bottom of the widget */ }; - Q_ENUMS(PopupPlacement) + Q_ENUM(PopupPlacement) /** * Flip enumeration @@ -195,7 +195,7 @@ public: HorizontalFlip = 1, /**< Flip horizontally */ VerticalFlip = 2 /**< Flip vertically */ }; - Q_ENUMS(FlipDirection) + Q_ENUM(FlipDirection) Q_DECLARE_FLAGS(Flip, FlipDirection) /** @@ -206,7 +206,7 @@ public: AlignToMinute, /**< Align to the minute **/ AlignToHour /**< Align to the hour **/ }; - Q_ENUMS(IntervalAlignment) + Q_ENUM(IntervalAlignment) /** * Defines the immutability of items like applets, corona and containments @@ -220,7 +220,7 @@ public: SystemImmutable = 4 /**< the item is locked down by the system, the user can't unlock it **/ }; - Q_ENUMS(ImmutabilityType) + Q_ENUM(ImmutabilityType) /** * The ComonentType enumeration refers to the various types of components, @@ -233,7 +233,7 @@ public: WallpaperComponent = 8, /**< Plasma::Wallpaper based plugins **/ GenericComponent = 16 /** Generic repositories of files, usually they keep QML files and their assets **/ }; - Q_ENUMS(ComponentType) + Q_ENUM(ComponentType) Q_DECLARE_FLAGS(ComponentTypes, ComponentType) enum MarginEdge { @@ -242,7 +242,7 @@ public: LeftMargin, /**< The left margin **/ RightMargin /**< The right margin **/ }; - Q_ENUMS(MarginEdge) + Q_ENUM(MarginEdge) /** * Status of an applet @@ -257,7 +257,7 @@ public: AcceptingInputStatus = 5, /**< The Item is accepting input **/ HiddenStatus = 6 /**< The Item will be hidden totally **/ }; - Q_ENUMS(ItemStatus) + Q_ENUM(ItemStatus) enum TrustLevel { UnverifiableTrust = 0, /**< The trust of the object can not be verified, usually because no @@ -270,7 +270,7 @@ public: FullyTrusted, /**< The signature is valid and made with a key signed by the vendor's key*/ UltimatelyTrusted /**< The signature is valid and made with the vendor's key*/ }; - Q_ENUMS(TrustLevel) + Q_ENUM(TrustLevel) /** * Description on how draw a background for the applet @@ -281,7 +281,7 @@ public: TranslucentBackground = 2, /**< An alternate version of the background is drawn, usually more translucent */ DefaultBackground = StandardBackground /**< Default settings: both standard background */ }; - Q_ENUMS(BackgroundHints) + Q_ENUM(BackgroundHints) private: Types(QObject *parent = 0); diff --git a/src/plasma/svg.h b/src/plasma/svg.h index 9cbcc390e..86ddede60 100644 --- a/src/plasma/svg.h +++ b/src/plasma/svg.h @@ -56,7 +56,6 @@ class SvgPrivate; class PLASMA_EXPORT Svg : public QObject { Q_OBJECT - Q_ENUMS(ContentType) Q_PROPERTY(QSize size READ size WRITE resize NOTIFY sizeChanged) Q_PROPERTY(bool multipleImages READ containsMultipleImages WRITE setContainsMultipleImages) Q_PROPERTY(QString imagePath READ imagePath WRITE setImagePath NOTIFY imagePathChanged) @@ -70,7 +69,7 @@ public: Normal = 0, Selected }; - Q_ENUMS(Status) + Q_ENUM(Status) /** * Constructs an SVG object that implicitly shares and caches rendering. diff --git a/src/plasma/theme.h b/src/plasma/theme.h index 5b4e849ba..2781b39d2 100644 --- a/src/plasma/theme.h +++ b/src/plasma/theme.h @@ -87,7 +87,7 @@ public: ViewColorGroup = 2, ComplementaryColorGroup = 3 }; - Q_ENUMS(ColorGroup) + Q_ENUM(ColorGroup) /** * Default constructor. It will be the global theme configured in plasmarc diff --git a/src/plasmaquick/dialog.h b/src/plasmaquick/dialog.h index fdb33b583..e86a4902b 100644 --- a/src/plasmaquick/dialog.h +++ b/src/plasmaquick/dialog.h @@ -159,13 +159,13 @@ public: Notification = NET::Notification, OnScreenDisplay = NET::OnScreenDisplay }; - Q_ENUMS(WindowType) + Q_ENUM(WindowType) enum BackgroundHints { NoBackground = 0, /**< Not drawing a background under the applet, the dialog has its own implementation */ StandardBackground = 1 /**< The standard background from the theme is drawn */ }; - Q_ENUMS(BackgroundHints) + Q_ENUM(BackgroundHints) Dialog(QQuickItem *parent = 0); ~Dialog();