[pim/trojita] src: Port deprecated Q_ENUMS to Q_ENUM

Espen Sandøy Hustad <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 182033057d9566099c79f96de44ec3ea68f422c9 by Espen Sandøy Hustad.
Committed on 21/07/2026 at 18:50.
Pushed by ehustad into branch 'master'.

Port deprecated Q_ENUMS to Q_ENUM

Fixes Clazy warning: Use Q_ENUM instead of Q_ENUMS (-Wclazy-qenums).

M  +0    -2    src/Common/MetaTypes.cpp
M  +1    -1    src/Imap/Model/ThreadingMsgListModel.h
M  +1    -3    src/MSA/Account.h
M  +1    -2    src/qwwsmtpclient/qwwsmtpclient.h

https://invent.kde.org/pim/trojita/-/commit/182033057d9566099c79f96de44ec3ea68f422c9

diff --git a/src/Common/MetaTypes.cpp b/src/Common/MetaTypes.cpp
index 83811be6f..92ac56be2 100644
--- a/src/Common/MetaTypes.cpp
+++ b/src/Common/MetaTypes.cpp
@@ -22,7 +22,6 @@
 
 #include "MetaTypes.h"
 #include "Imap/Model/CacheLoadingMode.h"
-#include "MSA/Account.h"
 
 namespace Common {
 
@@ -34,7 +33,6 @@ void registerMetaTypes()
     qRegisterMetaType<QModelIndex>();
     qRegisterMetaType<Imap::Mailbox::CacheLoadingMode>();
     qRegisterMetaType<Common::ConnectionMethod>();
-    qRegisterMetaType<MSA::Account::Method>();
 }
 
 }
diff --git a/src/Imap/Model/ThreadingMsgListModel.h b/src/Imap/Model/ThreadingMsgListModel.h
index e658def1e..630c3520b 100644
--- a/src/Imap/Model/ThreadingMsgListModel.h
+++ b/src/Imap/Model/ThreadingMsgListModel.h
@@ -82,7 +82,6 @@ the pruneTree() method, except that we might not know the UID of the message in
 class ThreadingMsgListModel: public QAbstractProxyModel
 {
     Q_OBJECT
-    Q_ENUMS(SortCriterium)
 
 public:
 
@@ -122,6 +121,7 @@ public:
         /** @short Recipient of the message, either their mailbox or their display name */
         SORT_TO
     };
+    Q_ENUM(SortCriterium)
 
     explicit ThreadingMsgListModel(QObject *parent);
     void setSourceModel(QAbstractItemModel *sourceModel) override;
diff --git a/src/MSA/Account.h b/src/MSA/Account.h
index 395840a04..ba43a7968 100644
--- a/src/MSA/Account.h
+++ b/src/MSA/Account.h
@@ -43,7 +43,6 @@ class Account : public QObject
     Q_PROPERTY(QString sentMailboxName READ sentMailboxName WRITE setSentMailboxName NOTIFY sentMailboxNameChanged)
     Q_PROPERTY(bool useBurl READ useBurl WRITE setUseBurl NOTIFY useBurlChanged)
     Q_PROPERTY(Method submissionMethod READ submissionMethod WRITE setSubmissionMethod NOTIFY submissionMethodChanged)
-    Q_ENUMS(Method)
 
 public:
     Account(QObject *parent, QSettings *settings, const QString &accountName);
@@ -55,6 +54,7 @@ public:
         SENDMAIL, /**< Use a local Sendmail compatible transfer agent */
         IMAP_SENDMAIL, /**< Uses the IMAP SENDMAIL Extension */
     };
+    Q_ENUM(Method)
 
     Method submissionMethod() const;
     QString server() const;
@@ -122,6 +122,4 @@ private:
 
 }
 
-Q_DECLARE_METATYPE(MSA::Account::Method)
-
 #endif // MSA_ACCOUNT_H
diff --git a/src/qwwsmtpclient/qwwsmtpclient.h b/src/qwwsmtpclient/qwwsmtpclient.h
index ae53222e3..cac3e35a3 100644
--- a/src/qwwsmtpclient/qwwsmtpclient.h
+++ b/src/qwwsmtpclient/qwwsmtpclient.h
@@ -45,15 +45,14 @@ class QwwSmtpClientPrivate;
 */
 class QwwSmtpClient : public QObject {
     Q_OBJECT
-    Q_ENUMS(State);
     Q_FLAGS(Options);
-    Q_ENUMS(AuthMode);
     Q_FLAGS(AuthModes);
 
 public:
     explicit QwwSmtpClient(QObject *parent = nullptr);
     ~QwwSmtpClient() override;
     enum State { Disconnected, Connecting, Connected, TLSRequested, Authenticating, Sending, Disconnecting };
+    Q_ENUM(State);
     enum Option { NoOptions = 0, StartTlsOption, SizeOption, PipeliningOption, EightBitMimeOption, AuthOption };
     Q_DECLARE_FLAGS ( Options, Option );
     enum AuthMode { AuthNone = 0, AuthAny = 1, AuthPlain = 2, AuthLogin = 4 };
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.