Commit 088aee38 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Minor optimization

parent 14620025
......@@ -554,6 +554,15 @@ bool AutoCorrection::autoBoldUnderline()
return true;
}
QColor AutoCorrection::linkColor()
{
if (mLinkColor.isValid()) {
return mLinkColor;
}
mLinkColor = KColorScheme(QPalette::Active, KColorScheme::View).foreground(KColorScheme::LinkText).color();
return mLinkColor;
}
bool AutoCorrection::autoFormatURLs()
{
if (!mAutoFormatUrl) {
......@@ -575,8 +584,8 @@ bool AutoCorrection::autoFormatURLs()
format.setFontItalic(true);
format.setAnchor(true);
format.setUnderlineStyle(QTextCharFormat::SingleUnderline);
format.setUnderlineColor(KColorScheme(QPalette::Active, KColorScheme::View).foreground(KColorScheme::LinkText).color());
format.setForeground(KColorScheme(QPalette::Active, KColorScheme::View).foreground(KColorScheme::LinkText).color());
format.setUnderlineColor(linkColor());
format.setForeground(linkColor());
mCursor.mergeCharFormat(format);
mWord = mCursor.selectedText();
......
......@@ -113,6 +113,7 @@ private:
QString autoDetectURL(const QString &_word) const;
void readAutoCorrectionXmlFile(bool forceGlobal = false);
bool excludeToUppercase(const QString &word) const;
QColor linkColor();
bool mSingleSpaces; // suppress double spaces.
bool mUppercaseFirstCharOfSentence; // convert first letter of a sentence automaticall to uppercase
......@@ -144,6 +145,7 @@ private:
QHash<QString, QString> mSuperScriptEntries;
TypographicQuotes mTypographicSingleQuotes;
TypographicQuotes mTypographicDoubleQuotes;
QColor mLinkColor;
};
}
......
Supports Markdown
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