Skip to content
GitLab
Menu
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
1e07ed31
Commit
1e07ed31
authored
Nov 17, 2021
by
Laurent Montel
😁
Browse files
Make it compile without deprecated methods
parent
7f439ad7
Pipeline
#98401
passed with stage
in 5 minutes and 51 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/messagemodel.cpp
View file @
1e07ed31
...
...
@@ -18,7 +18,13 @@
#include <KFormat>
#include <QLocale>
#include "ki18n_version.h"
#include <array>
#if KI18N_VERSION >= QT_VERSION_CHECK(5, 89, 0)
#include <klazylocalizedstring.h>
#undef I18NC_NOOP
#define I18NC_NOOP kli18nc
#endif
using
MessagePtr
=
KMime
::
Message
::
Ptr
;
...
...
@@ -27,8 +33,12 @@ 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"
)},
...
...
@@ -120,7 +130,11 @@ 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
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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