Browse Source

Make use of QT_VERSION define instead of using our own define

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
e082c02630
  1. 4
      configure
  2. 4
      qcm/qt4.qcm
  3. 2
      src/feeddownloader.h
  4. 6
      src/rss.cpp
  5. 2
      src/rss.h
  6. 2
      src/rss_imp.h
  7. 8
      src/searchengine.cpp
  8. 8
      src/searchengine.h
  9. 6
      src/torrentpersistentdata.h

4
configure vendored

@ -312,11 +312,7 @@ public: @@ -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"

4
qcm/qt4.qcm

@ -15,10 +15,6 @@ public: @@ -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);
}
};

2
src/feeddownloader.h

@ -46,7 +46,7 @@ @@ -46,7 +46,7 @@
#include "bittorrent.h"
#include "ui_feeddownloader.h"
#ifdef QT_4_5
#if QT_VERSION >= 0x040500
#include <QHash>
#else
#include <QMap>

6
src/rss.cpp

@ -31,12 +31,12 @@ @@ -31,12 +31,12 @@
#include "rss.h"
#include "preferences.h"
#ifdef QT_4_5
#include <QHash>
#else
#if QT_VERSION < 0x040500
#include <QMap>
#define QHash QMap
#define toHash toMap
#else
#include <QHash>
#endif
/** RssFolder **/

2
src/rss.h

@ -49,7 +49,7 @@ @@ -49,7 +49,7 @@
#include "bittorrent.h"
#include "downloadthread.h"
#ifdef QT_4_5
#if QT_VERSION >= 0x040500
#include <QHash>
#else
#include <QMap>

2
src/rss_imp.h

@ -86,7 +86,7 @@ public: @@ -86,7 +86,7 @@ public:
};
#ifndef QT_4_5
#if QT_VERSION < 0x040500
#undef QHash
#undef toHash
#endif

8
src/searchengine.cpp

@ -58,7 +58,7 @@ SearchEngine::SearchEngine(GUI *parent, Bittorrent *BTSession) : QWidget(parent) @@ -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(){ @@ -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(){ @@ -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){ @@ -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");

8
src/searchengine.h

@ -64,7 +64,7 @@ private: @@ -64,7 +64,7 @@ private:
SupportedEngines *supported_engines;
QTimer *searchTimeout;
QPointer<SearchTab> currentSearchTab;
#ifndef QT_4_5
#if QT_VERSION < 0x040500
QPushButton *closeTab_button;
#endif
QList<QPointer<SearchTab> > all_tab; // To store all tabs
@ -106,10 +106,10 @@ protected slots: @@ -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);

6
src/torrentpersistentdata.h

@ -38,12 +38,12 @@ @@ -38,12 +38,12 @@
#include "misc.h"
#include <vector>
#ifdef QT_4_5
#include <QHash>
#else
#if QT_VERSION < 0x040500
#include <QMap>
#define QHash QMap
#define toHash toMap
#else
#include <QHash>
#endif
class TorrentTempData {

Loading…
Cancel
Save