mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-09 14:27:56 +00:00
Make use of QT_VERSION define instead of using our own define
This commit is contained in:
parent
291b94bef0
commit
e082c02630
4
configure
vendored
4
configure
vendored
@ -312,11 +312,7 @@ public:
|
|||||||
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
||||||
conf->addDefine("DISABLE_GUI");
|
conf->addDefine("DISABLE_GUI");
|
||||||
}
|
}
|
||||||
if(QT_VERSION >= 0x040500) {
|
|
||||||
conf->addDefine("QT_4_5");
|
|
||||||
}
|
|
||||||
return(QT_VERSION >= 0x040400);
|
return(QT_VERSION >= 0x040400);
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#line 1 "pkg-config.qcm"
|
#line 1 "pkg-config.qcm"
|
||||||
|
@ -15,10 +15,6 @@ public:
|
|||||||
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
if(!conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
||||||
conf->addDefine("DISABLE_GUI");
|
conf->addDefine("DISABLE_GUI");
|
||||||
}
|
}
|
||||||
if(QT_VERSION >= 0x040500) {
|
|
||||||
conf->addDefine("QT_4_5");
|
|
||||||
}
|
|
||||||
return(QT_VERSION >= 0x040400);
|
return(QT_VERSION >= 0x040400);
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
#include "bittorrent.h"
|
#include "bittorrent.h"
|
||||||
#include "ui_feeddownloader.h"
|
#include "ui_feeddownloader.h"
|
||||||
|
|
||||||
#ifdef QT_4_5
|
#if QT_VERSION >= 0x040500
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#else
|
#else
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
@ -31,12 +31,12 @@
|
|||||||
#include "rss.h"
|
#include "rss.h"
|
||||||
#include "preferences.h"
|
#include "preferences.h"
|
||||||
|
|
||||||
#ifdef QT_4_5
|
#if QT_VERSION < 0x040500
|
||||||
#include <QHash>
|
|
||||||
#else
|
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#define QHash QMap
|
#define QHash QMap
|
||||||
#define toHash toMap
|
#define toHash toMap
|
||||||
|
#else
|
||||||
|
#include <QHash>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** RssFolder **/
|
/** RssFolder **/
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
#include "bittorrent.h"
|
#include "bittorrent.h"
|
||||||
#include "downloadthread.h"
|
#include "downloadthread.h"
|
||||||
|
|
||||||
#ifdef QT_4_5
|
#if QT_VERSION >= 0x040500
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#else
|
#else
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
@ -86,7 +86,7 @@ public:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef QT_4_5
|
#if QT_VERSION < 0x040500
|
||||||
#undef QHash
|
#undef QHash
|
||||||
#undef toHash
|
#undef toHash
|
||||||
#endif
|
#endif
|
||||||
|
@ -58,7 +58,7 @@ SearchEngine::SearchEngine(GUI *parent, Bittorrent *BTSession) : QWidget(parent)
|
|||||||
// new qCompleter to the search pattern
|
// new qCompleter to the search pattern
|
||||||
startSearchHistory();
|
startSearchHistory();
|
||||||
createCompleter();
|
createCompleter();
|
||||||
#ifdef QT_4_5
|
#if QT_VERSION >= 0x040500
|
||||||
tabWidget->setTabsClosable(true);
|
tabWidget->setTabsClosable(true);
|
||||||
connect(tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));
|
connect(tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));
|
||||||
#else
|
#else
|
||||||
@ -119,7 +119,7 @@ SearchEngine::~SearchEngine(){
|
|||||||
downloader->waitForFinished();
|
downloader->waitForFinished();
|
||||||
delete downloader;
|
delete downloader;
|
||||||
}
|
}
|
||||||
#ifndef QT_4_5
|
#if QT_VERSION < 0x040500
|
||||||
delete closeTab_button;
|
delete closeTab_button;
|
||||||
#endif
|
#endif
|
||||||
delete searchTimeout;
|
delete searchTimeout;
|
||||||
@ -234,7 +234,7 @@ void SearchEngine::on_search_button_clicked(){
|
|||||||
all_tab.append(currentSearchTab);
|
all_tab.append(currentSearchTab);
|
||||||
tabWidget->addTab(currentSearchTab, pattern);
|
tabWidget->addTab(currentSearchTab, pattern);
|
||||||
tabWidget->setCurrentWidget(currentSearchTab);
|
tabWidget->setCurrentWidget(currentSearchTab);
|
||||||
#ifndef QT_4_5
|
#if QT_VERSION < 0x040500
|
||||||
closeTab_button->setEnabled(true);
|
closeTab_button->setEnabled(true);
|
||||||
#endif
|
#endif
|
||||||
// if the pattern is not in the pattern
|
// if the pattern is not in the pattern
|
||||||
@ -531,7 +531,7 @@ void SearchEngine::appendSearchResult(QString line){
|
|||||||
download_button->setEnabled(true);
|
download_button->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QT_4_5
|
#if QT_VERSION >= 0x040500
|
||||||
void SearchEngine::closeTab(int index) {
|
void SearchEngine::closeTab(int index) {
|
||||||
if(index == tabWidget->indexOf(currentSearchTab)) {
|
if(index == tabWidget->indexOf(currentSearchTab)) {
|
||||||
qDebug("Deleted current search Tab");
|
qDebug("Deleted current search Tab");
|
||||||
|
@ -64,7 +64,7 @@ private:
|
|||||||
SupportedEngines *supported_engines;
|
SupportedEngines *supported_engines;
|
||||||
QTimer *searchTimeout;
|
QTimer *searchTimeout;
|
||||||
QPointer<SearchTab> currentSearchTab;
|
QPointer<SearchTab> currentSearchTab;
|
||||||
#ifndef QT_4_5
|
#if QT_VERSION < 0x040500
|
||||||
QPushButton *closeTab_button;
|
QPushButton *closeTab_button;
|
||||||
#endif
|
#endif
|
||||||
QList<QPointer<SearchTab> > all_tab; // To store all tabs
|
QList<QPointer<SearchTab> > all_tab; // To store all tabs
|
||||||
@ -106,10 +106,10 @@ protected slots:
|
|||||||
// Search slots
|
// Search slots
|
||||||
void tab_changed(int);//to prevent the use of the download button when the tab is empty
|
void tab_changed(int);//to prevent the use of the download button when the tab is empty
|
||||||
void on_search_button_clicked();
|
void on_search_button_clicked();
|
||||||
#ifdef QT_4_5
|
#if QT_VERSION < 0x040500
|
||||||
void closeTab(int index);
|
|
||||||
#else
|
|
||||||
void closeTab_button_clicked();
|
void closeTab_button_clicked();
|
||||||
|
#else
|
||||||
|
void closeTab(int index);
|
||||||
#endif
|
#endif
|
||||||
void appendSearchResult(QString line);
|
void appendSearchResult(QString line);
|
||||||
void searchFinished(int exitcode,QProcess::ExitStatus);
|
void searchFinished(int exitcode,QProcess::ExitStatus);
|
||||||
|
@ -38,12 +38,12 @@
|
|||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#ifdef QT_4_5
|
#if QT_VERSION < 0x040500
|
||||||
#include <QHash>
|
|
||||||
#else
|
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#define QHash QMap
|
#define QHash QMap
|
||||||
#define toHash toMap
|
#define toHash toMap
|
||||||
|
#else
|
||||||
|
#include <QHash>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class TorrentTempData {
|
class TorrentTempData {
|
||||||
|
Loading…
Reference in New Issue
Block a user