Commit 433986d0 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

We need a generic method for fixing "export as pdf" feature

parent 2045a183
......@@ -519,7 +519,7 @@ bool Util::saveAttachments(const KMime::Content::List &contents, QWidget *parent
return Util::saveContents(parent, contents, urlList);
}
QString Util::generateMboxFileName(const Akonadi::Item &msgBase)
QString Util::generateFileNameForExtension(const Akonadi::Item &msgBase, const QString &extension)
{
QString fileName;
......@@ -534,12 +534,17 @@ QString Util::generateMboxFileName(const Akonadi::Item &msgBase)
fileName = i18n("message");
}
if (!fileName.endsWith(QLatin1String(".mbox"))) {
fileName += QLatin1String(".mbox");
if (!fileName.endsWith(extension)) {
fileName += extension;
}
return fileName;
}
QString Util::generateMboxFileName(const Akonadi::Item &msgBase)
{
return Util::generateFileNameForExtension(msgBase, QStringLiteral(".mbox"));
}
bool Util::saveMessageInMboxAndGetUrl(QUrl &url, const Akonadi::Item::List &retrievedMsgs, QWidget *parent, bool appendMessages)
{
if (retrievedMsgs.isEmpty()) {
......
......@@ -74,6 +74,7 @@ MESSAGEVIEWER_EXPORT const QTextCodec *codecForName(const QByteArray &_str);
Q_REQUIRED_RESULT MESSAGEVIEWER_EXPORT QString processHtml(const QString &htmlSource, QString &extraHead);
Q_REQUIRED_RESULT MESSAGEVIEWER_EXPORT QByteArray htmlCodec(const QByteArray &data, const QByteArray &currentCodec);
Q_REQUIRED_RESULT MESSAGEVIEWER_EXPORT QString generateFileNameForExtension(const Akonadi::Item &msgBase, const QString &extension);
}
}
Q_DECLARE_METATYPE(KService::Ptr)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment