summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-10-09 07:05:10 (GMT)
committerMontel Laurent <montel@kde.org>2016-10-09 07:05:10 (GMT)
commitda070943c4fc6e8a52ae64d8a87659d5d3c15553 (patch)
tree4324993419bb64a88e93e56b20bc66cbca9a0e52
parent711930d831964515536de61e33e25996fcca7a60 (diff)
Now we have just one quote font.
-rw-r--r--messageviewer/src/messagepartthemes/default/autotests/testcsshelper.cpp6
-rw-r--r--messageviewer/src/viewer/csshelper.cpp10
-rw-r--r--messageviewer/src/viewer/csshelperbase.cpp10
-rw-r--r--messageviewer/src/viewer/csshelperbase.h2
4 files changed, 9 insertions, 19 deletions
diff --git a/messageviewer/src/messagepartthemes/default/autotests/testcsshelper.cpp b/messageviewer/src/messagepartthemes/default/autotests/testcsshelper.cpp
index 1f34fde..0fcf238 100644
--- a/messageviewer/src/messagepartthemes/default/autotests/testcsshelper.cpp
+++ b/messageviewer/src/messagepartthemes/default/autotests/testcsshelper.cpp
@@ -56,9 +56,7 @@ TestCSSHelper::TestCSSHelper(const QPaintDevice *pd) :
mFixedFont = defaultFont;
mFixedPrintFont = defaultFont;
defaultFont.setItalic(true);
- for (int i = 0; i < 3; ++i) {
- mQuoteFont[i] = defaultFont;
- }
+ mQuoteFont = defaultFont;
mShrinkQuotes = false;
@@ -87,4 +85,4 @@ QString TestCSSHelper::htmlHead(bool fixed) const
QStringLiteral("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n"
"<html>\n"
"<body>\n");
-} \ No newline at end of file
+}
diff --git a/messageviewer/src/viewer/csshelper.cpp b/messageviewer/src/viewer/csshelper.cpp
index edfb6f3..31091f7 100644
--- a/messageviewer/src/viewer/csshelper.cpp
+++ b/messageviewer/src/viewer/csshelper.cpp
@@ -85,9 +85,7 @@ CSSHelper::CSSHelper(const QPaintDevice *pd)
mPrintFont = MessageCore::MessageCoreSettings::self()->useDefaultFonts() ? defaultFont : MessageViewer::MessageViewerSettings::self()->printFont();
mFixedFont = mFixedPrintFont = defaultFixedFont;
defaultFont.setItalic(true);
- for (int i = 0; i < 3; ++i) {
- mQuoteFont[i] = defaultFont;
- }
+ mQuoteFont = defaultFont;
KConfig *config = MessageViewer::MessageViewerSettings::self()->config();
@@ -121,12 +119,6 @@ CSSHelper::CSSHelper(const QPaintDevice *pd)
mPrintFont = fonts.readEntry("print-font", mPrintFont);
mFixedFont = fonts.readEntry("fixed-font", mFixedFont);
mFixedPrintFont = mFixedFont; // FIXME when we have a separate fixed print font
- QFont defaultFont = mBodyFont;
- defaultFont.setItalic(true);
- for (int i = 0; i < 3; ++i) {
- const QString key = QStringLiteral("quote%1-font").arg(i + 1);
- mQuoteFont[i] = fonts.readEntry(key, defaultFont);
- }
}
mShrinkQuotes = MessageViewer::MessageViewerSettings::self()->shrinkQuotes();
diff --git a/messageviewer/src/viewer/csshelperbase.cpp b/messageviewer/src/viewer/csshelperbase.cpp
index 8825851..6bf6ddd 100644
--- a/messageviewer/src/viewer/csshelperbase.cpp
+++ b/messageviewer/src/viewer/csshelperbase.cpp
@@ -185,7 +185,7 @@ QString CSSHelperBase::quoteFontTag(int level) const
if (level < 0) {
level = 0;
}
- static const int numQuoteLevels = sizeof mQuoteFont / sizeof * mQuoteFont;
+ static const int numQuoteLevels = 3;
const int effectiveLevel = mRecycleQuoteColors
? level % numQuoteLevels + 1
: qMin(level + 1, numQuoteLevels);
@@ -364,10 +364,10 @@ QString CSSHelperBase::screenCssDefinitions(const CSSHelperBase *helper, bool fi
quoteCSS += QStringLiteral("div.quotelevel%1 {\n"
" color: %2 ! important;\n")
.arg(QString::number(i + 1), quoteColorName(i));
- if (mQuoteFont[i].italic()) {
+ if (mQuoteFont.italic()) {
quoteCSS += QLatin1String(" font-style: italic ! important;\n");
}
- if (mQuoteFont[i].bold()) {
+ if (mQuoteFont.bold()) {
quoteCSS += QLatin1String(" font-weight: bold ! important;\n");
}
if (mShrinkQuotes)
@@ -381,10 +381,10 @@ QString CSSHelperBase::screenCssDefinitions(const CSSHelperBase *helper, bool fi
quoteCSS += QStringLiteral("div.deepquotelevel%1 {\n"
" color: %2 ! important;\n")
.arg(QString::number(i + 1), quoteColorName(i));
- if (mQuoteFont[i].italic()) {
+ if (mQuoteFont.italic()) {
quoteCSS += QLatin1String(" font-style: italic ! important;\n");
}
- if (mQuoteFont[i].bold()) {
+ if (mQuoteFont.bold()) {
quoteCSS += QLatin1String(" font-weight: bold ! important;\n");
}
if (mShrinkQuotes) {
diff --git a/messageviewer/src/viewer/csshelperbase.h b/messageviewer/src/viewer/csshelperbase.h
index 6a88e26..309bf6a 100644
--- a/messageviewer/src/viewer/csshelperbase.h
+++ b/messageviewer/src/viewer/csshelperbase.h
@@ -90,7 +90,7 @@ protected:
QFont mPrintFont;
QFont mFixedFont;
QFont mFixedPrintFont;
- QFont mQuoteFont[3];
+ QFont mQuoteFont;
QColor mQuoteColor[3];
bool mRecycleQuoteColors;
bool mShrinkQuotes;