Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
KDE PIM Add-ons
Commits
d9d3c5d4
Commit
d9d3c5d4
authored
May 19, 2017
by
Sandro Knauß
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update API usage of mimetreeparser
see: T6166
parent
56175d91
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
17 additions
and
39 deletions
+17
-39
CMakeLists.txt
CMakeLists.txt
+1
-1
plugins/messageviewer/bodypartformatter/autotests/testobjecttreesource.h
...viewer/bodypartformatter/autotests/testobjecttreesource.h
+0
-5
plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp
...essageviewer/bodypartformatter/calendar/text_calendar.cpp
+6
-9
plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.cpp
...geviewer/bodypartformatter/gnupgwks/gnupgwksformatter.cpp
+1
-6
plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.h
...sageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.h
+0
-1
plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.cpp
...sageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.cpp
+4
-8
plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.h
...essageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.h
+0
-1
plugins/messageviewer/bodypartformatter/vcard/text_vcard.cpp
plugins/messageviewer/bodypartformatter/vcard/text_vcard.cpp
+5
-8
No files found.
CMakeLists.txt
View file @
d9d3c5d4
...
...
@@ -70,7 +70,7 @@ set(LIBKLEO_LIB_VERSION "5.5.40")
set
(
AKONADI_LIB_VERSION
"5.5.40"
)
set
(
INCIDENCEEDITOR_LIB_VERSION
"5.5.40"
)
set
(
KTNEF_LIB_VERSION
"5.5.40"
)
set
(
MESSAGELIB_LIB_VERSION
"5.5.4
1
"
)
set
(
MESSAGELIB_LIB_VERSION
"5.5.4
4
"
)
set
(
AKONADICALENDAR_LIB_VERSION
"5.5.40"
)
set
(
CALENDAR_UTILS_VERSION
"5.5.40"
)
set
(
KPIMTEXTEDIT_LIB_VERSION
"5.5.40"
)
...
...
plugins/messageviewer/bodypartformatter/autotests/testobjecttreesource.h
View file @
d9d3c5d4
...
...
@@ -92,11 +92,6 @@ public:
return
MimeTreeParser
::
AttachmentStrategy
::
smart
();
}
QObject
*
sourceObject
()
Q_DECL_OVERRIDE
{
return
nullptr
;
}
bool
autoImportKeys
()
const
Q_DECL_OVERRIDE
{
return
false
;
...
...
plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp
View file @
d9d3c5d4
...
...
@@ -181,19 +181,16 @@ private:
class
Formatter
:
public
MimeTreeParser
::
Interface
::
BodyPartFormatter
{
public:
Result
format
(
MimeTreeParser
::
Interface
::
BodyPart
*
part
,
MimeTreeParser
::
HtmlWriter
*
writer
)
const
Q_DECL_OVERRIDE
{
return
format
(
part
,
writer
,
nullptr
);
}
Result
format
(
MimeTreeParser
::
Interface
::
BodyPart
*
bodyPart
,
MimeTreeParser
::
HtmlWriter
*
writer
,
QObject
*
asyncResultObserver
)
const
Q_DECL_OVERRIDE
Result
format
(
MimeTreeParser
::
Interface
::
BodyPart
*
bodyPart
,
MimeTreeParser
::
HtmlWriter
*
writer
)
const
Q_DECL_OVERRIDE
{
if
(
!
writer
)
{
// Guard against crashes in createReply()
return
Ok
;
}
if
(
!
asyncResultObserver
)
{
auto
nodeHelper
=
bodyPart
->
nodeHelper
();
if
(
!
nodeHelper
)
{
return
Ok
;
}
...
...
@@ -239,8 +236,8 @@ public:
}
else
{
MemoryCalendarMemento
*
memento
=
new
MemoryCalendarMemento
();
bodyPart
->
setBodyPartMemento
(
memento
);
QObject
::
connect
(
memento
,
SIGNAL
(
update
(
MimeTreeParser
::
U
pdate
Mode
))
,
asyncResultObserver
,
SLOT
(
update
(
MimeTreeParser
::
UpdateMode
))
);
QObject
::
connect
(
memento
,
&
MemoryCalendarMemento
::
u
pdate
,
nodeHelper
,
&
MimeTreeParser
::
NodeHelper
::
update
);
}
return
Ok
;
...
...
plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.cpp
View file @
d9d3c5d4
...
...
@@ -71,11 +71,6 @@ Interface::MessagePart::Ptr ApplicationGnuPGWKSFormatter::process(BodyPart &part
}
BodyPartFormatter
::
Result
ApplicationGnuPGWKSFormatter
::
format
(
BodyPart
*
part
,
MimeTreeParser
::
HtmlWriter
*
writer
)
const
{
return
format
(
part
,
writer
,
nullptr
);
}
BodyPartFormatter
::
Result
ApplicationGnuPGWKSFormatter
::
format
(
BodyPart
*
part
,
MimeTreeParser
::
HtmlWriter
*
writer
,
QObject
*
obj
)
const
{
if
(
!
writer
)
{
return
Ok
;
...
...
@@ -86,7 +81,7 @@ BodyPartFormatter::Result ApplicationGnuPGWKSFormatter::format(BodyPart *part, M
const
auto
mixed
=
registry
.
find
(
"mixed"
);
Q_ASSERT
(
mixed
!=
registry
.
end
());
// there *must* be a multipart/mixed handler
return
mixed
->
second
->
format
(
part
,
writer
,
obj
);
return
mixed
->
second
->
format
(
part
,
writer
);
}
const
auto
content
=
part
->
content
()
->
decodedContent
();
...
...
plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.h
View file @
d9d3c5d4
...
...
@@ -33,7 +33,6 @@ public:
MimeTreeParser
::
Interface
::
MessagePart
::
Ptr
process
(
MimeTreeParser
::
Interface
::
BodyPart
&
part
)
const
Q_DECL_OVERRIDE
;
MimeTreeParser
::
Interface
::
BodyPartFormatter
::
Result
format
(
MimeTreeParser
::
Interface
::
BodyPart
*
part
,
MimeTreeParser
::
HtmlWriter
*
writer
)
const
Q_DECL_OVERRIDE
;
MimeTreeParser
::
Interface
::
BodyPartFormatter
::
Result
format
(
MimeTreeParser
::
Interface
::
BodyPart
*
part
,
MimeTreeParser
::
HtmlWriter
*
writer
,
QObject
*
asyncResultObserver
)
const
Q_DECL_OVERRIDE
;
private:
enum
WKSStatus
{
...
...
plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.cpp
View file @
d9d3c5d4
...
...
@@ -37,11 +37,6 @@
using
namespace
MimeTreeParser
::
Interface
;
BodyPartFormatter
::
Result
ApplicationPGPKeyFormatter
::
format
(
BodyPart
*
part
,
MimeTreeParser
::
HtmlWriter
*
writer
)
const
{
return
format
(
part
,
writer
,
nullptr
);
}
BodyPartFormatter
::
Result
ApplicationPGPKeyFormatter
::
format
(
BodyPart
*
part
,
MimeTreeParser
::
HtmlWriter
*
writer
,
QObject
*
asyncResultObserver
)
const
{
if
(
!
writer
)
{
return
Ok
;
...
...
@@ -52,9 +47,10 @@ BodyPartFormatter::Result ApplicationPGPKeyFormatter::format(BodyPart *part, Mim
if
(
!
m
)
{
auto
memento
=
new
PgpKeyMemento
();
if
(
asyncResultObserver
)
{
QObject
::
connect
(
memento
,
SIGNAL
(
update
(
MimeTreeParser
::
UpdateMode
)),
asyncResultObserver
,
SLOT
(
update
(
MimeTreeParser
::
UpdateMode
)));
auto
nodeHelper
=
part
->
nodeHelper
();
if
(
nodeHelper
)
{
QObject
::
connect
(
memento
,
&
PgpKeyMemento
::
update
,
nodeHelper
,
&
MimeTreeParser
::
NodeHelper
::
update
);
memento
->
start
(
mp
.
fingerprint
());
}
else
{
memento
->
exec
(
mp
.
fingerprint
());
...
...
plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.h
View file @
d9d3c5d4
...
...
@@ -30,7 +30,6 @@ public:
ApplicationPGPKeyFormatter
()
=
default
;
MimeTreeParser
::
Interface
::
BodyPartFormatter
::
Result
format
(
MimeTreeParser
::
Interface
::
BodyPart
*
part
,
MimeTreeParser
::
HtmlWriter
*
writer
)
const
Q_DECL_OVERRIDE
;
MimeTreeParser
::
Interface
::
BodyPartFormatter
::
Result
format
(
MimeTreeParser
::
Interface
::
BodyPart
*
part
,
MimeTreeParser
::
HtmlWriter
*
writer
,
QObject
*
asyncResultObserver
)
const
Q_DECL_OVERRIDE
;
private:
QString
render
(
const
PgpKeyMessagePart
&
mp
)
const
;
...
...
plugins/messageviewer/bodypartformatter/vcard/text_vcard.cpp
View file @
d9d3c5d4
...
...
@@ -70,12 +70,7 @@ public:
{
}
Result
format
(
MimeTreeParser
::
Interface
::
BodyPart
*
part
,
MimeTreeParser
::
HtmlWriter
*
writer
)
const
Q_DECL_OVERRIDE
{
return
format
(
part
,
writer
,
nullptr
);
}
Result
format
(
MimeTreeParser
::
Interface
::
BodyPart
*
bodyPart
,
MimeTreeParser
::
HtmlWriter
*
writer
,
QObject
*
asyncResultObserver
)
const
Q_DECL_OVERRIDE
Result
format
(
MimeTreeParser
::
Interface
::
BodyPart
*
bodyPart
,
MimeTreeParser
::
HtmlWriter
*
writer
)
const
Q_DECL_OVERRIDE
{
if
(
!
writer
)
{
return
Ok
;
...
...
@@ -121,8 +116,10 @@ public:
MessageViewer
::
VcardMemento
*
memento
=
new
MessageViewer
::
VcardMemento
(
lst
);
bodyPart
->
setBodyPartMemento
(
memento
);
if
(
asyncResultObserver
)
{
QObject
::
connect
(
memento
,
SIGNAL
(
update
(
MimeTreeParser
::
UpdateMode
)),
asyncResultObserver
,
SLOT
(
update
(
MimeTreeParser
::
UpdateMode
)));
auto
nodeHelper
=
bodyPart
->
nodeHelper
();
if
(
nodeHelper
)
{
QObject
::
connect
(
memento
,
&
MessageViewer
::
VcardMemento
::
update
,
nodeHelper
,
&
MimeTreeParser
::
NodeHelper
::
update
);
}
}
...
...
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