Commit 1d1da344 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

We can use directly constexpr

parent e5ebdda3
Pipeline #76316 failed with stage
in 24 minutes and 41 seconds
......@@ -31,7 +31,7 @@ static const QString responseTypeNames[] = {QStringLiteral("Unknown"),
QStringLiteral("Accept"),
QStringLiteral("Decline"),
QStringLiteral("NoResponseReceived")};
Q_CONSTEXPR unsigned responseTypeNameCount = sizeof(responseTypeNames) / sizeof(responseTypeNames[0]);
constexpr unsigned responseTypeNameCount = sizeof(responseTypeNames) / sizeof(responseTypeNames[0]);
EwsAttendeePrivate::EwsAttendeePrivate()
: mValid(false)
......
......@@ -11,7 +11,7 @@
#include "ewsclient_debug.h"
#include "ewsxml.h"
static Q_CONSTEXPR uint respChunkTimeout = 250; /* ms */
static constexpr uint respChunkTimeout = 250; /* ms */
EwsGetStreamingEventsRequest::EwsGetStreamingEventsRequest(EwsClient &client, QObject *parent)
: EwsEventRequestBase(client, QStringLiteral("GetStreamingEvents"), parent)
......
......@@ -27,7 +27,7 @@ static const QString dayOfWeekNames[] = {
QStringLiteral("Weekday"),
QStringLiteral("WeekendDay"),
};
Q_CONSTEXPR unsigned dayOfWeekNameCount = sizeof(dayOfWeekNames) / sizeof(dayOfWeekNames[0]);
constexpr unsigned dayOfWeekNameCount = sizeof(dayOfWeekNames) / sizeof(dayOfWeekNames[0]);
static const QString dayOfWeekIndexNames[] = {
QStringLiteral("First"),
......@@ -36,7 +36,7 @@ static const QString dayOfWeekIndexNames[] = {
QStringLiteral("Fourth"),
QStringLiteral("Last"),
};
Q_CONSTEXPR unsigned dayOfWeekIndexNameCount = sizeof(dayOfWeekIndexNames) / sizeof(dayOfWeekIndexNames[0]);
constexpr unsigned dayOfWeekIndexNameCount = sizeof(dayOfWeekIndexNames) / sizeof(dayOfWeekIndexNames[0]);
static const QString monthNames[] = {
QStringLiteral("January"),
......@@ -52,7 +52,7 @@ static const QString monthNames[] = {
QStringLiteral("November"),
QStringLiteral("December"),
};
Q_CONSTEXPR unsigned monthNameCount = sizeof(monthNames) / sizeof(monthNames[0]);
constexpr unsigned monthNameCount = sizeof(monthNames) / sizeof(monthNames[0]);
EwsRecurrence::EwsRecurrence()
: Recurrence()
......
......@@ -22,7 +22,7 @@ public:
typedef QHash<T, QVariant> ValueHash;
static Q_CONSTEXPR T Ignore = static_cast<T>(-1);
static constexpr T Ignore = static_cast<T>(-1);
struct Item {
Item()
......
......@@ -26,7 +26,7 @@ using namespace Akonadi;
static const EwsPropertyField propPidTagContainerClass(0x3613, EwsPropTypeString);
static Q_CONSTEXPR int fetchBatchSize = 50;
static constexpr int fetchBatchSize = 50;
class EwsFetchFoldersJobPrivate : public QObject
{
......
......@@ -23,8 +23,8 @@
using namespace Akonadi;
static Q_CONSTEXPR int listBatchSize = 100;
static Q_CONSTEXPR int fetchBatchSize = 50;
static constexpr int listBatchSize = 100;
static constexpr int fetchBatchSize = 50;
/**
* The fetch items job is processed in two stages.
......
......@@ -1470,7 +1470,7 @@ QString EwsResource::dumpResourceToString() const
{
QString dump = QStringLiteral("item sync queue (%1):\n").arg(mFetchItemsJobQueue.count());
for (const auto &item : qAsConst(mFetchItemsJobQueue)) {
for (const auto &item : std::as_const(mFetchItemsJobQueue)) {
dump += QStringLiteral(" %1:%2\n").arg(item.col.id()).arg(item.type);
}
......
......@@ -17,11 +17,11 @@
#include <QPointer>
// TODO: Allow customization
static Q_CONSTEXPR uint pollInterval = 10; /* seconds */
static constexpr uint pollInterval = 10; /* seconds */
static Q_CONSTEXPR uint streamingTimeout = 30; /* minutes */
static constexpr uint streamingTimeout = 30; /* minutes */
static Q_CONSTEXPR uint streamingConnTimeout = 60; /* seconds */
static constexpr uint streamingConnTimeout = 60; /* seconds */
EwsSubscriptionManager::EwsSubscriptionManager(EwsClient &client, const EwsId &rootId, EwsSettings *settings, QObject *parent)
: QObject(parent)
......
......@@ -17,8 +17,8 @@
using namespace Akonadi;
static Q_CONSTEXPR quint32 TagDataVer1 = 1;
static Q_CONSTEXPR QDataStream::Version TagDataVer1StreamVer = QDataStream::Qt_5_4;
static constexpr quint32 TagDataVer1 = 1;
static constexpr QDataStream::Version TagDataVer1StreamVer = QDataStream::Qt_5_4;
EwsTagStore::EwsTagStore(QObject *parent)
: QObject(parent)
......
......@@ -26,7 +26,7 @@ static const QHash<uint, QString> responseCodes = {
{500, QStringLiteral("Internal Server Error")},
};
static Q_CONSTEXPR int streamingEventsHeartbeatIntervalSeconds = 5;
static constexpr int streamingEventsHeartbeatIntervalSeconds = 5;
FakeEwsConnection::FakeEwsConnection(QTcpSocket *sock, FakeEwsServer *parent)
: QObject(parent)
......
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