summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-08 12:37:00 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-08 12:38:59 (GMT)
commit0996f81c43f704cab95f0b49042497b1be8631d2 (patch)
tree05c61d7df9f28a4947b4e69dcfd14dfdd54a1aab
parent1da8e3e709646a560f78c23318133166eb560bb8 (diff)
Use ksyntaxhightling as default
-rw-r--r--CMakeLists.txt11
-rw-r--r--messageviewer/src/CMakeLists.txt5
-rw-r--r--messageviewer/src/config-messageviewer.h.cmake1
-rw-r--r--messageviewer/src/widgets/mailsourcewebengineviewer.cpp8
-rw-r--r--messageviewer/src/widgets/mailsourcewebengineviewer.h4
5 files changed, 2 insertions, 27 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bb69e43..7c75a66 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,6 @@ project(Messagelib)
option(MIMETREEPARSER_ONLY_BUILD "Build only mimetreeparser" FALSE)
option(KDEPIM_ENTERPRISE_BUILD "Enable features specific to the enterprise branch, which are normally disabled. Also, it disables many components not needed for Kontact such as the Kolab client." FALSE)
-option(KDEPIM_KF5SYNTAXHIGHLIGHTING_SUPPORT "Enable this feature if you want to use new kf5 syntax highlighting module." TRUE)
set(KF5_VERSION "5.28.0")
find_package(ECM ${KF5_VERSION} CONFIG REQUIRED)
@@ -69,6 +68,7 @@ if (NOT ${MIMETREEPARSER_ONLY_BUILD})
find_package(KF5WidgetsAddons ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5WindowSystem ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_VERSION} CONFIG REQUIRED)
+ find_package(KF5SyntaxHighlighting ${KF5_VERSION} CONFIG REQUIRED)
find_package(Grantlee5 "5.1" CONFIG REQUIRED)
@@ -91,15 +91,6 @@ if (NOT ${MIMETREEPARSER_ONLY_BUILD})
find_package(KF5AkonadiSearch "5.3.80" CONFIG REQUIRED)
set_package_properties(KF5AkonadiSearch PROPERTIES DESCRIPTION "The Akonadi Search libraries" URL "http://www.kde.org" TYPE REQUIRED PURPOSE "Provides search capabilities in KMail and Akonadi")
-
-
- if (KDEPIM_KF5SYNTAXHIGHLIGHTING_SUPPORT)
- find_package(KF5SyntaxHighlighting ${KF5_VERSION})
- if (KF5SyntaxHighlighting_FOUND)
- MESSAGE(STATUS "found KF5SyntaxHighlighting")
- set(KDEPIM_KF5SYNTAXHIGHLIGHTING_SUPPORT true)
- endif()
- endif()
endif()
# Support for the GIT revision number in messagecomposer-version.h
diff --git a/messageviewer/src/CMakeLists.txt b/messageviewer/src/CMakeLists.txt
index b9210ad..a845af9 100644
--- a/messageviewer/src/CMakeLists.txt
+++ b/messageviewer/src/CMakeLists.txt
@@ -214,6 +214,7 @@ target_link_libraries(KF5MessageViewer
KF5::Libkleo
KF5::MimeTreeParser
PRIVATE
+ KF5::SyntaxHighlighting
KF5::ItemViews
Qt5::Network
Qt5::WebKitWidgets
@@ -239,10 +240,6 @@ target_link_libraries(KF5MessageViewer
QGpgme
)
-if (KDEPIM_KF5SYNTAXHIGHLIGHTING_SUPPORT)
- target_link_libraries(KF5MessageViewer PRIVATE KF5::SyntaxHighlighting)
-endif()
-
set_target_properties(KF5MessageViewer PROPERTIES
VERSION ${MESSAGEVIEWER_VERSION_STRING}
SOVERSION ${MESSAGEVIEWER_SOVERSION}
diff --git a/messageviewer/src/config-messageviewer.h.cmake b/messageviewer/src/config-messageviewer.h.cmake
index 5cbb0a9..b35e9b1 100644
--- a/messageviewer/src/config-messageviewer.h.cmake
+++ b/messageviewer/src/config-messageviewer.h.cmake
@@ -1,3 +1,2 @@
#cmakedefine HAVE_SYS_INOTIFY_H 1
#cmakedefine WEBENGINEVIEWER_PRINT_SUPPORT 1
-#cmakedefine KDEPIM_KF5SYNTAXHIGHLIGHTING_SUPPORT 1
diff --git a/messageviewer/src/widgets/mailsourcewebengineviewer.cpp b/messageviewer/src/widgets/mailsourcewebengineviewer.cpp
index 4dd61a7..e207998 100644
--- a/messageviewer/src/widgets/mailsourcewebengineviewer.cpp
+++ b/messageviewer/src/widgets/mailsourcewebengineviewer.cpp
@@ -26,13 +26,9 @@ using namespace MessageViewer;
#include "findbar/findbarsourceview.h"
#include "kpimtextedit/slidecontainer.h"
-#ifdef KDEPIM_KF5SYNTAXHIGHLIGHTING_SUPPORT
#include <KSyntaxHighlighting/SyntaxHighlighter>
#include <KSyntaxHighlighting/Definition>
#include <KSyntaxHighlighting/Theme>
-#else
-#include <kpimtextedit/htmlhighlighter.h>
-#endif
#include "PimCommon/PimUtil"
#include <kiconloader.h>
@@ -70,7 +66,6 @@ MailSourceWebEngineViewer::MailSourceWebEngineViewer(QWidget *parent)
mHtmlBrowser = new MailSourceViewTextBrowserWidget(this);
mTabWidget->addTab(mHtmlBrowser, i18nc("Mail message as shown, in HTML format", "HTML Source"));
mTabWidget->setTabToolTip(1, i18n("HTML code for displaying the message to the user"));
-#ifdef KDEPIM_KF5SYNTAXHIGHLIGHTING_SUPPORT
KSyntaxHighlighting::Definition def;
def = mRepo.definitionForName(QStringLiteral("HTML"));
@@ -79,9 +74,6 @@ MailSourceWebEngineViewer::MailSourceWebEngineViewer(QWidget *parent)
? mRepo.defaultTheme(KSyntaxHighlighting::Repository::DarkTheme)
: mRepo.defaultTheme(KSyntaxHighlighting::Repository::LightTheme));
hl->setDefinition(def);
-#else
- new KPIMTextEdit::HtmlHighlighter(mHtmlBrowser->textBrowser()->document());
-#endif
mTabWidget->setCurrentIndex(0);
#else
diff --git a/messageviewer/src/widgets/mailsourcewebengineviewer.h b/messageviewer/src/widgets/mailsourcewebengineviewer.h
index 8037a67..1f0893f 100644
--- a/messageviewer/src/widgets/mailsourcewebengineviewer.h
+++ b/messageviewer/src/widgets/mailsourcewebengineviewer.h
@@ -25,9 +25,7 @@
class QTabWidget;
class QWebEnginePage;
-#ifdef KDEPIM_KF5SYNTAXHIGHLIGHTING_SUPPORT
#include <KSyntaxHighlighting/Repository>
-#endif
namespace MessageViewer
{
@@ -44,9 +42,7 @@ public:
void setDisplayedSource(QWebEnginePage *page);
void setFixedFont();
private:
-#ifdef KDEPIM_KF5SYNTAXHIGHLIGHTING_SUPPORT
KSyntaxHighlighting::Repository mRepo;
-#endif
MailSourceViewTextBrowserWidget *mRawBrowser;
FindBarSourceView *mFindBar;
#ifndef NDEBUG