diff --git a/Changelog b/Changelog index 58dd48b2c..3bc4fe940 100644 --- a/Changelog +++ b/Changelog @@ -35,6 +35,8 @@ - BUGFIX: Fixed selective download - BUGFIX: Fixed memory leaks in torrent properties - BUGFIX: Fixed tooltip behaviour for trayicon + - BUGFIX: Fixed Ipfilter.dat loading + - BUGFIX: Not loading options every time we display options anymore - COSMETIC: Now displaying the number of downloads in tab title - COSMETIC: Redesigned download from url dialog - COSMETIC: Added a message to warn user that we started download from an url diff --git a/src/GUI.cpp b/src/GUI.cpp index 61191f18b..d253825ba 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -1631,8 +1631,10 @@ void GUI::configureSession(){ } // Apply filtering settings if(options->isFilteringEnabled()){ + qDebug("Ip Filter enabled"); s->set_ip_filter(options->getFilter()); }else{ + qDebug("Ip Filter disabled"); s->set_ip_filter(ip_filter()); } // Apply Proxy settings @@ -2297,7 +2299,7 @@ void GUI::setLocale(QString locale){ // Display Program Options void GUI::showOptions() const{ - options->showLoad(); + options->show(); } // Is executed each time options are saved diff --git a/src/about_imp.h b/src/about_imp.h index 66d4a3e38..780fe28d6 100644 --- a/src/about_imp.h +++ b/src/about_imp.h @@ -23,7 +23,7 @@ #define ABOUT_H #include "ui_about.h" -#define VERSION "v0.7.0rc5" +#define VERSION "v0.7.0rc6" class about : public QDialog, private Ui::AboutDlg{ Q_OBJECT diff --git a/src/options_imp.cpp b/src/options_imp.cpp index 5c668cf05..971a7f2ea 100644 --- a/src/options_imp.cpp +++ b/src/options_imp.cpp @@ -565,13 +565,6 @@ int options_imp::getMaxConnec() const{ } } -void options_imp::showLoad(){ - if(!loadOptions()){ - std::cout << "Warning: Couldn't load options" << '\n'; - } - this->show(); -} - void options_imp::on_okButton_clicked(){ if(applyButton->isEnabled()){ saveOptions(); @@ -784,6 +777,7 @@ void options_imp::on_browse_button_clicked(){ // // Lines may be commented using '#' or '//' void options_imp::processFilterFile(const QString& filePath){ + qDebug("Processing filter files"); filtersList->clear(); QString manualFilters= misc::qBittorrentPath() + "ipfilter.dat"; QStringList filterFiles(manualFilters); @@ -794,27 +788,26 @@ void options_imp::processFilterFile(const QString& filePath){ if (file.exists()){ if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){ QMessageBox::critical(0, tr("I/O Error"), tr("Couldn't open:")+" "+filePath+" "+tr("in read mode.")); - return; + continue; } unsigned int nbLine = 0; while (!file.atEnd()) { ++nbLine; QByteArray line = file.readLine(); - QString strLine = QString(line.data()); - if(!strLine.startsWith('#') && !strLine.startsWith("//")){ + if(!line.startsWith('#') && !line.startsWith("//")){ // Line is not commented - QStringList partsList = strLine.split(','); + QList partsList = line.split(','); unsigned int nbElem = partsList.size(); - if(nbElem != 2 && nbElem != 3){ - QMessageBox::critical(0, tr("Invalid Line"), tr("Line")+" "+QString(misc::toString(nbLine).c_str())+" "+tr("is malformed.")); - return; + if(nbElem < 2){ + std::cout << "Ipfilter.dat: line " << nbLine << " is malformed.\n"; + continue; } int nbAccess = partsList.at(1).trimmed().toInt(); if(nbAccess <= 127){ QString strComment; QString strStartIP = partsList.at(0).split('-').at(0).trimmed(); QString strEndIP = partsList.at(0).split('-').at(1).trimmed(); - if(partsList.size() == 3){ + if(nbElem > 2){ strComment = partsList.at(2).trimmed(); }else{ strComment = QString(); @@ -822,17 +815,19 @@ void options_imp::processFilterFile(const QString& filePath){ // Split IP IP = strStartIP.split('.'); if(IP.size() != 4){ + std::cout << "Ipfilter.dat: line " << nbLine << ", first IP is malformed.\n"; continue; } - address start(address::from_string(strStartIP.toStdString())); + address_v4 start((IP.at(0).toInt() << 24) + (IP.at(1).toInt() << 16) + (IP.at(2).toInt() << 8) + IP.at(3).toInt()); IP = strEndIP.split('.'); if(IP.size() != 4){ + std::cout << "Ipfilter.dat: line " << nbLine << ", second IP is malformed.\n"; continue; } - address last(address::from_string(strEndIP.toStdString())); + address_v4 last((IP.at(0).toInt() << 24) + (IP.at(1).toInt() << 16) + (IP.at(2).toInt() << 8) + IP.at(3).toInt()); // add it to list - QStringList item(strStartIP); - item.append(strEndIP); + QStringList item(QString(start.to_string().c_str())); + item.append(QString(last.to_string().c_str())); if(!i){ item.append("Manual"); }else{ diff --git a/src/options_imp.h b/src/options_imp.h index f5684f3df..82bb59160 100644 --- a/src/options_imp.h +++ b/src/options_imp.h @@ -70,8 +70,6 @@ class options_imp : public QDialog, private Ui::Dialog{ QString getPreviewProgram() const; bool getUseOSDAlways() const; bool getUseOSDWhenHiddenOnly() const; - // Other - void showLoad(); protected slots: diff --git a/src/src.pro b/src/src.pro index 9e1a8c4c4..dd6c29fdc 100644 --- a/src/src.pro +++ b/src/src.pro @@ -4,7 +4,7 @@ ICONS_PATH = Icons TRAYICON_CPP = trayicon #Set the following variable to 1 to enable debug -DEBUG_MODE = 1 +DEBUG_MODE = 0 # Global TEMPLATE = app