Commit d992ca10 authored by Laurent Montel's avatar Laurent Montel 😁

Remove qt check

parent 06767682
cmake_minimum_required(VERSION 3.0)
set(PIM_VERSION "5.6.43")
set(PIM_VERSION "5.6.44")
if (POLICY CMP0053)
cmake_policy(SET CMP0053 NEW)
......@@ -144,13 +144,3 @@ endif()
install( FILES messagelib.renamecategories messagelib.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
if (NOT ${MIMETREEPARSER_ONLY_BUILD})
if (${Qt5WebEngine_VERSION} GREATER "5.7.99")
MESSAGE(STATUS "QtWebEngine greater or equal 5.8.0 provides printing support and dnd fix. It's a good idea to use it")
else()
if (${Qt5WebEngine_VERSION} GREATER "5.6.99")
MESSAGE(STATUS "QtWebEngine 5.7.0 doesn't provide printing support. It has a lot of regression. Better to upgrade QtWebEngine to 5.8.0")
endif()
endif()
endif()
......@@ -790,9 +790,7 @@ void AttachmentControllerBase::editAttachment(AttachmentPart::Ptr part, MessageV
}
case MessageViewer::EditorWatcher::CannotStart:
qCWarning(MESSAGECOMPOSER_LOG) << "Could not start EditorWatcher.";
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case MessageViewer::EditorWatcher::Unknown:
case MessageViewer::EditorWatcher::Canceled:
case MessageViewer::EditorWatcher::NoServiceFound: {
......
......@@ -1882,9 +1882,7 @@ bool ComposerViewBase::determineWhetherToEncrypt(bool doEncryptCompletely, Kleo:
case Kleo::AskOpportunistic:
opportunistic = true;
// fall through...
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case Kleo::Ask: {
// the user wants to be asked or has to be asked
#ifndef QT_NO_CURSOR
......
......@@ -162,9 +162,7 @@ void MessageComposer::Util::makeToplevelContentType(KMime::Content *content, Kle
// fall through (for encryption, there's no difference between
// SMIME and SMIMEOpaque, since there is no mp/encrypted for
// S/MIME)
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case Kleo::SMIMEOpaqueFormat:
qCDebug(MESSAGECOMPOSER_LOG) << "setting headers for SMIME/opaque";
......@@ -197,9 +195,7 @@ void MessageComposer::Util::setNestedContentType(KMime::Content *content, Kleo::
content->contentType()->setParameter(QStringLiteral("name"), QString::fromAscii("smime.p7s"));
return;
}
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
// fall through:
default:
case Kleo::InlineOpenPGPFormat:
......
......@@ -720,9 +720,7 @@ void ThemeDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
);
}
// fall through anyway
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
Q_FALLTHROUGH();
}
case Theme::RoundedRect: {
painter->setPen(Qt::NoPen);
......@@ -768,9 +766,7 @@ void ThemeDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
);
}
// fall through anyway
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
Q_FALLTHROUGH();
}
case Theme::GradientRect: {
// FIXME: Could cache this brush
......
......@@ -2245,9 +2245,7 @@ void View::changeEvent(QEvent *e)
switch (e->type()) {
case QEvent::FontChange:
d->mDelegate->generalFontChanged();
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case QEvent::PaletteChange:
case QEvent::StyleChange:
case QEvent::LayoutDirectionChange:
......
......@@ -299,18 +299,14 @@ void StorageModel::fillMessageItemThreadingData(MessageList::Core::MessageItem *
mi->setSubjectIsPrefixed(subject != strippedSubject);
// fall through
}
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
case PerfectThreadingPlusReferences: {
const auto refs = mail->references()->identifiers();
if (!refs.isEmpty()) {
mi->setReferencesIdMD5(md5Encode(refs.last()));
}
}
#if QT_VERSION >= QT_VERSION_CHECK(5,8,0)
Q_FALLTHROUGH();
#endif
// fall through
case PerfectThreadingOnly: {
mi->setMessageIdMD5(md5Encode(mail->messageID()->identifier()));
......
......@@ -12,10 +12,6 @@ add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5MessageViewer")
if (Qt5WebEngineWidgets_VERSION VERSION_GREATER "5.7.99")
set(WEBENGINEVIEWER_PRINT_SUPPORT true)
endif()
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/KF5MessageViewerConfig.cmake.in"
......
#cmakedefine HAVE_SYS_INOTIFY_H 1
#cmakedefine WEBENGINEVIEWER_PRINT_SUPPORT 1
......@@ -43,7 +43,6 @@
#include "config-messageviewer.h"
#include "webengine/mailwebenginescript.h"
#include "viewerplugins/viewerplugintoolmanager.h"
#include <WebEngineViewer/WebEnginePrintMessageBox>
#include <KContacts/VCardConverter>
#include <webengineviewer/config-webengineviewer.h>
#include "htmlwriter/webengineembedpart.h"
......@@ -2436,20 +2435,8 @@ void ViewerPrivate::slotPrintPreview()
if (!mMessage) {
return;
}
#ifndef WEBENGINEVIEWER_PRINT_SUPPORT
QPointer<WebEngineViewer::WebEnginePrintMessageBox> dialog
= new WebEngineViewer::WebEnginePrintMessageBox(q);
connect(
dialog.data(), &WebEngineViewer::WebEnginePrintMessageBox::openInBrowser, this,
&ViewerPrivate::slotOpenInBrowser);
if (!dialog->exec()) {
Q_EMIT printingFinished();
}
delete dialog;
#else
//Need to delay
QTimer::singleShot(1 * 1000, this, &ViewerPrivate::slotDelayPrintPreview);
#endif
}
void ViewerPrivate::slotDelayPrintPreview()
......@@ -2505,7 +2492,6 @@ void ViewerPrivate::slotPrintMessage()
if (!mMessage) {
return;
}
#ifdef WEBENGINEVIEWER_PRINT_SUPPORT
if (mCurrentPrinter) {
return;
}
......@@ -2519,9 +2505,6 @@ void ViewerPrivate::slotPrintMessage()
}
delete dialog;
mViewer->page()->print(mCurrentPrinter, invoke(this, &ViewerPrivate::slotHandlePagePrinted));
#else
slotPrintPreview();
#endif
}
void ViewerPrivate::slotHandlePagePrinted(bool result)
......
......@@ -57,10 +57,8 @@ void MailWebEnginePage::initialize()
settings()->setAttribute(QWebEngineSettings::Accelerated2dCanvasEnabled, false);
settings()->setAttribute(QWebEngineSettings::WebGLEnabled, false);
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, false);
settings()->setAttribute(QWebEngineSettings::AllowRunningInsecureContent, false);
#endif
profile()->setPersistentCookiesPolicy(QWebEngineProfile::NoPersistentCookies);
profile()->setHttpCacheType(QWebEngineProfile::MemoryHttpCache);
......@@ -73,11 +71,7 @@ void MailWebEnginePage::initialize()
void MailWebEnginePage::setPrintElementBackground(bool printElementBackground)
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
settings()->setAttribute(QWebEngineSettings::PrintElementBackgrounds, printElementBackground);
#else
Q_UNUSED(printElementBackground);
#endif
}
void MailWebEnginePage::slotFeaturePermissionRequested(const QUrl &url,
......
......@@ -320,14 +320,9 @@ void MailWebEngineView::markAttachment(const QString &id, const QString &style)
void MailWebEngineView::scrollToAnchor(const QString &anchor)
{
#if QT_VERSION >= 0x050700
page()->runJavaScript(WebEngineViewer::WebEngineScript::searchElementPosition(anchor),
WebEngineViewer::WebEngineManageScript::scriptWordId(),
invoke(this, &MailWebEngineView::handleScrollToAnchor));
#else
page()->runJavaScript(WebEngineViewer::WebEngineScript::searchElementPosition(anchor),
invoke(this, &MailWebEngineView::handleScrollToAnchor));
#endif
}
void MailWebEngineView::handleIsScrolledToBottom(const QVariant &result)
......
......@@ -43,10 +43,8 @@ TemplateWebEnginePage::TemplateWebEnginePage(QObject *parent)
settings()->setAttribute(QWebEngineSettings::Accelerated2dCanvasEnabled, false);
settings()->setAttribute(QWebEngineSettings::WebGLEnabled, false);
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, false);
settings()->setAttribute(QWebEngineSettings::AllowRunningInsecureContent, false);
#endif
profile()->setPersistentCookiesPolicy(QWebEngineProfile::NoPersistentCookies);
profile()->setHttpCacheType(QWebEngineProfile::MemoryHttpCache);
}
......
#ifndef CONFIGWEBENGINEVIEWER_H
#define CONFIGWEBENGINEVIEWER_H
#cmakedefine WEBENGINEVIEWER_PRINT_SUPPORT 1
#endif
......@@ -100,7 +100,6 @@ void WebEnginePage::javaScriptConsoleMessage(QWebEnginePage::JavaScriptConsoleMe
bool WebEnginePage::execPrintPreviewPage(QPrinter *printer, int timeout)
{
#ifdef WEBENGINEVIEWER_PRINT_SUPPORT
QPointer<QEventLoop> loop = new QEventLoop;
bool result = false;
QTimer::singleShot(timeout, loop.data(), &QEventLoop::quit);
......@@ -116,9 +115,4 @@ bool WebEnginePage::execPrintPreviewPage(QPrinter *printer, int timeout)
delete loop;
return result;
#else
Q_UNUSED(printer);
Q_UNUSED(timeout);
return false;
#endif
}
......@@ -42,7 +42,6 @@ using namespace WebEngineViewer;
class WebEngineViewer::WebHitTestResultPrivate
{
public:
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
WebHitTestResultPrivate(const QWebEngineContextMenuData &data, const QPoint &pos = QPoint(), const QUrl &url = QUrl())
: mIsNull(true),
mIsContentEditable(false),
......@@ -54,7 +53,6 @@ public:
{
init(data);
}
#endif
WebHitTestResultPrivate(const QPoint &pos = QPoint(), const QUrl &url = QUrl(), const QVariant &result = QVariant())
: mIsNull(true),
mIsContentEditable(false),
......@@ -67,9 +65,7 @@ public:
init(result.toMap());
}
void init(const QVariantMap &map);
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
void init(const QWebEngineContextMenuData &data);
#endif
bool mIsNull;
QString mAlternateText;
......@@ -87,14 +83,12 @@ public:
QUrl mPageUrl;
};
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
void WebHitTestResultPrivate::init(const QWebEngineContextMenuData &data)
{
if (data.isValid()) {
//TODO
}
}
#endif
void WebHitTestResultPrivate::init(const QVariantMap &map)
{
......@@ -147,13 +141,11 @@ WebHitTestResult::WebHitTestResult(const WebHitTestResult &other)
(*this) = other;
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
WebHitTestResult::WebHitTestResult(const QPoint &pos, const QUrl &pageUrl, const QWebEngineContextMenuData &data)
: d(new WebHitTestResultPrivate(data, pos, pageUrl))
{
}
#endif
WebHitTestResult::~WebHitTestResult()
{
......
......@@ -42,9 +42,7 @@
#include <QRect>
#include <QString>
#include <QVariant>
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
#include <QWebEngineContextMenuData>
#endif
namespace WebEngineViewer
{
......@@ -55,9 +53,7 @@ public:
WebHitTestResult();
WebHitTestResult(const QPoint &pos, const QUrl &pageUrl, const QVariant &result);
WebHitTestResult(const WebHitTestResult &other);
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
WebHitTestResult(const QPoint &pos, const QUrl &pageUrl, const QWebEngineContextMenuData &data);
#endif
~WebHitTestResult();
QString alternateText() const;
......
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