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
KMail
Commits
11b4b597
Commit
11b4b597
authored
Jun 02, 2019
by
Laurent Montel
Browse files
Adapt to new api
parent
85c977ef
Changes
4
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
11b4b597
...
...
@@ -66,7 +66,7 @@ option(KDEPIM_RUN_AKONADI_TEST "Enable autotest based on Akonadi." TRUE)
find_package
(
Qt5
${
QT_REQUIRED_VERSION
}
CONFIG REQUIRED DBus Network Test Widgets WebEngine WebEngineWidgets
)
set
(
LIBGRAVATAR_VERSION_LIB
"5.11.40"
)
set
(
MAILCOMMON_LIB_VERSION_LIB
"5.11.4
0
"
)
set
(
MAILCOMMON_LIB_VERSION_LIB
"5.11.4
1
"
)
set
(
KDEPIM_APPS_LIB_VERSION_LIB
"5.11.40"
)
set
(
MESSAGELIB_LIB_VERSION_LIB
"5.11.42"
)
set
(
LIBKLEO_LIB_VERSION_LIB
"5.11.40"
)
...
...
agents/mailfilteragent/filtermanager.cpp
View file @
11b4b597
...
...
@@ -79,7 +79,7 @@ public:
bool
atLeastOneFilterAppliesTo
(
const
QString
&
accountId
)
const
;
bool
atLeastOneIncomingFilterAppliesTo
(
const
QString
&
accountId
)
const
;
FilterManager
*
q
;
Q
List
<
MailCommon
::
MailFilter
*>
mFilters
;
Q
Vector
<
MailCommon
::
MailFilter
*>
mFilters
;
QMap
<
QString
,
SearchRule
::
RequiredPart
>
mRequiredParts
;
QPixmap
pixmapNotification
;
SearchRule
::
RequiredPart
mRequiredPartsBasedOnAll
;
...
...
@@ -96,7 +96,7 @@ void FilterManager::Private::slotItemsFetchedForFilter(const Akonadi::Item::List
filterSet
=
static_cast
<
FilterManager
::
FilterSet
>
(
q
->
sender
()
->
property
(
"filterSet"
).
toInt
());
}
Q
List
<
MailFilter
*>
listMailFilters
;
Q
Vector
<
MailFilter
*>
listMailFilters
;
if
(
q
->
sender
()
->
property
(
"listFilters"
).
isValid
())
{
const
QStringList
listFilters
=
q
->
sender
()
->
property
(
"listFilters"
).
toStringList
();
//TODO improve it
...
...
@@ -363,8 +363,8 @@ void FilterManager::readConfig()
void
FilterManager
::
mailCollectionRemoved
(
const
Akonadi
::
Collection
&
collection
)
{
Q
List
<
MailCommon
::
MailFilter
*>::
const_iterator
end
(
d
->
mFilters
.
constEnd
());
for
(
Q
List
<
MailCommon
::
MailFilter
*>::
const_iterator
it
=
d
->
mFilters
.
constBegin
();
Q
Vector
<
MailCommon
::
MailFilter
*>::
const_iterator
end
(
d
->
mFilters
.
constEnd
());
for
(
Q
Vector
<
MailCommon
::
MailFilter
*>::
const_iterator
it
=
d
->
mFilters
.
constBegin
();
it
!=
end
;
++
it
)
{
(
*
it
)
->
folderRemoved
(
collection
,
Akonadi
::
Collection
());
}
...
...
@@ -372,8 +372,8 @@ void FilterManager::mailCollectionRemoved(const Akonadi::Collection &collection)
void
FilterManager
::
agentRemoved
(
const
QString
&
identifier
)
{
Q
List
<
MailCommon
::
MailFilter
*>::
const_iterator
end
(
d
->
mFilters
.
constEnd
());
for
(
Q
List
<
MailCommon
::
MailFilter
*>::
const_iterator
it
=
d
->
mFilters
.
constBegin
();
Q
Vector
<
MailCommon
::
MailFilter
*>::
const_iterator
end
(
d
->
mFilters
.
constEnd
());
for
(
Q
Vector
<
MailCommon
::
MailFilter
*>::
const_iterator
it
=
d
->
mFilters
.
constBegin
();
it
!=
end
;
++
it
)
{
(
*
it
)
->
agentRemoved
(
identifier
);
}
...
...
@@ -506,7 +506,7 @@ bool FilterManager::processContextItem(ItemContext context)
return
true
;
}
bool
FilterManager
::
process
(
const
Q
List
<
MailFilter
*
>
&
mailFilters
,
const
Akonadi
::
Item
&
item
,
bool
needsFullPayload
,
FilterManager
::
FilterSet
set
,
bool
account
,
const
QString
&
accountId
)
bool
FilterManager
::
process
(
const
Q
Vector
<
MailFilter
*
>
&
mailFilters
,
const
Akonadi
::
Item
&
item
,
bool
needsFullPayload
,
FilterManager
::
FilterSet
set
,
bool
account
,
const
QString
&
accountId
)
{
if
(
set
==
NoSet
)
{
qCDebug
(
MAILFILTERAGENT_LOG
)
<<
"FilterManager: process() called with not filter set selected"
;
...
...
@@ -523,11 +523,11 @@ bool FilterManager::process(const QList< MailFilter * > &mailFilters, const Akon
d
->
beginFiltering
(
item
);
ItemContext
context
(
item
,
needsFullPayload
);
Q
List
<
MailCommon
::
MailFilter
*>::
const_iterator
end
(
mailFilters
.
constEnd
());
Q
Vector
<
MailCommon
::
MailFilter
*>::
const_iterator
end
(
mailFilters
.
constEnd
());
const
bool
applyOnOutbound
=
((
set
&
Outbound
)
||
(
set
&
BeforeOutbound
));
for
(
Q
List
<
MailCommon
::
MailFilter
*>::
const_iterator
it
=
mailFilters
.
constBegin
();
for
(
Q
Vector
<
MailCommon
::
MailFilter
*>::
const_iterator
it
=
mailFilters
.
constBegin
();
!
stopIt
&&
it
!=
end
;
++
it
)
{
if
((
*
it
)
->
isEnabled
())
{
const
bool
inboundOk
=
((
set
&
Inbound
)
&&
(
*
it
)
->
applyOnInbound
());
...
...
agents/mailfilteragent/filtermanager.h
View file @
11b4b597
...
...
@@ -96,7 +96,7 @@ public:
*/
bool
process
(
const
Akonadi
::
Item
&
item
,
bool
needsFullPayload
,
FilterSet
set
=
Inbound
,
bool
account
=
false
,
const
QString
&
accountId
=
QString
());
bool
process
(
const
Q
List
<
MailCommon
::
MailFilter
*>
&
mailFilters
,
const
Akonadi
::
Item
&
item
,
bool
needsFullPayload
,
FilterSet
set
=
Inbound
,
bool
account
=
false
,
const
QString
&
accountId
=
QString
());
bool
process
(
const
Q
Vector
<
MailCommon
::
MailFilter
*>
&
mailFilters
,
const
Akonadi
::
Item
&
item
,
bool
needsFullPayload
,
FilterSet
set
=
Inbound
,
bool
account
=
false
,
const
QString
&
accountId
=
QString
());
/**
* For ad-hoc filters.
...
...
src/kmmainwidget.cpp
View file @
11b4b597
...
...
@@ -4233,7 +4233,7 @@ void KMMainWidget::initializeFilterActions()
mApplyFilterFolderRecursiveActionsMenu
->
menu
()
->
addAction
(
mApplyAllFiltersFolderRecursiveAction
);
bool
addedSeparator
=
false
;
const
Q
List
<
MailFilter
*>
lstFilters
=
MailCommon
::
FilterManager
::
instance
()
->
filters
();
const
Q
Vector
<
MailFilter
*>
lstFilters
=
MailCommon
::
FilterManager
::
instance
()
->
filters
();
for
(
MailFilter
*
filter
:
lstFilters
)
{
if
(
!
filter
->
isEmpty
()
&&
filter
->
configureShortcut
()
&&
filter
->
isEnabled
())
{
QString
filterName
=
QStringLiteral
(
"Filter %1"
).
arg
(
filter
->
name
());
...
...
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