Commit e5bfcf7a authored by Alexander Lohnau's avatar Alexander Lohnau 💬 Committed by Laurent Montel
Browse files

Add trailing comma to enums

parent 6a9380f0
......@@ -42,7 +42,13 @@
#include <QUuid>
#include <QVBoxLayout>
enum { Local = 0, Latin1 = 1, Uni = 2, MSBug = 3, Codec = 4 };
enum {
Local = 0,
Latin1 = 1,
Uni = 2,
MSBug = 3,
Codec = 4,
};
class ContactFieldComboBox : public QComboBox
{
......
......@@ -72,7 +72,13 @@ QCsvReader::~QCsvReader()
bool QCsvReader::read(QIODevice *device)
{
enum State { StartLine, QuotedField, QuotedFieldEnd, NormalField, EmptyField };
enum State {
StartLine,
QuotedField,
QuotedFieldEnd,
NormalField,
EmptyField,
};
int row, column;
......
......@@ -16,7 +16,15 @@ class VCardExportSelectionWidget : public QWidget
public:
explicit VCardExportSelectionWidget(QWidget *parent = nullptr);
~VCardExportSelectionWidget() override;
enum ExportField { None = 0, Private = 1, Business = 2, Other = 4, Encryption = 8, Picture = 16, DiplayName = 32 };
enum ExportField {
None = 0,
Private = 1,
Business = 2,
Other = 4,
Encryption = 8,
Picture = 16,
DiplayName = 32,
};
Q_ENUMS(ExportField)
Q_DECLARE_FLAGS(ExportFields, ExportField)
......
......@@ -23,7 +23,11 @@ public:
Q_REQUIRED_RESULT bool canImportFileType(const QUrl &url) override;
private:
enum ExportVCardType { VCard2_1 = 0, VCard3, VCard4 };
enum ExportVCardType {
VCard2_1 = 0,
VCard3,
VCard4,
};
KContacts::Addressee::List parseVCard(const QByteArray &data) const;
KContacts::Addressee::List filterContacts(const KContacts::Addressee::List &addrList,
KAddressBookImportExport::ExportSelectionWidget::ExportFields exportFieldType) const;
......
......@@ -39,7 +39,7 @@ public:
FreeBusy = 65536,
FamilyName = 131072,
PartnerName = 262144,
Keys = 524288
Keys = 524288,
};
Q_ENUMS(ConflictInformation)
Q_DECLARE_FLAGS(ConflictInformations, ConflictInformation)
......
......@@ -15,7 +15,11 @@ class MergeContactErrorLabel : public QLabel
{
Q_OBJECT
public:
enum ErrorType { NotEnoughContactsSelected = 0, NoContactDuplicatesFound, NoContactSelected };
enum ErrorType {
NotEnoughContactsSelected = 0,
NoContactDuplicatesFound,
NoContactSelected,
};
explicit MergeContactErrorLabel(MergeContactErrorLabel::ErrorType type, QWidget *parent = nullptr);
~MergeContactErrorLabel() override;
};
......
......@@ -29,7 +29,13 @@ private:
void upperCase();
void lowerCase();
void reverseCase();
enum ChangeCaseType { Unknown = -1, UpperCase = 0, LowerCase, SentenseCase, ReverseCase };
enum ChangeCaseType {
Unknown = -1,
UpperCase = 0,
LowerCase,
SentenseCase,
ReverseCase,
};
ChangeCaseType mType = Unknown;
};
......
......@@ -29,7 +29,13 @@ public:
void exportQuickText();
private:
enum class EditMode { AddSnippet, EditSnippet, AddGroup, EditGroup, Unknown };
enum class EditMode {
AddSnippet,
EditSnippet,
AddGroup,
EditGroup,
Unknown,
};
void addSnippet();
void editSnippet();
void addSnippetGroup();
......
......@@ -30,7 +30,12 @@ private:
void zoomReset();
void zoomIn();
void zoomOut();
enum ZoomTextType { Unknown = -1, ZoomReset = 0, ZoomIn, ZoomOut };
enum ZoomTextType {
Unknown = -1,
ZoomReset = 0,
ZoomIn,
ZoomOut,
};
ZoomTextType mType = Unknown;
ZoomLabel *mZoomLabelWidget = nullptr;
};
......
......@@ -36,7 +36,9 @@ Q_SIGNALS:
private:
Q_DISABLE_COPY(GrammarResultTextEdit)
void slotReplaceWord(const MessageComposer::PluginGrammarAction &act, const QString &replacementWord);
enum TextInfo { ReplaceFormatInfo = QTextFormat::UserProperty + 1 };
enum TextInfo {
ReplaceFormatInfo = QTextFormat::UserProperty + 1,
};
void slotOpenGrammarUrlInfo(const QString &url);
void generalPaletteChanged();
QColor mTextColor;
......
......@@ -41,7 +41,13 @@ Q_SIGNALS:
private:
Q_DISABLE_COPY(LanguageToolResultJob)
enum class JobError { NotError, EmptyText, UrlNotDefined, NetworkManagerNotDefined, LanguageNotDefined };
enum class JobError {
NotError,
EmptyText,
UrlNotDefined,
NetworkManagerNotDefined,
LanguageNotDefined,
};
LanguageToolResultJob::JobError canStartError() const;
void slotCheckGrammarFinished();
......
......@@ -89,7 +89,10 @@ public:
/** The wizard can be used for setting up anti-spam tools and for
setting up anti-virus tools.
*/
enum WizardMode { AntiSpam, AntiVirus };
enum WizardMode {
AntiSpam,
AntiVirus,
};
/** Constructor that needs to initialize from the main folder tree
of KMail.
......
......@@ -21,7 +21,10 @@ class MailMergeWidget : public QWidget
{
Q_OBJECT
public:
enum SourceType { AddressBook = 0, CSV = 1 };
enum SourceType {
AddressBook = 0,
CSV = 1,
};
explicit MailMergeWidget(QWidget *parent = nullptr);
~MailMergeWidget() override;
......
......@@ -26,7 +26,10 @@ public:
Element::List createDayElements(const QDate &) override;
Element::List createWeekElements(const QDate &) override;
enum DayNumber { DayOfYear = 1, DaysRemaining = 2 };
enum DayNumber {
DayOfYear = 1,
DaysRemaining = 2,
};
Q_DECLARE_FLAGS(DayNumbers, DayNumber)
Q_REQUIRED_RESULT QString info() const override;
......
......@@ -74,9 +74,37 @@ class Converter
friend class HebrewDate;
public:
enum HebrewMonths { Nissan = 1, Iyar, Sivan, Tamuz, Ab, Elul, Tishrei, Cheshvan, Kislev, Tevet, Shvat, Adar, AdarII, AdarI = 12 };
enum SecularMonths { January = 1, February, March, April, May, June, July, August, September, October, November, December };
enum HebrewMonths {
Nissan = 1,
Iyar,
Sivan,
Tamuz,
Ab,
Elul,
Tishrei,
Cheshvan,
Kislev,
Tevet,
Shvat,
Adar,
AdarII,
AdarI = 12,
};
enum SecularMonths {
January = 1,
February,
March,
April,
May,
June,
July,
August,
September,
October,
November,
December,
};
private:
static bool hebrew_leap_year_p(int year);
......
......@@ -45,7 +45,15 @@ QStringList Holiday::findHoliday(int month,
bool showChol,
bool showOmer)
{
enum { Sunday = 1, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday };
enum {
Sunday = 1,
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday,
};
QStringList holidays;
bool isAShabbat = (weekday == Saturday);
......
......@@ -60,7 +60,7 @@ private:
Shvat = 11,
Adar = 12,
AdarII = 13,
AdarI = 12
AdarI = 12,
};
static QStringList findHoliday(int month,
......
......@@ -34,7 +34,7 @@ public:
PersianCalendar = 13,
ROCCalendar = 14,
ThaiCalendar = 15,
LastCalendar = ThaiCalendar
LastCalendar = ThaiCalendar,
};
explicit QCalendarSystem(QCalendarSystem::CalendarSystem calendar = QCalendarSystem::DefaultCalendar);
......
......@@ -483,7 +483,12 @@ public:
return newMyself;
}
enum MailType { Answer, Delegation, Forward, DeclineCounter };
enum MailType {
Answer,
Delegation,
Forward,
DeclineCounter,
};
bool mailICal(const QString &receiver,
const QString &to,
......
......@@ -22,7 +22,11 @@ public:
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MessageViewer::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const override;
private:
enum WKSStatus { CheckingPublishing, NotPublished, Published };
enum WKSStatus {
CheckingPublishing,
NotPublished,
Published,
};
QString render(const GnuPGWKSMessagePart &mp, WKSStatus status) const;
};
......
......@@ -28,7 +28,11 @@ class GnuPGWKSMessagePart : public MimeTreeParser::MessagePart
{
Q_OBJECT
public:
enum ConfirmationType { UnknownType, ConfirmationRequest, ConfirmationResponse };
enum ConfirmationType {
UnknownType,
ConfirmationRequest,
ConfirmationResponse,
};
explicit GnuPGWKSMessagePart(MimeTreeParser::Interface::BodyPart *part);
......
......@@ -13,7 +13,11 @@
namespace
{
enum Index { application_pgp_keys, application_vnd_gnupg_keys, multipart_mixed };
enum Index {
application_pgp_keys,
application_vnd_gnupg_keys,
multipart_mixed,
};
}
const MimeTreeParser::Interface::BodyPartFormatter *ApplicationGnuPGWKSPlugin::bodyPartFormatter(int idx) const
......
......@@ -20,7 +20,9 @@ class PimCalendarsModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
enum Roles { DataRole = Qt::UserRole + 1 };
enum Roles {
DataRole = Qt::UserRole + 1,
};
explicit PimCalendarsModel(QObject *parent = nullptr);
~PimCalendarsModel() override;
......
......@@ -21,7 +21,11 @@ class ADBLOCKLIB_EXPORT AdBlockBlockableItemsJob : public QObject
{
Q_OBJECT
public:
enum TypeElement { UnKnown = 0, Image, Script };
enum TypeElement {
UnKnown = 0,
Image,
Script,
};
explicit AdBlockBlockableItemsJob(QObject *parent = nullptr);
~AdBlockBlockableItemsJob() override;
......
......@@ -73,7 +73,14 @@ protected:
QStringList parseRegExpFilter(const QString &filter) const;
private:
enum RuleType { CssRule = 0, DomainMatchRule = 1, RegExpMatchRule = 2, StringEndsMatchRule = 3, StringContainsMatchRule = 4, Invalid = 5 };
enum RuleType {
CssRule = 0,
DomainMatchRule = 1,
RegExpMatchRule = 2,
StringEndsMatchRule = 3,
StringContainsMatchRule = 4,
Invalid = 5,
};
enum RuleOption {
DomainRestrictedOption = 1,
......@@ -88,7 +95,7 @@ private:
// Exception only options
DocumentOption = 1024,
ElementHideOption = 2048
ElementHideOption = 2048,
};
Q_DECLARE_FLAGS(RuleOptions, RuleOption)
......
......@@ -32,7 +32,7 @@ public:
Media,
Popup,
MaxTypeElement
MaxTypeElement,
};
explicit AdBlockBlockableItemsWidget(QWidget *parent = nullptr);
......@@ -51,8 +51,14 @@ private:
void slotBlockItem();
void slotCopyItem();
void slotRemoveFilter();
enum BlockType { FilterValue = 0, Url, Type };
enum TypeItem { Element = Qt::UserRole + 1 };
enum BlockType {
FilterValue = 0,
Url,
Type,
};
enum TypeItem {
Element = Qt::UserRole + 1,
};
void writeConfig();
void readConfig();
......
......@@ -29,7 +29,9 @@ public:
private:
void slotUpdateFilter();
enum ElementType { ElementValue = Qt::UserRole + 1 };
enum ElementType {
ElementValue = Qt::UserRole + 1,
};
void readConfig();
void writeConfig();
......
......@@ -81,7 +81,7 @@ private:
void showAutomaticFilterList(QListWidgetItem *item);
void slotManualFiltersChanged(QListWidgetItem *item);
void slotSelectionChanged();
enum List {
enum List{
UrlList = Qt::UserRole + 1,
PathList = Qt::UserRole + 2,
};
......
......@@ -22,7 +22,9 @@ class SelectImapLoadFoldersJob : public QObject
{
Q_OBJECT
public:
enum Roles { PathRole = Qt::UserRole + 1 };
enum Roles {
PathRole = Qt::UserRole + 1,
};
explicit SelectImapLoadFoldersJob(QStandardItemModel *model, QObject *parent = nullptr);
~SelectImapLoadFoldersJob() override;
......
......@@ -19,7 +19,11 @@
K_PLUGIN_CLASS_WITH_JSON(RegexpEditorLineEdit, "regexepeditorlineedit.json")
struct InfoRegExp {
enum RegexpEditorStatus { Unknown = 0, Installed, NotInstalled };
enum RegexpEditorStatus {
Unknown = 0,
Installed,
NotInstalled,
};
RegexpEditorStatus status = Unknown;
QDialog *mEditorDialog = nullptr;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment