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
388782fe
Commit
388782fe
authored
Jan 24, 2021
by
Laurent Montel
😁
Browse files
Modernize code
parent
8c59b1bf
Pipeline
#48554
failed with stage
in 10 minutes and 30 seconds
Changes
20
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
autotests/benchmarker/maildir/maildir20percentread.cpp
View file @
388782fe
...
...
@@ -25,18 +25,18 @@ void MailDir20PercentAsRead::runTest()
{
timer
.
start
();
qDebug
()
<<
" Marking 20% of messages as read."
;
CollectionFetchJob
*
clj2
=
new
CollectionFetchJob
(
Collection
::
root
(),
CollectionFetchJob
::
Recursive
);
auto
clj2
=
new
CollectionFetchJob
(
Collection
::
root
(),
CollectionFetchJob
::
Recursive
);
clj2
->
fetchScope
().
setResource
(
currentInstance
.
identifier
());
clj2
->
exec
();
const
Collection
::
List
list2
=
clj2
->
collections
();
for
(
const
Collection
&
collection
:
list2
)
{
auto
*
ifj
=
new
ItemFetchJob
(
collection
,
this
);
auto
ifj
=
new
ItemFetchJob
(
collection
,
this
);
ifj
->
exec
();
Item
::
List
itemlist
=
ifj
->
items
();
for
(
int
i
=
ifj
->
items
().
count
()
-
1
;
i
>=
0
;
i
-=
5
)
{
Item
item
=
itemlist
[
i
];
item
.
setFlag
(
"
\\
SEEN"
);
auto
*
isj
=
new
ItemModifyJob
(
item
,
this
);
auto
isj
=
new
ItemModifyJob
(
item
,
this
);
isj
->
exec
();
}
}
...
...
autotests/benchmarker/maildir/maildirfetchallheaders.cpp
View file @
388782fe
...
...
@@ -28,12 +28,12 @@ void MailDirFetchAllHeaders::runTest()
{
timer
.
start
();
qDebug
()
<<
" Listing all headers of every folder."
;
CollectionFetchJob
*
clj
=
new
CollectionFetchJob
(
Collection
::
root
(),
CollectionFetchJob
::
Recursive
);
auto
clj
=
new
CollectionFetchJob
(
Collection
::
root
(),
CollectionFetchJob
::
Recursive
);
clj
->
fetchScope
().
setResource
(
currentInstance
.
identifier
());
clj
->
exec
();
const
Collection
::
List
list
=
clj
->
collections
();
for
(
const
Collection
&
collection
:
list
)
{
auto
*
ifj
=
new
ItemFetchJob
(
collection
,
this
);
auto
ifj
=
new
ItemFetchJob
(
collection
,
this
);
ifj
->
fetchScope
().
fetchPayloadPart
(
MessagePart
::
Envelope
);
ifj
->
exec
();
QString
a
;
...
...
autotests/benchmarker/maildir/maildirfetchunreadheaders.cpp
View file @
388782fe
...
...
@@ -28,12 +28,12 @@ void MailDirFetchUnreadHeaders::runTest()
{
timer
.
start
();
qDebug
()
<<
" Listing headers of unread messages of every folder."
;
CollectionFetchJob
*
clj3
=
new
CollectionFetchJob
(
Collection
::
root
(),
CollectionFetchJob
::
Recursive
);
auto
clj3
=
new
CollectionFetchJob
(
Collection
::
root
(),
CollectionFetchJob
::
Recursive
);
clj3
->
fetchScope
().
setResource
(
currentInstance
.
identifier
());
clj3
->
exec
();
const
Collection
::
List
list3
=
clj3
->
collections
();
for
(
const
Collection
&
collection
:
list3
)
{
auto
*
ifj
=
new
ItemFetchJob
(
collection
,
this
);
auto
ifj
=
new
ItemFetchJob
(
collection
,
this
);
ifj
->
fetchScope
().
fetchPayloadPart
(
MessagePart
::
Envelope
);
ifj
->
exec
();
QString
a
;
...
...
autotests/benchmarker/maildir/maildirremovereadmessages.cpp
View file @
388782fe
...
...
@@ -24,18 +24,18 @@ void MailDirRemoveReadMessages::runTest()
{
timer
.
start
();
qDebug
()
<<
" Removing read messages from every folder."
;
CollectionFetchJob
*
clj4
=
new
CollectionFetchJob
(
Collection
::
root
(),
CollectionFetchJob
::
Recursive
);
auto
clj4
=
new
CollectionFetchJob
(
Collection
::
root
(),
CollectionFetchJob
::
Recursive
);
clj4
->
fetchScope
().
setResource
(
currentInstance
.
identifier
());
clj4
->
exec
();
const
Collection
::
List
list4
=
clj4
->
collections
();
for
(
const
Collection
&
collection
:
list4
)
{
auto
*
ifj
=
new
ItemFetchJob
(
collection
,
this
);
auto
ifj
=
new
ItemFetchJob
(
collection
,
this
);
ifj
->
exec
();
const
auto
items
=
ifj
->
items
();
for
(
const
Item
&
item
:
items
)
{
// delete read messages
if
(
item
.
hasFlag
(
"
\\
SEEN"
))
{
auto
*
idj
=
new
ItemDeleteJob
(
item
,
this
);
auto
idj
=
new
ItemDeleteJob
(
item
,
this
);
idj
->
exec
();
}
}
...
...
autotests/benchmarker/main.cpp
View file @
388782fe
...
...
@@ -26,8 +26,8 @@ int main(int argc, char *argv[])
const
QString
maildir
=
parser
.
value
(
QStringLiteral
(
"maildir"
));
const
QString
vcarddir
=
parser
.
value
(
QStringLiteral
(
"vcarddir"
));
auto
*
mailDirTest
=
new
TestMailDir
(
maildir
);
auto
*
vcardTest
=
new
TestVCard
(
vcarddir
);
auto
mailDirTest
=
new
TestMailDir
(
maildir
);
auto
vcardTest
=
new
TestVCard
(
vcarddir
);
mailDirTest
->
runTests
();
vcardTest
->
runTests
();
...
...
autotests/benchmarker/maketest.cpp
View file @
388782fe
...
...
@@ -31,7 +31,7 @@ void MakeTest::createAgent(const QString &name)
{
const
AgentType
type
=
AgentManager
::
self
()
->
type
(
name
);
auto
*
job
=
new
AgentInstanceCreateJob
(
type
);
auto
job
=
new
AgentInstanceCreateJob
(
type
);
job
->
exec
();
currentInstance
=
job
->
instance
();
...
...
@@ -47,7 +47,7 @@ void MakeTest::createAgent(const QString &name)
void
MakeTest
::
configureDBusIface
(
const
QString
&
name
,
const
QString
&
dir
)
{
QDBusInterface
*
configIface
=
new
QDBusInterface
(
QLatin1String
(
"org.freedesktop.Akonadi.Resource."
)
+
currentInstance
.
identifier
(),
auto
configIface
=
new
QDBusInterface
(
QLatin1String
(
"org.freedesktop.Akonadi.Resource."
)
+
currentInstance
.
identifier
(),
QStringLiteral
(
"/Settings"
),
QLatin1String
(
"org.kde.Akonadi."
)
+
name
+
QLatin1String
(
".Settings"
),
QDBusConnection
::
sessionBus
(),
this
);
configIface
->
call
(
QStringLiteral
(
"setPath"
),
dir
);
...
...
@@ -93,12 +93,12 @@ void MakeTest::removeCollections()
{
timer
.
restart
();
qDebug
()
<<
" Removing every folder sequentially."
;
CollectionFetchJob
*
clj5
=
new
CollectionFetchJob
(
Collection
::
root
(),
CollectionFetchJob
::
Recursive
);
auto
clj5
=
new
CollectionFetchJob
(
Collection
::
root
(),
CollectionFetchJob
::
Recursive
);
clj5
->
fetchScope
().
setResource
(
currentInstance
.
identifier
());
clj5
->
exec
();
const
Collection
::
List
list5
=
clj5
->
collections
();
for
(
const
Collection
&
collection
:
list5
)
{
auto
*
cdj
=
new
CollectionDeleteJob
(
collection
,
this
);
auto
cdj
=
new
CollectionDeleteJob
(
collection
,
this
);
cdj
->
exec
();
}
outputStats
(
QStringLiteral
(
"removeallcollections"
));
...
...
autotests/mailserializertest.cpp
View file @
388782fe
...
...
@@ -116,7 +116,7 @@ void MailSerializerTest::testEnvelopeDeserialize()
Item
i
;
i
.
setMimeType
(
QStringLiteral
(
"message/rfc822"
));
auto
*
serializer
=
new
SerializerPluginMail
();
auto
serializer
=
new
SerializerPluginMail
();
// envelope
QBuffer
buffer
;
...
...
@@ -205,7 +205,7 @@ void MailSerializerTest::testEnvelopeSerialize()
Item
i
;
i
.
setMimeType
(
QStringLiteral
(
"message/rfc822"
));
auto
*
msg
=
new
Message
();
auto
msg
=
new
Message
();
msg
->
date
()
->
setDateTime
(
date
);
msg
->
subject
()
->
fromUnicodeString
(
subject
,
"UTF-8"
);
msg
->
from
()
->
fromUnicodeString
(
from
,
"UTF-8"
);
...
...
@@ -219,7 +219,7 @@ void MailSerializerTest::testEnvelopeSerialize()
msg
->
references
()
->
fromUnicodeString
(
references
,
"UTF-8"
);
i
.
setPayload
(
KMime
::
Message
::
Ptr
(
msg
));
auto
*
serializer
=
new
SerializerPluginMail
();
auto
serializer
=
new
SerializerPluginMail
();
// envelope
QByteArray
env
;
...
...
@@ -240,11 +240,11 @@ void MailSerializerTest::testParts()
{
Item
item
;
item
.
setMimeType
(
QStringLiteral
(
"message/rfc822"
));
auto
*
m
=
new
Message
;
auto
m
=
new
Message
;
KMime
::
Message
::
Ptr
msg
(
m
);
item
.
setPayload
(
msg
);
auto
*
serializer
=
new
SerializerPluginMail
();
auto
serializer
=
new
SerializerPluginMail
();
QVERIFY
(
serializer
->
parts
(
item
).
isEmpty
());
msg
->
setHead
(
"foo"
);
...
...
@@ -268,7 +268,7 @@ void MailSerializerTest::testHeaderFetch()
Item
i
;
i
.
setMimeType
(
QStringLiteral
(
"message/rfc822"
));
auto
*
serializer
=
new
SerializerPluginMail
();
auto
serializer
=
new
SerializerPluginMail
();
QByteArray
headerData
(
"From: David Johnson <david@usermode.org>
\n
"
"To: kde-commits@kde.org
\n
"
...
...
@@ -307,7 +307,7 @@ void MailSerializerTest::testMultiDeserialize()
Item
i
;
i
.
setMimeType
(
QStringLiteral
(
"message/rfc822"
));
auto
*
serializer
=
new
SerializerPluginMail
();
auto
serializer
=
new
SerializerPluginMail
();
QByteArray
messageData
(
"From: David Johnson <david@usermode.org>
\n
"
"To: kde-commits@kde.org
\n
"
...
...
serializers/akonadi_serializer_mail.cpp
View file @
388782fe
...
...
@@ -88,7 +88,7 @@ bool SerializerPluginMail::deserialize(Item &item, const QByteArray &label, QIOD
KMime
::
Message
::
Ptr
msg
;
if
(
!
item
.
hasPayload
())
{
auto
*
m
=
new
Message
();
auto
m
=
new
Message
();
msg
=
KMime
::
Message
::
Ptr
(
m
);
item
.
setPayload
(
msg
);
}
else
{
...
...
src/emptytrashcommand.cpp
View file @
388782fe
...
...
@@ -88,7 +88,7 @@ void EmptyTrashCommand::execute()
void
EmptyTrashCommand
::
expunge
(
const
Akonadi
::
Collection
&
col
)
{
if
(
col
.
isValid
())
{
auto
*
jobDelete
=
new
Akonadi
::
ItemDeleteJob
(
col
,
this
);
auto
jobDelete
=
new
Akonadi
::
ItemDeleteJob
(
col
,
this
);
connect
(
jobDelete
,
&
Akonadi
::
ItemDeleteJob
::
result
,
this
,
[
this
,
jobDelete
]()
{
if
(
jobDelete
->
error
())
{
...
...
src/markascommand.cpp
View file @
388782fe
...
...
@@ -70,7 +70,7 @@ void MarkAsCommand::slotCollectionFetchDone(KJob *job)
return
;
}
auto
*
fjob
=
static_cast
<
Akonadi
::
CollectionFetchJob
*>
(
job
);
auto
fjob
=
static_cast
<
Akonadi
::
CollectionFetchJob
*>
(
job
);
d
->
mFolders
+=
fjob
->
collections
();
d
->
mFolderListJobCount
=
d
->
mFolders
.
size
();
...
...
@@ -90,7 +90,7 @@ void MarkAsCommand::slotFetchDone(KJob *job)
return
;
}
auto
*
fjob
=
static_cast
<
Akonadi
::
ItemFetchJob
*>
(
job
);
auto
fjob
=
static_cast
<
Akonadi
::
ItemFetchJob
*>
(
job
);
d
->
mMessages
.
clear
();
const
auto
items
=
fjob
->
items
();
for
(
const
Akonadi
::
Item
&
item
:
items
)
{
...
...
@@ -113,7 +113,7 @@ void MarkAsCommand::slotFetchDone(KJob *job)
markMessages
();
}
if
(
d
->
mFolderListJobCount
>
0
)
{
auto
*
job
=
new
Akonadi
::
ItemFetchJob
(
d
->
mFolders
[
d
->
mFolderListJobCount
-
1
],
parent
());
auto
job
=
new
Akonadi
::
ItemFetchJob
(
d
->
mFolders
[
d
->
mFolderListJobCount
-
1
],
parent
());
job
->
fetchScope
().
setAncestorRetrieval
(
Akonadi
::
ItemFetchScope
::
Parent
);
connect
(
job
,
&
Akonadi
::
ItemFetchJob
::
result
,
this
,
&
MarkAsCommand
::
slotFetchDone
);
}
...
...
@@ -125,14 +125,14 @@ void MarkAsCommand::execute()
if
(
KMessageBox
::
questionYesNo
(
qobject_cast
<
QWidget
*>
(
parent
()),
i18n
(
"Are you sure you want to mark all messages in this folder and all its subfolders?"
),
i18n
(
"Mark All Recursively"
))
==
KMessageBox
::
Yes
)
{
auto
*
job
=
new
Akonadi
::
CollectionFetchJob
(
d
->
mFolders
.
constFirst
());
auto
job
=
new
Akonadi
::
CollectionFetchJob
(
d
->
mFolders
.
constFirst
());
connect
(
job
,
&
Akonadi
::
CollectionFetchJob
::
result
,
this
,
&
MarkAsCommand
::
slotCollectionFetchDone
);
}
else
{
emitResult
(
Canceled
);
}
}
else
if
(
!
d
->
mFolders
.
isEmpty
())
{
//yes, we go backwards, shouldn't matter
auto
*
job
=
new
Akonadi
::
ItemFetchJob
(
d
->
mFolders
[
d
->
mFolderListJobCount
-
1
],
parent
());
auto
job
=
new
Akonadi
::
ItemFetchJob
(
d
->
mFolders
[
d
->
mFolderListJobCount
-
1
],
parent
());
job
->
fetchScope
().
setAncestorRetrieval
(
Akonadi
::
ItemFetchScope
::
Parent
);
connect
(
job
,
&
Akonadi
::
ItemFetchJob
::
result
,
this
,
&
MarkAsCommand
::
slotFetchDone
);
}
else
if
(
!
d
->
mMessages
.
isEmpty
())
{
...
...
@@ -177,7 +177,7 @@ void MarkAsCommand::markMessages()
if
(
itemsToModify
.
isEmpty
())
{
slotModifyItemDone
(
nullptr
);
// pretend we did something
}
else
{
auto
*
modifyJob
=
new
Akonadi
::
ItemModifyJob
(
itemsToModify
,
this
);
auto
modifyJob
=
new
Akonadi
::
ItemModifyJob
(
itemsToModify
,
this
);
modifyJob
->
setIgnorePayload
(
true
);
modifyJob
->
disableRevisionCheck
();
connect
(
modifyJob
,
&
Akonadi
::
ItemModifyJob
::
result
,
this
,
&
MarkAsCommand
::
slotModifyItemDone
);
...
...
src/messagemodel.cpp
View file @
388782fe
...
...
@@ -21,7 +21,7 @@
#include <array>
typedef
KMime
::
Message
::
Ptr
MessagePtr
;
using
MessagePtr
=
KMime
::
Message
::
Ptr
;
using
namespace
Akonadi
;
...
...
src/movecommand.cpp
View file @
388782fe
...
...
@@ -43,10 +43,10 @@ void MoveCommand::execute()
return
;
}
if
(
d
->
mDestFolder
.
isValid
())
{
auto
*
job
=
new
Akonadi
::
ItemMoveJob
(
d
->
mMessages
,
d
->
mDestFolder
,
this
);
auto
job
=
new
Akonadi
::
ItemMoveJob
(
d
->
mMessages
,
d
->
mDestFolder
,
this
);
connect
(
job
,
&
Akonadi
::
ItemMoveJob
::
result
,
this
,
&
MoveCommand
::
slotMoveResult
);
}
else
{
auto
*
job
=
new
Akonadi
::
ItemDeleteJob
(
d
->
mMessages
,
this
);
auto
job
=
new
Akonadi
::
ItemDeleteJob
(
d
->
mMessages
,
this
);
connect
(
job
,
&
Akonadi
::
ItemDeleteJob
::
result
,
this
,
&
MoveCommand
::
slotMoveResult
);
}
}
...
...
src/movetotrashcommand.cpp
View file @
388782fe
...
...
@@ -44,13 +44,13 @@ void MoveToTrashCommand::slotFetchDone(KJob *job)
return
;
}
auto
*
fjob
=
static_cast
<
Akonadi
::
ItemFetchJob
*>
(
job
);
auto
fjob
=
static_cast
<
Akonadi
::
ItemFetchJob
*>
(
job
);
mMessages
=
fjob
->
items
();
moveMessages
();
if
(
mFolderListJobCount
>
0
)
{
auto
*
job
=
new
Akonadi
::
ItemFetchJob
(
mFolders
[
mFolderListJobCount
-
1
],
parent
());
auto
job
=
new
Akonadi
::
ItemFetchJob
(
mFolders
[
mFolderListJobCount
-
1
],
parent
());
job
->
fetchScope
().
setAncestorRetrieval
(
Akonadi
::
ItemFetchScope
::
Parent
);
connect
(
job
,
&
Akonadi
::
ItemFetchJob
::
result
,
this
,
&
MoveToTrashCommand
::
slotFetchDone
);
}
...
...
@@ -59,7 +59,7 @@ void MoveToTrashCommand::slotFetchDone(KJob *job)
void
MoveToTrashCommand
::
execute
()
{
if
(
!
mFolders
.
isEmpty
())
{
auto
*
job
=
new
Akonadi
::
ItemFetchJob
(
mFolders
[
mFolderListJobCount
-
1
],
parent
());
auto
job
=
new
Akonadi
::
ItemFetchJob
(
mFolders
[
mFolderListJobCount
-
1
],
parent
());
job
->
fetchScope
().
setAncestorRetrieval
(
Akonadi
::
ItemFetchScope
::
Parent
);
connect
(
job
,
&
Akonadi
::
ItemFetchJob
::
result
,
this
,
&
MoveToTrashCommand
::
slotFetchDone
);
}
else
if
(
!
mMessages
.
isEmpty
())
{
...
...
@@ -74,7 +74,7 @@ void MoveToTrashCommand::moveMessages()
{
const
Akonadi
::
Collection
folder
=
mFolders
.
at
(
mFolderListJobCount
);
if
(
folder
.
isValid
())
{
MoveCommand
*
moveCommand
=
new
MoveCommand
(
findTrashFolder
(
folder
),
mMessages
,
this
);
auto
moveCommand
=
new
MoveCommand
(
findTrashFolder
(
folder
),
mMessages
,
this
);
connect
(
moveCommand
,
&
MoveCommand
::
result
,
this
,
&
MoveToTrashCommand
::
slotMoveDone
);
moveCommand
->
execute
();
}
else
{
...
...
src/newmailnotifierattribute.cpp
View file @
388782fe
...
...
@@ -28,7 +28,7 @@ NewMailNotifierAttribute::~NewMailNotifierAttribute() = default;
NewMailNotifierAttribute
*
NewMailNotifierAttribute
::
clone
()
const
{
auto
*
attr
=
new
NewMailNotifierAttribute
();
auto
attr
=
new
NewMailNotifierAttribute
();
attr
->
setIgnoreNewMail
(
ignoreNewMail
());
return
attr
;
}
...
...
src/pop3resourceattribute.cpp
View file @
388782fe
...
...
@@ -27,7 +27,7 @@ Pop3ResourceAttribute::~Pop3ResourceAttribute() = default;
Pop3ResourceAttribute
*
Pop3ResourceAttribute
::
clone
()
const
{
auto
*
attr
=
new
Pop3ResourceAttribute
();
auto
attr
=
new
Pop3ResourceAttribute
();
attr
->
setPop3AccountName
(
pop3AccountName
());
return
attr
;
}
...
...
src/removeduplicatesjob.cpp
View file @
388782fe
...
...
@@ -29,7 +29,7 @@ public:
Akonadi
::
Collection
collection
=
mFolders
.
value
(
mJobCount
-
1
);
qCDebug
(
AKONADIMIME_LOG
)
<<
"Processing collection"
<<
collection
.
name
()
<<
"("
<<
collection
.
id
()
<<
")"
;
auto
*
job
=
new
Akonadi
::
ItemFetchJob
(
collection
,
mParent
);
auto
job
=
new
Akonadi
::
ItemFetchJob
(
collection
,
mParent
);
job
->
fetchScope
().
setAncestorRetrieval
(
Akonadi
::
ItemFetchScope
::
Parent
);
job
->
fetchScope
().
fetchFullPayload
();
job
->
fetchScope
().
setIgnoreRetrievalErrors
(
true
);
...
...
@@ -58,7 +58,7 @@ public:
Q_EMIT
mParent
->
description
(
mParent
,
i18n
(
"Searching for duplicates..."
));
auto
*
fjob
=
static_cast
<
Akonadi
::
ItemFetchJob
*>
(
job
);
auto
fjob
=
static_cast
<
Akonadi
::
ItemFetchJob
*>
(
job
);
Akonadi
::
Item
::
List
items
=
fjob
->
items
();
//find duplicate mails with the same messageid
...
...
@@ -116,7 +116,7 @@ public:
return
;
}
else
{
Q_EMIT
mParent
->
description
(
mParent
,
i18n
(
"Removing duplicates..."
));
auto
*
delCmd
=
new
Akonadi
::
ItemDeleteJob
(
mDuplicateItems
,
mParent
);
auto
delCmd
=
new
Akonadi
::
ItemDeleteJob
(
mDuplicateItems
,
mParent
);
mParent
->
connect
(
delCmd
,
&
ItemDeleteJob
::
result
,
mParent
,
[
this
](
KJob
*
job
)
{
slotDeleteDone
(
job
);
});
...
...
src/standardmailactionmanager.cpp
View file @
388782fe
...
...
@@ -516,7 +516,7 @@ public:
return
;
}
auto
*
command
=
new
MarkAsCommand
(
targetStatus
,
items
,
invert
,
mParent
);
auto
command
=
new
MarkAsCommand
(
targetStatus
,
items
,
invert
,
mParent
);
command
->
execute
();
}
...
...
@@ -569,7 +569,7 @@ public:
return
;
}
auto
*
command
=
new
MarkAsCommand
(
targetStatus
,
collections
,
invert
,
recursive
,
mParent
);
auto
command
=
new
MarkAsCommand
(
targetStatus
,
collections
,
invert
,
recursive
,
mParent
);
command
->
execute
();
}
...
...
@@ -601,7 +601,7 @@ public:
return
;
}
auto
*
command
=
new
MoveToTrashCommand
(
mCollectionSelectionModel
->
model
(),
items
,
mParent
);
auto
command
=
new
MoveToTrashCommand
(
mCollectionSelectionModel
->
model
(),
items
,
mParent
);
command
->
execute
();
}
...
...
@@ -620,7 +620,7 @@ public:
return
;
}
auto
*
command
=
new
MoveToTrashCommand
(
mCollectionSelectionModel
->
model
(),
collections
,
mParent
);
auto
command
=
new
MoveToTrashCommand
(
mCollectionSelectionModel
->
model
(),
collections
,
mParent
);
command
->
execute
();
}
...
...
@@ -635,7 +635,7 @@ public:
return
;
}
auto
*
job
=
new
RemoveDuplicatesJob
(
collections
,
mParent
);
auto
job
=
new
RemoveDuplicatesJob
(
collections
,
mParent
);
connect
(
job
,
&
RemoveDuplicatesJob
::
finished
,
mParent
,
[
this
](
KJob
*
job
)
{
slotJobFinished
(
job
);
});
...
...
@@ -654,7 +654,7 @@ public:
return
;
}
auto
*
command
=
new
EmptyTrashCommand
(
const_cast
<
QAbstractItemModel
*>
(
mCollectionSelectionModel
->
model
()),
mParent
);
auto
command
=
new
EmptyTrashCommand
(
const_cast
<
QAbstractItemModel
*>
(
mCollectionSelectionModel
->
model
()),
mParent
);
command
->
execute
();
}
...
...
@@ -673,7 +673,7 @@ public:
return
;
}
auto
*
command
=
new
EmptyTrashCommand
(
collections
.
first
(),
mParent
);
auto
command
=
new
EmptyTrashCommand
(
collections
.
first
(),
mParent
);
command
->
execute
();
}
...
...
src/util.cpp
View file @
388782fe
...
...
@@ -23,7 +23,7 @@ void showJobError(KJob *job)
assert
(
job
);
// we can be called from the KJob::kill, where we are no longer a KIO::Job
// so better safe than sorry
auto
*
kiojob
=
qobject_cast
<
KIO
::
Job
*>
(
job
);
auto
kiojob
=
qobject_cast
<
KIO
::
Job
*>
(
job
);
if
(
kiojob
&&
kiojob
->
uiDelegate
())
{
kiojob
->
uiDelegate
()
->
showErrorMessage
();
}
else
{
...
...
tests/foldersrequester.cpp
View file @
388782fe
...
...
@@ -22,7 +22,7 @@ Requester::Requester()
{
Control
::
start
();
auto
*
rjob
=
new
SpecialMailCollectionsRequestJob
(
this
);
auto
rjob
=
new
SpecialMailCollectionsRequestJob
(
this
);
rjob
->
requestDefaultCollection
(
SpecialMailCollections
::
Outbox
);
connect
(
rjob
,
&
SpecialMailCollectionsRequestJob
::
result
,
this
,
&
Requester
::
requestResult
);
rjob
->
start
();
...
...
tests/headfetcher.cpp
View file @
388782fe
...
...
@@ -30,11 +30,11 @@ HeadFetcher::HeadFetcher(bool multipart)
// fetch all headers from each folder
timer
.
start
();
qDebug
()
<<
"Listing all headers of every folder, using"
<<
(
multipart
?
"multi"
:
"single"
)
<<
"part."
;
CollectionFetchJob
*
clj
=
new
CollectionFetchJob
(
Collection
::
root
(),
CollectionFetchJob
::
Recursive
);
auto
clj
=
new
CollectionFetchJob
(
Collection
::
root
(),
CollectionFetchJob
::
Recursive
);
clj
->
exec
();
const
Collection
::
List
list
=
clj
->
collections
();
for
(
const
Collection
&
collection
:
list
)
{
auto
*
ifj
=
new
ItemFetchJob
(
collection
,
this
);
auto
ifj
=
new
ItemFetchJob
(
collection
,
this
);
if
(
multipart
)
{
ifj
->
fetchScope
().
fetchPayloadPart
(
MessagePart
::
Envelope
);
}
else
{
...
...
Write
Preview
Supports
Markdown
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