Commit 5c1c3382 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

We depend against kf5.90

parent ddbdbcfb
Pipeline #122925 passed with stage
in 54 seconds
......@@ -20,11 +20,7 @@
#include <array>
#include <ki18n_version.h>
#if KI18N_VERSION >= QT_VERSION_CHECK(5, 89, 0)
#include <KLazyLocalizedString>
#undef I18NC_NOOP
#define I18NC_NOOP kli18nc
#endif
using MessagePtr = KMime::Message::Ptr;
......@@ -33,19 +29,13 @@ using namespace Akonadi;
namespace
{
struct HeaderName {
#if KI18N_VERSION < QT_VERSION_CHECK(5, 89, 0)
const char *desc;
const char *name;
#else
const KLazyLocalizedString desc;
#endif
};
constexpr std::array<HeaderName, 5> headers = {{{I18NC_NOOP("@title:column, message (e.g. email) subject", "Subject")},
{I18NC_NOOP("@title:column, sender of message (e.g. email)", "Sender")},
{I18NC_NOOP("@title:column, receiver of message (e.g. email)", "Receiver")},
{I18NC_NOOP("@title:column, message (e.g. email) timestamp", "Date")},
{I18NC_NOOP("@title:column, message (e.g. email) size", "Size")}}};
constexpr std::array<HeaderName, 5> headers = {{{kli18nc("@title:column, message (e.g. email) subject", "Subject")},
{kli18nc("@title:column, sender of message (e.g. email)", "Sender")},
{kli18nc("@title:column, receiver of message (e.g. email)", "Receiver")},
{kli18nc("@title:column, message (e.g. email) timestamp", "Date")},
{kli18nc("@title:column, message (e.g. email) size", "Size")}}};
}
MessageModel::MessageModel(Monitor *monitor, QObject *parent)
......@@ -130,11 +120,7 @@ QVariant MessageModel::entityData(const Item &item, int column, int role) const
QVariant MessageModel::entityHeaderData(int section, Qt::Orientation orientation, int role, HeaderGroup headerGroup) const
{
if (section >= 0 && static_cast<std::size_t>(section) < headers.size()) {
#if KI18N_VERSION < QT_VERSION_CHECK(5, 89, 0)
return i18nc(headers[section].desc, headers[section].name);
#else
return KLocalizedString(headers[section].desc).toString();
#endif
}
return EntityTreeModel::entityHeaderData(section, orientation, role, headerGroup);
......
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