mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 13:18:06 -06:00
Branched v2.2.x
This commit is contained in:
@@ -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
|
||||
@@ -96,7 +96,7 @@ void SearchEngine::fillCatCombobox() {
|
||||
comboCategory->addItem(full_cat_names["all"], QVariant("all"));
|
||||
QStringList supported_cat = supported_engines->supportedCategories();
|
||||
foreach(QString cat, supported_cat) {
|
||||
qDebug("Supported category: %s", cat.toLocal8Bit().data());
|
||||
qDebug("Supported category: %s", qPrintable(cat));
|
||||
comboCategory->addItem(full_cat_names[cat], QVariant(cat));
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -254,7 +254,7 @@ void SearchEngine::on_search_button_clicked(){
|
||||
search_stopped = false;
|
||||
params << misc::searchEngineLocation()+QDir::separator()+"nova2.py";
|
||||
params << supported_engines->enginesEnabled().join(",");
|
||||
qDebug("Search with category: %s", selectedCategory().toLocal8Bit().data());
|
||||
qDebug("Search with category: %s", qPrintable(selectedCategory()));
|
||||
params << selectedCategory();
|
||||
params << pattern.split(" ");
|
||||
// Update SearchEngine widgets
|
||||
@@ -432,14 +432,15 @@ void SearchEngine::updateNova() {
|
||||
QString shipped_file = shipped_subDir.path()+"/"+file;
|
||||
// Copy python classes
|
||||
if(file.endsWith(".py")) {
|
||||
if(getPluginVersion(shipped_file) > getPluginVersion(destDir+file) ) {
|
||||
qDebug("shippped %s is more recent then local plugin, updating", file.toLocal8Bit().data());
|
||||
if(QFile::exists(destDir+file)) {
|
||||
qDebug("Removing old %s", (destDir+file).toLocal8Bit().data());
|
||||
QFile::remove(destDir+file);
|
||||
const QString &dest_file = destDir+file;
|
||||
if(getPluginVersion(shipped_file) > getPluginVersion(dest_file) ) {
|
||||
qDebug("shippped %s is more recent then local plugin, updating", qPrintable(file));
|
||||
if(QFile::exists(dest_file)) {
|
||||
qDebug("Removing old %s", qPrintable(dest_file));
|
||||
QFile::remove(dest_file);
|
||||
}
|
||||
qDebug("%s copied to %s", shipped_file.toLocal8Bit().data(), (destDir+file).toLocal8Bit().data());
|
||||
QFile::copy(shipped_file, destDir+file);
|
||||
qDebug("%s copied to %s", qPrintable(shipped_file), qPrintable(dest_file));
|
||||
QFile::copy(shipped_file, dest_file);
|
||||
}
|
||||
} else {
|
||||
// Copy icons
|
||||
@@ -531,7 +532,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");
|
||||
|
||||
Reference in New Issue
Block a user