Commit b7869bf2 authored by Nicolas Fella's avatar Nicolas Fella

Add trailing commas to enums

We do this sometimes, but not consistenly.

The benefit is twofold.
First it improves the diff when adding new values since no existing line needs to be touched.
Second it prevents clang-format from collapsing the definition into a single line, which is undesired for large enums.
parent 7f5d8768
......@@ -43,7 +43,7 @@ class AppMenuApplet : public Plasma::Applet
public:
enum ViewType {
FullView,
CompactView
CompactView,
};
explicit AppMenuApplet(QObject *parent, const QVariantList &data);
......
......@@ -49,7 +49,7 @@ public:
enum AppMenuRole {
MenuRole = Qt::UserRole+1, // TODO this should be Qt::DisplayRole
ActionRole
ActionRole,
};
QVariant data(const QModelIndex &index, int role) const override;
......
......@@ -68,7 +68,7 @@ public:
CityRole,
CommentRole,
CheckedRole,
IsLocalTimeZoneRole
IsLocalTimeZoneRole,
};
int rowCount(const QModelIndex &parent) const override;
......
......@@ -41,7 +41,7 @@ enum {
HasActionListRole,
ActionListRole,
UrlRole,
DisabledRole
DisabledRole,
};
QVariantMap createActionItem(const QString &label, const QString &icon, const QString &actionId, const QVariant &argument = QVariant());
......
......@@ -35,7 +35,7 @@ class AppEntry : public AbstractEntry
NameOnly = 0,
GenericNameOnly,
NameAndGenericName,
GenericNameAndName
GenericNameAndName,
};
explicit AppEntry(AbstractModel *owner, KService::Ptr service, NameFormat nameFormat);
......
......@@ -35,7 +35,7 @@ class ContainmentInterface : public QObject
enum Target {
Desktop = 0,
Panel,
TaskManager
TaskManager,
};
Q_ENUM(Target)
......
......@@ -72,7 +72,7 @@ class RecentUsageModel : public ForwardingModel, public QQmlParserStatus
enum IncludeUsage {
AppsAndDocs,
OnlyApps,
OnlyDocs
OnlyDocs,
};
Q_ENUM(IncludeUsage)
......
......@@ -41,7 +41,7 @@ class SystemEntry : public QObject, public AbstractEntry
Suspend,
Hibernate,
Reboot,
Shutdown
Shutdown,
};
explicit SystemEntry(AbstractModel *owner, Action action);
......
......@@ -27,7 +27,7 @@ class SortedSystemTrayModel : public QSortFilterProxyModel {
public:
enum class SortingType {
ConfigurationPage,
SystemTray
SystemTray,
};
explicit SortedSystemTrayModel(SortingType sorting, QObject *parent = nullptr);
......
......@@ -51,7 +51,7 @@ public:
Category,
Status,
EffectiveStatus,
LastBaseRole
LastBaseRole,
};
explicit BaseModel(QPointer<SystemTraySettings> settings, QObject *parent = nullptr);
......@@ -81,7 +81,7 @@ class PlasmoidModel: public BaseModel
public:
enum class Role {
Applet = static_cast<int>(BaseModel::BaseRole::LastBaseRole) + 1,
HasApplet
HasApplet,
};
explicit PlasmoidModel(QPointer<SystemTraySettings> settings, QPointer<PlasmoidRegistry> plasmoidRegistry, QObject *parent = nullptr);
......@@ -134,7 +134,7 @@ public:
Title,
ToolTipSubTitle,
ToolTipTitle,
WindowId
WindowId,
};
StatusNotifierModel(QPointer<SystemTraySettings> settings, QObject* parent = nullptr);
......
......@@ -82,7 +82,7 @@ public:
LeftToRight,
RightToLeft,
TopToBottom,
BottomToTop
BottomToTop,
};
Q_ENUM(PreferredLayoutDirection)
......
......@@ -79,7 +79,7 @@ public:
Manual = AppletsLayout::EditModeCondition::Manual,
AfterPressAndHold = AppletsLayout::EditModeCondition::AfterPressAndHold,
AfterPress,
AfterMouseOver
AfterMouseOver,
};
Q_ENUMS(EditModeCondition)
......
......@@ -39,7 +39,7 @@ public:
Right,
BottomRight,
Bottom,
BottomLeft
BottomLeft,
};
Q_ENUMS(Corner)
......
......@@ -72,7 +72,7 @@ public:
VtNumber,
Session,
IsTty,
IconName //name of an icon
IconName, //name of an icon
};
bool canSwitchUser() const;
......
......@@ -57,7 +57,7 @@ public:
enum ConsoleMode {
PlasmaConsole,
KWinConsole
KWinConsole,
};
void setMode(const QString &mode);
......
......@@ -92,7 +92,7 @@ public:
enum Roles {
FilterTypeRole = Qt::UserRole+1,
FilterDataRole = Qt::UserRole+2,
SeparatorRole = Qt::UserRole+3
SeparatorRole = Qt::UserRole+3,
};
explicit DefaultFilterModel(QObject *parent = nullptr);
......
......@@ -80,7 +80,7 @@ public:
EmailRole = Qt::UserRole+9,
RunningRole = Qt::UserRole+10,
LocalRole = Qt::UserRole+11,
ScreenshotRole = Qt::UserRole+12
ScreenshotRole = Qt::UserRole+12,
};
explicit PlasmaAppletItemModel(QObject * parent = nullptr);
......
......@@ -59,7 +59,7 @@ class SwitchWindow : public Plasma::ContainmentActions
enum MenuMode {
AllFlat = 0,
DesktopSubmenus,
CurrentDesktop
CurrentDesktop,
};
QList<QAction *> m_actions;
......
......@@ -58,7 +58,7 @@ private:
enum class SolidReplyType {
Setup,
Teardown,
Eject
Eject,
};
void onSolidReply(SolidReplyType type, Solid::ErrorType error, const QVariant &errorData, const QString &udi);
......
......@@ -55,7 +55,7 @@ public:
/**
* The operation name is unknown
*/
UnknownOperation
UnknownOperation,
};
void start() override;
......
......@@ -53,14 +53,14 @@ public:
CanGoPrevious = 1 << 8,
// CanStop is not directly provided by the spec,
// but we infer it from PlaybackStatus and CanControl
CanStop = 1 << 9
CanStop = 1 << 9,
};
Q_DECLARE_FLAGS(Caps, Cap)
Caps capabilities() const { return m_caps; }
enum UpdateType {
FetchAll,
UpdatedSignal
UpdatedSignal,
};
void refresh();
......
......@@ -34,7 +34,7 @@ public:
PathRole,
SizeRole,
UsedRole,
AvailableRole
AvailableRole,
};
PlacesProxyModel(QObject* parent, KFilePlacesModel* model);
......
......@@ -40,13 +40,13 @@
enum State {
Idle = 0,
Mounting = 1,
Unmounting = 2
Unmounting = 2,
};
enum OperationResult {
Working = 0,
Successful = 1,
Unsuccessful =2
Unsuccessful =2,
};
/**
......
......@@ -59,7 +59,7 @@ public:
enum SchemeFilter {
AllSchemes,
LightSchemes,
DarkSchemes
DarkSchemes,
};
Q_ENUM(SchemeFilter)
......
......@@ -58,7 +58,7 @@ public:
ActiveTitleBarBackgroundRole,
ActiveTitleBarForegroundRole,
RemovableRole,
PendingDeletionRole
PendingDeletionRole,
};
int rowCount(const QModelIndex &parent) const override;
......
......@@ -52,7 +52,7 @@ class CursorTheme
// to define additional roles.
DisplayDetailRole = 0x24A3DAF8,
IsWritableRole,
PendingDeletionRole
PendingDeletionRole,
};
CursorTheme() {}
......
......@@ -35,7 +35,7 @@ public:
AllThemes,
LightThemes,
DarkThemes,
ThemesFollowingColors
ThemesFollowingColors,
};
Q_ENUM(ThemeFilter)
......
......@@ -51,13 +51,13 @@ public:
FollowsSystemColorsRole,
ColorTypeRole,
IsLocalRole,
PendingDeletionRole
PendingDeletionRole,
};
Q_ENUM(Roles)
enum ColorType {
LightTheme,
DarkTheme,
FollowsColorTheme
FollowsColorTheme,
};
Q_ENUM(ColorType)
......
......@@ -59,7 +59,7 @@ public:
Rgb,
Bgr,
Vrgb,
Vbgr
Vbgr,
};
SubPixel(Type t, QDomNode &n) : Item(n), type(t) {}
......@@ -94,7 +94,7 @@ public:
None,
Slight,
Medium,
Full
Full,
};
Hint(Style s, QDomNode &n) : Item(n), style(s) {}
......@@ -126,7 +126,7 @@ public:
enum State {
NotSet,
Enabled,
Disabled
Disabled,
};
AntiAliasing(State s, QDomNode &n) : Item(n), state(s) {}
......
......@@ -51,7 +51,7 @@ public:
ThemeNameRole = Qt::UserRole + 1,
DescriptionRole,
RemovableRole,
PendingDeletionRole
PendingDeletionRole,
};
int rowCount(const QModelIndex &parent) const override;
......
......@@ -62,7 +62,7 @@ public:
ThemeNameRole = Qt::UserRole + 1,
DescriptionRole,
RemovableRole,
PendingDeletionRole
PendingDeletionRole,
};
IconsSettings *iconsSettings() const;
......
......@@ -56,7 +56,7 @@ class KFONTINST_EXPORT FontInst : public QObject
STATUS_ALREADY_INSTALLED,
STATUS_NOT_FONT_FILE,
STATUS_PARTIAL_DELETE,
STATUS_NO_SYS_CONNECTION
STATUS_NO_SYS_CONNECTION,
};
enum EFolder
......@@ -64,13 +64,13 @@ class KFONTINST_EXPORT FontInst : public QObject
FOLDER_SYS,
FOLDER_USER,
FOLDER_COUNT
FOLDER_COUNT,
};
enum
{
SYS_MASK=0x01,
USR_MASK=0x02
USR_MASK=0x02,
};
static void registerTypes()
......
......@@ -38,7 +38,7 @@ enum EFileType
FILE_BITMAP,
FILE_SCALABLE,
FILE_AFM,
FILE_PFM
FILE_PFM,
};
extern bool isAAfm(const QString &fname);
......
......@@ -56,7 +56,7 @@ enum EDialogColumns
COL_TRASH,
COL_SIZE,
COL_DATE,
COL_LINK
COL_LINK,
};
CDuplicatesDialog::CDuplicatesDialog(QWidget *parent, CFontList *fl)
......@@ -205,7 +205,7 @@ enum EStatus
STATUS_NO_FILES,
STATUS_ALL_REMOVED,
STATUS_ERROR,
STATUS_USER_CANCELLED
STATUS_USER_CANCELLED,
};
void CDuplicatesDialog::slotButtonClicked(QAbstractButton *button)
......
......@@ -53,7 +53,7 @@ class CFontFilter : public QWidget
CRIT_LOCATION,
CRIT_WS,
NUM_CRIT
NUM_CRIT,
};
CFontFilter(QWidget *parent);
......
......@@ -65,7 +65,7 @@ enum EColumns
COL_FONT,
COL_STATUS,
NUM_COLS
NUM_COLS,
};
typedef QList<CFamilyItem *> CFamilyItemCont;
......@@ -83,7 +83,7 @@ class CFontList : public QAbstractItemModel
MSG_ADD,
MSG_DEL,
NUM_MSGS_TYPES
NUM_MSGS_TYPES,
};
public:
......@@ -188,7 +188,7 @@ class CFamilyItem : public CFontModelItem
{
ENABLED,
PARTIAL,
DISABLED
DISABLED,
};
CFamilyItem(CFontList &p, const Family &f, bool sys);
......
......@@ -57,7 +57,7 @@ enum EGroupColumns
{
COL_GROUP_NAME,
NUM_GROUP_COLS
NUM_GROUP_COLS,
};
CGroupListItem::CGroupListItem(const QString &name)
......
......@@ -54,7 +54,7 @@ class CGroupListItem
PERSONAL,
SYSTEM,
UNCLASSIFIED,
CUSTOM
CUSTOM,
};
union Data
......
......@@ -113,14 +113,14 @@ enum EPages
PAGE_SKIP,
PAGE_ERROR,
PAGE_CANCEL,
PAGE_COMPLETE
PAGE_COMPLETE,
};
enum Response
{
RESP_CONTINUE,
RESP_AUTO,
RESP_CANCEL
RESP_CANCEL,
};
static void addIcon(QGridLayout *layout, QFrame *page, const char *iconName, int iconSize)
......
......@@ -55,7 +55,7 @@ class CJobRunner : public QDialog
TYPE1_FONT,
TYPE1_AFM,
TYPE1_PFM,
OTHER_FONT
OTHER_FONT,
};
Item(const QUrl &u=QUrl(), const QString &n=QString(), bool dis=false);
......@@ -79,7 +79,7 @@ class CJobRunner : public QDialog
CMD_DISABLE,
CMD_UPDATE,
CMD_MOVE,
CMD_REMOVE_FILE
CMD_REMOVE_FILE,
};
explicit CJobRunner(QWidget *parent, int xid=0);
......
......@@ -46,7 +46,7 @@ class CKioFonts : public KIO::SlaveBase
FOLDER_USER,
FOLDER_SYS,
FOLDER_ROOT,
FOLDER_UNKNOWN
FOLDER_UNKNOWN,
};
CKioFonts(const QByteArray &pool, const QByteArray &app);
......
......@@ -78,7 +78,7 @@ namespace KFI
enum ESpecial
{
SPECIAL_RESCAN = 0,
SPECIAL_CONFIGURE
SPECIAL_CONFIGURE,
};
// UDS_EXTRA entries...
......@@ -86,7 +86,7 @@ enum EUdsExtraEntries
{
UDS_EXTRA_FC_STYLE = (((KIO::UDSEntry::UDS_EXTRA|KIO::UDSEntry::UDS_STRING)^KIO::UDSEntry::UDS_STRING)|KIO::UDSEntry::UDS_NUMBER)+1,
UDS_EXTRA_FILE_NAME = KIO::UDSEntry::UDS_EXTRA+2,
UDS_EXTRA_FILE_FACE = KIO::UDSEntry::UDS_EXTRA+3
UDS_EXTRA_FILE_FACE = KIO::UDSEntry::UDS_EXTRA+3,
};
}
......
......@@ -45,7 +45,7 @@ namespace Misc
enum EConstants
{
FILE_PERMS = 0644,
DIR_PERMS = 0755
DIR_PERMS = 0755,
};
struct TFont
......
......@@ -40,7 +40,7 @@ class CPreviewSelectAction : public KSelectAction
{
Basic,
BlocksAndScripts,
ScriptsOnly
ScriptsOnly,
};
explicit CPreviewSelectAction(QObject *parent, Mode mode=Basic);
......
......@@ -41,7 +41,7 @@ enum EUnicodeCategory
UNICODE_MODIFIER_SYMBOL,
UNICODE_OTHER_SYMBOL,
UNICODE_INVALID
UNICODE_INVALID,
};
struct TUnicodeCategory
......
......@@ -56,7 +56,7 @@ public:
HasPlasmaThemeRole,
HasCursorsRole,
HasWindowSwitcherRole,
HasDesktopSwitcherRole
HasDesktopSwitcherRole,
};
KCMLookandFeel(QObject* parent, const QVariantList& args);
......
......@@ -36,7 +36,7 @@ public:
enum Roles {
ThemeNameRole = Qt::UserRole + 1,
ThemePathRole
ThemePathRole,
};
void load();
......
......@@ -61,7 +61,7 @@ public:
NoText,
TextOnly,
TextBesideIcon,
TextUnderIcon
TextUnderIcon,
};
Q_ENUM(ToolBarStyle)
......