Commit 5412a4de authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Modernize code

parent b9b418ac
Pipeline #33745 passed with stage
in 4 minutes and 5 seconds
......@@ -43,9 +43,7 @@ CharFreq::CharFreq(const QByteArray &buf)
mEightBit(0),
mTotal(0),
mLineMin(0xffffffff),
mLineMax(0),
mTrailingWS(false),
mLeadingFrom(false)
mLineMax(0)
{
if (!buf.isEmpty()) {
count(buf.data(), buf.size());
......@@ -61,9 +59,7 @@ CharFreq::CharFreq(const char *buf, size_t len)
mEightBit(0),
mTotal(0),
mLineMin(0xffffffff),
mLineMax(0),
mTrailingWS(false),
mLeadingFrom(false)
mLineMax(0)
{
if (buf && len > 0) {
count(buf, len);
......
......@@ -154,8 +154,8 @@ private:
uint mTotal; // count of all chars
uint mLineMin; // minimum line length
uint mLineMax; // maximum line length
bool mTrailingWS; // does the buffer contain trailing whitespace?
bool mLeadingFrom; // does the buffer contain lines starting with "From "?
bool mTrailingWS = false; // does the buffer contain trailing whitespace?
bool mLeadingFrom = false; // does the buffer contain lines starting with "From "?
//@endcond
/**
......
......@@ -32,8 +32,7 @@ namespace KMime {
class DateFormatterPrivate {
public:
DateFormatterPrivate() :
mTodayOneSecondBeforeMidnight(0)
DateFormatterPrivate()
{}
/**
......@@ -95,7 +94,7 @@ public:
static QByteArray zone(time_t t);
DateFormatter::FormatType mFormat;
time_t mTodayOneSecondBeforeMidnight;
time_t mTodayOneSecondBeforeMidnight = 0;
QString mCustomFormat;
};
......
......@@ -190,7 +190,7 @@ Q_REQUIRED_RESULT KMIME_EXPORT bool parseAngleAddr(const char *&scursor, const c
@param result the parsing result
@param isCRLF true if input string is terminated with a CRLF.
*/
Q_REQUIRED_RESULT KMIME_EXPORT bool parseMailbox(const char *&scursor, const char *const send,
KMIME_EXPORT bool parseMailbox(const char *&scursor, const char *const send,
Types::Mailbox &result, bool isCRLF = false);
Q_REQUIRED_RESULT KMIME_EXPORT bool parseGroup(const char *&scursor, const char *const send,
......
......@@ -20,9 +20,9 @@ namespace Parser
{
MultiPart::MultiPart(const QByteArray &src, const QByteArray &boundary)
: m_src(src)
, m_boundary(boundary)
{
m_src = src;
m_boundary = boundary;
}
bool MultiPart::parse()
......
......@@ -43,7 +43,10 @@ public:
}
private:
QByteArray m_src, m_boundary, m_preamble, m_epilouge;
QByteArray m_src;
const QByteArray m_boundary;
QByteArray m_preamble;
QByteArray m_epilouge;
QVector<QByteArray> m_parts;
};
......
......@@ -55,7 +55,7 @@ QByteArray cachedCharset(const QByteArray &name)
bool isUsAscii(const QString &s)
{
uint sLength = s.length();
const uint sLength = s.length();
for (uint i = 0; i < sLength; i++) {
if (s.at(i).toLatin1() <= 0) { // c==0: non-latin1, c<0: non-us-ascii
return false;
......
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