Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Akonadi Mime
Commits
5c1c3382
Commit
5c1c3382
authored
Jan 13, 2022
by
Laurent Montel
Browse files
We depend against kf5.90
parent
ddbdbcfb
Pipeline
#122925
passed with stage
in 54 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/messagemodel.cpp
View file @
5c1c3382
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment