From e082c0263009789975bd8ff0b62c58c5224fa274 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Thu, 4 Mar 2010 18:40:11 +0000 Subject: [PATCH] Make use of QT_VERSION define instead of using our own define --- configure | 4 ---- qcm/qt4.qcm | 4 ---- src/feeddownloader.h | 2 +- src/rss.cpp | 6 +++--- src/rss.h | 2 +- src/rss_imp.h | 2 +- src/searchengine.cpp | 8 ++++---- src/searchengine.h | 8 ++++---- src/torrentpersistentdata.h | 6 +++--- 9 files changed, 17 insertions(+), 25 deletions(-) diff --git a/configure b/configure index 73677210e..5e546568a 100755 --- a/configure +++ b/configure @@ -312,11 +312,7 @@ public: if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) { conf->addDefine("DISABLE_GUI"); } - if(QT_VERSION >= 0x040500) { - conf->addDefine("QT_4_5"); - } return(QT_VERSION >= 0x040400); - } }; #line 1 "pkg-config.qcm" diff --git a/qcm/qt4.qcm b/qcm/qt4.qcm index 59b564275..f20a2b6ff 100644 --- a/qcm/qt4.qcm +++ b/qcm/qt4.qcm @@ -15,10 +15,6 @@ public: if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) { conf->addDefine("DISABLE_GUI"); } - if(QT_VERSION >= 0x040500) { - conf->addDefine("QT_4_5"); - } return(QT_VERSION >= 0x040400); - } }; diff --git a/src/feeddownloader.h b/src/feeddownloader.h index 22b7a085d..c179f6a90 100644 --- a/src/feeddownloader.h +++ b/src/feeddownloader.h @@ -46,7 +46,7 @@ #include "bittorrent.h" #include "ui_feeddownloader.h" -#ifdef QT_4_5 +#if QT_VERSION >= 0x040500 #include #else #include diff --git a/src/rss.cpp b/src/rss.cpp index 5c3f802f6..a6110fae2 100644 --- a/src/rss.cpp +++ b/src/rss.cpp @@ -31,12 +31,12 @@ #include "rss.h" #include "preferences.h" -#ifdef QT_4_5 -#include -#else +#if QT_VERSION < 0x040500 #include #define QHash QMap #define toHash toMap +#else +#include #endif /** RssFolder **/ diff --git a/src/rss.h b/src/rss.h index f0037f7bc..5c0d58730 100644 --- a/src/rss.h +++ b/src/rss.h @@ -49,7 +49,7 @@ #include "bittorrent.h" #include "downloadthread.h" -#ifdef QT_4_5 +#if QT_VERSION >= 0x040500 #include #else #include diff --git a/src/rss_imp.h b/src/rss_imp.h index 4524ea883..04b3549c2 100644 --- a/src/rss_imp.h +++ b/src/rss_imp.h @@ -86,7 +86,7 @@ public: }; -#ifndef QT_4_5 +#if QT_VERSION < 0x040500 #undef QHash #undef toHash #endif diff --git a/src/searchengine.cpp b/src/searchengine.cpp index 236684798..650b3cc96 100644 --- a/src/searchengine.cpp +++ b/src/searchengine.cpp @@ -58,7 +58,7 @@ SearchEngine::SearchEngine(GUI *parent, Bittorrent *BTSession) : QWidget(parent) // new qCompleter to the search pattern startSearchHistory(); createCompleter(); -#ifdef QT_4_5 +#if QT_VERSION >= 0x040500 tabWidget->setTabsClosable(true); connect(tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int))); #else @@ -119,7 +119,7 @@ SearchEngine::~SearchEngine(){ downloader->waitForFinished(); delete downloader; } -#ifndef QT_4_5 +#if QT_VERSION < 0x040500 delete closeTab_button; #endif delete searchTimeout; @@ -234,7 +234,7 @@ void SearchEngine::on_search_button_clicked(){ all_tab.append(currentSearchTab); tabWidget->addTab(currentSearchTab, pattern); tabWidget->setCurrentWidget(currentSearchTab); -#ifndef QT_4_5 +#if QT_VERSION < 0x040500 closeTab_button->setEnabled(true); #endif // if the pattern is not in the pattern @@ -531,7 +531,7 @@ void SearchEngine::appendSearchResult(QString line){ download_button->setEnabled(true); } -#ifdef QT_4_5 +#if QT_VERSION >= 0x040500 void SearchEngine::closeTab(int index) { if(index == tabWidget->indexOf(currentSearchTab)) { qDebug("Deleted current search Tab"); diff --git a/src/searchengine.h b/src/searchengine.h index b40712443..9da9d8bcc 100644 --- a/src/searchengine.h +++ b/src/searchengine.h @@ -64,7 +64,7 @@ private: SupportedEngines *supported_engines; QTimer *searchTimeout; QPointer currentSearchTab; -#ifndef QT_4_5 +#if QT_VERSION < 0x040500 QPushButton *closeTab_button; #endif QList > all_tab; // To store all tabs @@ -106,10 +106,10 @@ protected slots: // Search slots void tab_changed(int);//to prevent the use of the download button when the tab is empty void on_search_button_clicked(); -#ifdef QT_4_5 - void closeTab(int index); -#else +#if QT_VERSION < 0x040500 void closeTab_button_clicked(); +#else + void closeTab(int index); #endif void appendSearchResult(QString line); void searchFinished(int exitcode,QProcess::ExitStatus); diff --git a/src/torrentpersistentdata.h b/src/torrentpersistentdata.h index 3c82dffc8..f6f5e1bbf 100644 --- a/src/torrentpersistentdata.h +++ b/src/torrentpersistentdata.h @@ -38,12 +38,12 @@ #include "misc.h" #include -#ifdef QT_4_5 -#include -#else +#if QT_VERSION < 0x040500 #include #define QHash QMap #define toHash toMap +#else +#include #endif class TorrentTempData {