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
b4319df5
Commit
b4319df5
authored
Mar 30, 2020
by
Laurent Montel
Browse files
Fix export to pdf filename
parent
f15bb39e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/messageactions.cpp
View file @
b4319df5
...
...
@@ -30,6 +30,7 @@
#include
<PimCommonAkonadi/AnnotationDialog>
#include
<MessageCore/MessageCoreSettings>
#include
"MessageCore/MailingList"
#include
<MessageCore/StringUtil>
#include
"messageviewer/messageviewersettings.h"
#include
"messageviewer/headerstyleplugin.h"
...
...
@@ -773,8 +774,15 @@ void MessageActions::slotExportToPdf()
}
auto
email
=
mCurrentItem
.
payload
<
KMime
::
Message
::
Ptr
>
();
const
QString
fileName
=
QFileDialog
::
getSaveFileName
(
mParent
,
i18n
(
"Export to PDF"
),
QDir
::
homePath
()
+
QLatin1Char
(
'/'
)
+
email
->
subject
()
->
asUnicodeString
()
+
QStringLiteral
(
".pdf"
),
QString
fileName
;
fileName
=
MessageCore
::
StringUtil
::
cleanFileName
(
MessageCore
::
StringUtil
::
cleanSubject
(
email
.
data
()).
trimmed
());
fileName
.
remove
(
QLatin1Char
(
'\"'
));
if
(
!
fileName
.
endsWith
(
QLatin1String
(
".pdf"
)))
{
fileName
+=
QLatin1String
(
".pdf"
);
}
fileName
=
QFileDialog
::
getSaveFileName
(
mParent
,
i18n
(
"Export to PDF"
),
QDir
::
homePath
()
+
QLatin1Char
(
'/'
)
+
fileName
,
i18n
(
"PDF document (*.pdf)"
));
if
(
!
fileName
.
isEmpty
())
{
mMessageView
->
viewer
()
->
exportToPdf
(
fileName
);
...
...
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