From fb2eac9b5eaa100df2e990c2623bd8475baf0b73 Mon Sep 17 00:00:00 2001 From: yifang Date: Sun, 27 Feb 2022 22:42:40 +0800 Subject: [PATCH] upgrade to 6.2,linux compile --- articleview.cc | 2 +- articleview.hh | 2 +- bgl.cc | 5 +++-- broken_xrecord.cc | 4 ++++ dsl_details.hh | 4 ++++ epwing_book.hh | 4 ++++ ftshelpers.hh | 5 +++-- fulltextsearch.hh | 5 +++-- gls.cc | 6 +++++- goldendict.pro | 5 +++-- hotkeywrapper.hh | 4 ++++ hunspell.cc | 5 +++-- keyboardstate.cc | 4 ++++ langcoder.cc | 2 +- mainwindow.cc | 4 ++++ scanflag.cc | 1 - scanpopup.cc | 4 +--- stardict.cc | 5 +++-- thirdparty/qtsingleapplication/src/qtlocalpeer.cpp | 7 ------- 19 files changed, 51 insertions(+), 27 deletions(-) diff --git a/articleview.cc b/articleview.cc index e6260c2d..222e2e84 100644 --- a/articleview.cc +++ b/articleview.cc @@ -32,7 +32,7 @@ #include #endif #if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) -#include +#include #include #include #endif diff --git a/articleview.hh b/articleview.hh index 5b591011..0062aaa8 100644 --- a/articleview.hh +++ b/articleview.hh @@ -17,7 +17,7 @@ #include "globalbroadcaster.h" #include "article_inspect.h" #if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) -#include +#include #endif class ResourceToSaveHandler; diff --git a/bgl.cc b/bgl.cc index 7246957b..bec116d6 100644 --- a/bgl.cc +++ b/bgl.cc @@ -31,9 +31,10 @@ #include #include -#include #if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) -#include +#include +#else +#include #endif #include diff --git a/broken_xrecord.cc b/broken_xrecord.cc index d3f1b00a..bf95eca4 100644 --- a/broken_xrecord.cc +++ b/broken_xrecord.cc @@ -8,8 +8,12 @@ #ifdef HAVE_X11 #include #include +#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) +#include +#else #include #endif +#endif bool isRECORDBroken() { diff --git a/dsl_details.hh b/dsl_details.hh index c1be6918..2349c349 100644 --- a/dsl_details.hh +++ b/dsl_details.hh @@ -10,7 +10,11 @@ #include #include "dictionary.hh" #include "iconv.hh" +#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) +#include +#else #include +#endif #include #include "utf8.hh" diff --git a/epwing_book.hh b/epwing_book.hh index d7be2d3c..5e2b99b5 100644 --- a/epwing_book.hh +++ b/epwing_book.hh @@ -12,7 +12,11 @@ #include "mutex.hh" #include +#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) +#include +#else #include +#endif #include #include #include diff --git a/ftshelpers.hh b/ftshelpers.hh index 33795a69..f8392d09 100644 --- a/ftshelpers.hh +++ b/ftshelpers.hh @@ -2,9 +2,10 @@ #define __FTSHELPERS_HH_INCLUDED__ #include -#include #if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) -#include +#include +#else +#include #endif #include #include diff --git a/fulltextsearch.hh b/fulltextsearch.hh index f529b98a..e588b3ae 100644 --- a/fulltextsearch.hh +++ b/fulltextsearch.hh @@ -3,9 +3,10 @@ #include #include -#include #if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) -#include +#include +#else +#include #endif #include #include diff --git a/gls.cc b/gls.cc index 43a873f7..3bc28fc1 100644 --- a/gls.cc +++ b/gls.cc @@ -32,7 +32,11 @@ #include #include - +#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) +#include +#else +#include +#endif #include #include #include diff --git a/goldendict.pro b/goldendict.pro index 770ca62f..7c911fb1 100644 --- a/goldendict.pro +++ b/goldendict.pro @@ -28,7 +28,7 @@ QT += core \ printsupport \ help -greaterThan(QT_MAJOR_VERSION, 6): QT += webenginecore core5compat +greaterThan(QT_MAJOR_VERSION, 5): QT += webenginecore core5compat DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x050F00 @@ -122,7 +122,8 @@ unix:!mac { QMAKE_CXXFLAGS += -rdynamic QMAKE_LFLAGS += -rdynamic - QT += x11extras +lessThan(QT_MAJOR_VERSION, 6): QT += x11extras +greaterThan(QT_MAJOR_VERSION, 5): QT += gui-private CONFIG += link_pkgconfig PKGCONFIG += vorbisfile \ diff --git a/hotkeywrapper.hh b/hotkeywrapper.hh index a7b546e7..844458b2 100644 --- a/hotkeywrapper.hh +++ b/hotkeywrapper.hh @@ -9,7 +9,11 @@ #include #include +#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) +#include +#else #include +#endif #include #undef Bool diff --git a/hunspell.cc b/hunspell.cc index 8b367e12..c09638c3 100644 --- a/hunspell.cc +++ b/hunspell.cc @@ -13,9 +13,10 @@ #include #include #include -#include #if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) -#include +#include +#else +#include #endif #include #include diff --git a/keyboardstate.cc b/keyboardstate.cc index 29c986ff..b6163f19 100644 --- a/keyboardstate.cc +++ b/keyboardstate.cc @@ -7,7 +7,11 @@ #ifdef Q_OS_WIN32 #include #elif defined(HAVE_X11) +#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) +#include +#else #include +#endif #include #include #elif defined Q_OS_MAC diff --git a/langcoder.cc b/langcoder.cc index 466846ce..56eb7637 100644 --- a/langcoder.cc +++ b/langcoder.cc @@ -10,7 +10,7 @@ #include #endif #if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) -#include +#include #endif #include #include diff --git a/mainwindow.cc b/mainwindow.cc index 7a1050e8..d9e6517a 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -62,7 +62,11 @@ #endif #ifdef HAVE_X11 +#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) +#include +#else #include +#endif #include #include #endif diff --git a/scanflag.cc b/scanflag.cc index 13982b42..99d0459b 100644 --- a/scanflag.cc +++ b/scanflag.cc @@ -1,5 +1,4 @@ #include -#include #include "scanflag.hh" #include "ui_scanflag.h" diff --git a/scanpopup.cc b/scanpopup.cc index c0d3ea07..2fb32c5c 100644 --- a/scanpopup.cc +++ b/scanpopup.cc @@ -8,9 +8,7 @@ #include #include #include -#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) -#include -#else +#if (QT_VERSION < QT_VERSION_CHECK(6,0,0)) #include #endif #include "gddebug.hh" diff --git a/stardict.cc b/stardict.cc index 10530aa0..3e1d1a15 100644 --- a/stardict.cc +++ b/stardict.cc @@ -39,9 +39,10 @@ #include #include #include -#include #if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) -#include +#include +#else +#include #endif #include #include diff --git a/thirdparty/qtsingleapplication/src/qtlocalpeer.cpp b/thirdparty/qtsingleapplication/src/qtlocalpeer.cpp index 1b9b5ed5..5633bfed 100644 --- a/thirdparty/qtsingleapplication/src/qtlocalpeer.cpp +++ b/thirdparty/qtsingleapplication/src/qtlocalpeer.cpp @@ -56,9 +56,6 @@ static PProcessIdToSessionId pProcessIdToSessionId = 0; #include #endif -#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) -#include -#endif #include namespace QtLP_Private { @@ -113,8 +110,6 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId) lockFile.open(QIODevice::ReadWrite); } - - bool QtLocalPeer::isClient() { if (lockFile.isLocked()) @@ -137,7 +132,6 @@ bool QtLocalPeer::isClient() return false; } - bool QtLocalPeer::sendMessage(const QString &message, int timeout) { if (!isClient()) @@ -174,7 +168,6 @@ bool QtLocalPeer::sendMessage(const QString &message, int timeout) return res; } - void QtLocalPeer::receiveConnection() { QLocalSocket* socket = server->nextPendingConnection();