Commit e71eaefd authored by Laurent Montel's avatar Laurent Montel 😁

Modernize code

parent b851abc5
Pipeline #33775 passed with stage
in 18 minutes and 51 seconds
......@@ -19,14 +19,14 @@ namespace KIMAP
class AppendJobPrivate : public JobPrivate
{
public:
AppendJobPrivate(Session *session, const QString &name) : JobPrivate(session, name), uid(0) { }
AppendJobPrivate(Session *session, const QString &name) : JobPrivate(session, name) { }
~AppendJobPrivate() { }
QString mailBox;
QList<QByteArray> flags;
QDateTime internalDate;
QByteArray content;
qint64 uid;
qint64 uid = 0;
};
}
......
......@@ -20,12 +20,12 @@ namespace KIMAP
class CopyJobPrivate : public JobPrivate
{
public:
CopyJobPrivate(Session *session, const QString &name) : JobPrivate(session, name), uidBased(false) { }
CopyJobPrivate(Session *session, const QString &name) : JobPrivate(session, name) { }
~CopyJobPrivate() { }
QString mailBox;
ImapSet set;
bool uidBased;
bool uidBased = false;
ImapSet resultingUids;
};
}
......
......@@ -23,8 +23,6 @@ public:
FetchJobPrivate(FetchJob *job, Session *session, const QString &name)
: JobPrivate(session, name)
, q(job)
, uidBased(false)
, gmailEnabled(false)
{ }
~FetchJobPrivate()
......@@ -80,10 +78,10 @@ public:
FetchJob *const q;
ImapSet set;
bool uidBased;
bool uidBased = false;
FetchJob::FetchScope scope;
QString selectedMailBox;
bool gmailEnabled;
bool gmailEnabled = false;
QTimer emitPendingsTimer;
QMap<qint64, MessagePtr> pendingMessages;
......
......@@ -19,10 +19,10 @@ namespace KIMAP
class GetMetaDataJobPrivate : public MetaDataJobBasePrivate
{
public:
GetMetaDataJobPrivate(Session *session, const QString &name) : MetaDataJobBasePrivate(session, name), maxSize(-1), depth("0") { }
GetMetaDataJobPrivate(Session *session, const QString &name) : MetaDataJobBasePrivate(session, name), depth("0") { }
~GetMetaDataJobPrivate() { }
qint64 maxSize;
qint64 maxSize = -1;
QByteArray depth;
QSet<QByteArray> entries;
QSet<QByteArray> attributes;
......
......@@ -19,10 +19,7 @@ class IdleJobPrivate : public JobPrivate
{
public:
IdleJobPrivate(IdleJob *job, Session *session, const QString &name)
: JobPrivate(session, name), q(job),
messageCount(-1), recentCount(-1),
lastMessageCount(-1), lastRecentCount(-1),
originalSocketTimeout(-1) { }
: JobPrivate(session, name), q(job) { }
~IdleJobPrivate() { }
void emitStats()
......@@ -48,13 +45,13 @@ public:
QTimer emitStatsTimer;
int messageCount;
int recentCount;
int messageCount = -1;
int recentCount = -1;
int lastMessageCount;
int lastRecentCount;
int lastMessageCount = -1;
int lastRecentCount = -1;
int originalSocketTimeout;
int originalSocketTimeout = -1;
};
}
......
......@@ -62,7 +62,7 @@ public:
void sslResponse(bool response);
void saveServerGreeting(const Response &response);
LoginJob *q;
LoginJob *const q;
QString userName;
QString authorizationName;
......
......@@ -22,7 +22,6 @@ class MoveJobPrivate : public JobPrivate
public:
MoveJobPrivate(Session *session, const QString &name)
: JobPrivate(session, name)
, uidBased(false)
{}
~MoveJobPrivate()
......@@ -31,7 +30,7 @@ public:
QString mailBox;
ImapSet set;
ImapSet resultingUids;
bool uidBased;
bool uidBased = false;
};
}
......
......@@ -20,23 +20,21 @@ class SelectJobPrivate : public JobPrivate
{
public:
SelectJobPrivate(Session *session, const QString &name)
: JobPrivate(session, name), readOnly(false), messageCount(-1), recentCount(-1),
firstUnseenIndex(-1), uidValidity(-1), nextUid(-1), highestmodseq(0),
condstoreEnabled(false) { }
: JobPrivate(session, name) { }
~SelectJobPrivate() { }
QString mailBox;
bool readOnly;
bool readOnly = false;
QList<QByteArray> flags;
QList<QByteArray> permanentFlags;
int messageCount;
int recentCount;
int firstUnseenIndex;
qint64 uidValidity;
qint64 nextUid;
quint64 highestmodseq;
bool condstoreEnabled;
int messageCount = -1;
int recentCount = -1;
int firstUnseenIndex = -1;
qint64 uidValidity = -1;
qint64 nextUid = -1;
quint64 highestmodseq = 0;
bool condstoreEnabled = false;
};
}
......
......@@ -13,7 +13,6 @@
using namespace KIMAP;
SessionLogger::SessionLogger()
: m_id(0)
{
static qint64 nextId = 0;
m_id = ++nextId;
......
......@@ -27,7 +27,7 @@ public:
private:
Q_DISABLE_COPY(SessionLogger)
qint64 m_id;
qint64 m_id = 0;
QFile m_file;
};
......
......@@ -27,9 +27,7 @@ static const int _kimap_sslErrorUiData = qRegisterMetaType<KSslErrorUiData>();
}
SessionThread::SessionThread(const QString &hostName, quint16 port)
: QObject(), m_hostName(hostName), m_port(port),
m_encryptedMode(false),
m_useProxy(false)
: QObject(), m_hostName(hostName), m_port(port)
{
// Just like the Qt docs now recommend, for event-driven threads:
// don't derive from QThread, create one directly and move the object to it.
......
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