Commit 96da2c0c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Minor attachment

parent 174f3d57
......@@ -57,7 +57,6 @@ void DKIMGenerateRuleJob::verifyAndGenerateRule()
rule.setEnabled(true);
rule.setFrom(mResult.fromEmail);
//TODO add Domain when we create a rule from base domain.
//rule.setDomain(mResult.signedBy); //TODO verify ?
rule.setSignedDomainIdentifier(QStringList() << mResult.sdid);
rule.setRuleType(DKIMRule::RuleType::MustBeSigned);
deleteLater();
......
......@@ -842,11 +842,7 @@ void ViewerPrivate::displayMessage()
//TODO: Insert link to clear error so that message might be resent
const ErrorAttribute *const attr = mMessageItem.attribute<ErrorAttribute>();
Q_ASSERT(attr);
if (!mForegroundError.isValid()) {
const KColorScheme scheme = KColorScheme(QPalette::Active, KColorScheme::View);
mForegroundError = scheme.foreground(KColorScheme::NegativeText).color();
mBackgroundError = scheme.background(KColorScheme::NegativeBackground).color();
}
initializeColorFromScheme();
htmlWriter()->write(QStringLiteral(
"<div style=\"background:%1;color:%2;border:1px solid %2\">%3</div>").arg(
......@@ -2396,11 +2392,20 @@ HeaderStylePlugin *ViewerPrivate::headerStylePlugin() const
return mHeaderStylePlugin;
}
QString ViewerPrivate::attachmentHtml() const
void ViewerPrivate::initializeColorFromScheme()
{
if (!mForegroundError.isValid()) {
const KColorScheme scheme = KColorScheme(QPalette::Active, KColorScheme::View);
mForegroundError = scheme.foreground(KColorScheme::NegativeText).color();
mBackgroundError = scheme.background(KColorScheme::NegativeBackground).color();
mBackgroundAttachment = scheme.background().color();
}
}
QString ViewerPrivate::attachmentHtml()
{
const QColor background
= KColorScheme(QPalette::Active, KColorScheme::View).background().color();
QString html = renderAttachments(mMessage.data(), background);
initializeColorFromScheme();
QString html = renderAttachments(mMessage.data(), mBackgroundAttachment);
if (!html.isEmpty()) {
const bool isFancyTheme = (headerStylePlugin()->name() == QLatin1String("fancy"));
if (isFancyTheme) {
......
......@@ -587,7 +587,8 @@ Q_SIGNALS:
void showNextMessage();
void showPreviousMessage();
private:
Q_REQUIRED_RESULT QString attachmentHtml() const;
Q_REQUIRED_RESULT QString attachmentHtml();
void initializeColorFromScheme();
void replyMessageToAuthor(KMime::Content *atmNode);
void replyMessageToAll(KMime::Content *atmNode);
......@@ -670,6 +671,7 @@ public:
QColor mForegroundError;
QColor mBackgroundError;
QColor mBackgroundAttachment;
Viewer *const q;
Akonadi::Session *mSession = nullptr;
......
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