diff --git a/articleview.cc b/articleview.cc index 3941d0c6..3a6611f6 100644 --- a/articleview.cc +++ b/articleview.cc @@ -386,10 +386,8 @@ ArticleView::~ArticleView() cleanupTemp(); audioPlayer->stop(); -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) ui.definition->ungrabGesture( Gestures::GDPinchGestureType ); ui.definition->ungrabGesture( Gestures::GDSwipeGestureType ); -#endif } void ArticleView::showDefinition( Config::InputPhrase const & phrase, unsigned group, @@ -597,7 +595,6 @@ void ArticleView::loadFinished( bool ) articleToJump.clear(); } -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) if( !Utils::Url::queryItemValue( url, "gdanchor" ).isEmpty() ) { QString anchor = QUrl::fromPercentEncoding( Utils::Url::encodedQueryItemValue( url, "gdanchor" ) ); @@ -631,7 +628,6 @@ void ArticleView::loadFinished( bool ) QString( "window.location.hash = \"%1\"" ).arg( QString::fromUtf8( url.toEncoded() ) ) ); } } -#endif emit pageLoaded( this ); @@ -868,7 +864,6 @@ bool ArticleView::handleF3( QObject * /*obj*/, QEvent * ev ) bool ArticleView::eventFilter( QObject * obj, QEvent * ev ) { -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) if( ev->type() == QEvent::Gesture ) { Gestures::GestureResult result; @@ -920,7 +915,6 @@ bool ArticleView::eventFilter( QObject * obj, QEvent * ev ) return true; } } -#endif if ( handleF3( obj, ev ) ) { diff --git a/delegate.cc b/delegate.cc index 62ad448c..ffeeb102 100644 --- a/delegate.cc +++ b/delegate.cc @@ -10,11 +10,8 @@ QStyledItemDelegate() void WordListItemDelegate::paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const { -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) QStyleOptionViewItem opt4 = option; -#else - QStyleOptionViewItemV4 opt4 = option; -#endif + QStyleOptionViewItem opt = option; initStyleOption( &opt4, index ); if( opt4.text.isRightToLeft() ) diff --git a/dictheadwords.cc b/dictheadwords.cc index 371b13cb..201290b3 100644 --- a/dictheadwords.cc +++ b/dictheadwords.cc @@ -11,11 +11,9 @@ #include #include -#if QT_VERSION >= QT_VERSION_CHECK( 5, 12, 0 ) #include #include "wildcard.hh" #include "gddebug.hh" -#endif #define AUTO_APPLY_LIMIT 150000 diff --git a/dsl_details.cc b/dsl_details.cc index 9ef11d88..843224f4 100644 --- a/dsl_details.cc +++ b/dsl_details.cc @@ -1226,8 +1226,6 @@ void expandOptionalParts( wstring & str, list< wstring > * result, { if( !inside_recurse ) { -// expanded.sort(); -// result->merge(expanded ); result->splice(result->end(),expanded); } return; diff --git a/gestures.cc b/gestures.cc index c0c07b73..5a25a603 100644 --- a/gestures.cc +++ b/gestures.cc @@ -8,8 +8,6 @@ #include "articleview.hh" #include "gestures.hh" -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) - namespace Gestures { @@ -80,9 +78,7 @@ QGestureRecognizer::Result GDPinchGestureRecognizer::recognize( QGesture * state gest->isNewSequence = true; break; } -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) case QEvent::TouchCancel: -#endif case QEvent::TouchEnd: { result = QGestureRecognizer::CancelGesture; @@ -225,9 +221,7 @@ QGestureRecognizer::Result GDSwipeGestureRecognizer::recognize( QGesture * state result = QGestureRecognizer::MayBeGesture; break; } -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) case QEvent::TouchCancel: -#endif case QEvent::TouchEnd: { fewTouchPointsPresented = false; @@ -394,4 +388,3 @@ void unregisterRecognizers() } // namespace -#endif //QT_VERSION diff --git a/gestures.hh b/gestures.hh index 35011618..060b126b 100644 --- a/gestures.hh +++ b/gestures.hh @@ -1,8 +1,6 @@ #ifndef __GESTURES_HH_INCLUDED__ #define __GESTURES_HH_INCLUDED__ -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) - #include #include #include @@ -112,6 +110,4 @@ bool handleGestureEvent( QObject * obj, QEvent * event, GestureResult & result, } // namespace -#endif - #endif // __GESTURES_HH_INCLUDED__ diff --git a/main.cc b/main.cc index 45318ae6..2255c7ab 100644 --- a/main.cc +++ b/main.cc @@ -40,10 +40,6 @@ #include "gddebug.hh" -#if defined( Q_OS_MAC ) && QT_VERSION < QT_VERSION_CHECK(5, 0, 0) -#include "lionsupport.h" -#endif - void gdMessageHandler( QtMsgType type, const QMessageLogContext &context, const QString &mess ) { Q_UNUSED( context ); diff --git a/mainwindow.cc b/mainwindow.cc index 82fadfcf..82b46748 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -164,10 +164,8 @@ MainWindow::MainWindow( Config::Class & cfg_ ): articleMaker.setCollapseParameters( cfg.preferences.collapseBigArticles, cfg.preferences.articleSizeLimit ); -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) // Set own gesture recognizers Gestures::registerRecognizers(); -#endif // use our own, custom statusbar setStatusBar(0); @@ -888,10 +886,8 @@ MainWindow::MainWindow( Config::Class & cfg_ ): ( static_cast< QHotkeyApplication * >( qApp ) )->setMainWindow( this ); #endif -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) ui.centralWidget->grabGesture( Gestures::GDPinchGestureType ); ui.centralWidget->grabGesture( Gestures::GDSwipeGestureType ); -#endif if( layoutDirection() == Qt::RightToLeft ) { @@ -1015,11 +1011,9 @@ MainWindow::~MainWindow() ftsIndexing.stopIndexing(); -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) ui.centralWidget->ungrabGesture( Gestures::GDPinchGestureType ); ui.centralWidget->ungrabGesture( Gestures::GDSwipeGestureType ); // Gestures::unregisterRecognizers(); -#endif // Close all tabs -- they should be destroyed before network managers // do. diff --git a/scanpopup.cc b/scanpopup.cc index 3c70321e..4a16d75d 100644 --- a/scanpopup.cc +++ b/scanpopup.cc @@ -315,10 +315,8 @@ ScanPopup::ScanPopup( QWidget * parent, ui.goBackButton->setEnabled( false ); ui.goForwardButton->setEnabled( false ); -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) grabGesture( Gestures::GDPinchGestureType ); grabGesture( Gestures::GDSwipeGestureType ); -#endif #ifdef HAVE_X11 scanFlag = new ScanFlag( this ); @@ -349,10 +347,8 @@ ScanPopup::~ScanPopup() disableScanning(); -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) ungrabGesture( Gestures::GDPinchGestureType ); ungrabGesture( Gestures::GDSwipeGestureType ); -#endif } void ScanPopup::saveConfigData() diff --git a/xdxf.cc b/xdxf.cc index 70de083d..192daeaf 100644 --- a/xdxf.cc +++ b/xdxf.cc @@ -754,7 +754,6 @@ qint64 GzippedFile::readData( char * data, qint64 maxSize ) // The returning value translates directly to QIODevice semantics int n = gzread( gz, data, maxSize ); -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) // With QT 5.x QXmlStreamReader ask one byte instead of one UTF-8 char. // We read and return all bytes for char. @@ -775,7 +774,6 @@ qint64 GzippedFile::readData( char * data, qint64 maxSize ) if( addBytes ) n += gzread( gz, data + 1, addBytes ); } -#endif return n; }