Browse Source

- Not loading/applying options everytime we show options window anymore...

- Fixed ip filter
- Updated version number
- Disabled debug mode
*** Release is approaching :) ***
adaptive-webui-19844
Christophe Dumez 18 years ago
parent
commit
df2d5fa741
  1. 2
      Changelog
  2. 4
      src/GUI.cpp
  3. 2
      src/about_imp.h
  4. 33
      src/options_imp.cpp
  5. 2
      src/options_imp.h
  6. 2
      src/src.pro

2
Changelog

@ -35,6 +35,8 @@
- BUGFIX: Fixed selective download - BUGFIX: Fixed selective download
- BUGFIX: Fixed memory leaks in torrent properties - BUGFIX: Fixed memory leaks in torrent properties
- BUGFIX: Fixed tooltip behaviour for trayicon - 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: Now displaying the number of downloads in tab title
- COSMETIC: Redesigned download from url dialog - COSMETIC: Redesigned download from url dialog
- COSMETIC: Added a message to warn user that we started download from an url - COSMETIC: Added a message to warn user that we started download from an url

4
src/GUI.cpp

@ -1631,8 +1631,10 @@ void GUI::configureSession(){
} }
// Apply filtering settings // Apply filtering settings
if(options->isFilteringEnabled()){ if(options->isFilteringEnabled()){
qDebug("Ip Filter enabled");
s->set_ip_filter(options->getFilter()); s->set_ip_filter(options->getFilter());
}else{ }else{
qDebug("Ip Filter disabled");
s->set_ip_filter(ip_filter()); s->set_ip_filter(ip_filter());
} }
// Apply Proxy settings // Apply Proxy settings
@ -2297,7 +2299,7 @@ void GUI::setLocale(QString locale){
// Display Program Options // Display Program Options
void GUI::showOptions() const{ void GUI::showOptions() const{
options->showLoad(); options->show();
} }
// Is executed each time options are saved // Is executed each time options are saved

2
src/about_imp.h

@ -23,7 +23,7 @@
#define ABOUT_H #define ABOUT_H
#include "ui_about.h" #include "ui_about.h"
#define VERSION "v0.7.0rc5" #define VERSION "v0.7.0rc6"
class about : public QDialog, private Ui::AboutDlg{ class about : public QDialog, private Ui::AboutDlg{
Q_OBJECT Q_OBJECT

33
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(){ void options_imp::on_okButton_clicked(){
if(applyButton->isEnabled()){ if(applyButton->isEnabled()){
saveOptions(); saveOptions();
@ -784,6 +777,7 @@ void options_imp::on_browse_button_clicked(){
// //
// Lines may be commented using '#' or '//' // Lines may be commented using '#' or '//'
void options_imp::processFilterFile(const QString& filePath){ void options_imp::processFilterFile(const QString& filePath){
qDebug("Processing filter files");
filtersList->clear(); filtersList->clear();
QString manualFilters= misc::qBittorrentPath() + "ipfilter.dat"; QString manualFilters= misc::qBittorrentPath() + "ipfilter.dat";
QStringList filterFiles(manualFilters); QStringList filterFiles(manualFilters);
@ -794,27 +788,26 @@ void options_imp::processFilterFile(const QString& filePath){
if (file.exists()){ if (file.exists()){
if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){ if(!file.open(QIODevice::ReadOnly | QIODevice::Text)){
QMessageBox::critical(0, tr("I/O Error"), tr("Couldn't open:")+" "+filePath+" "+tr("in read mode.")); QMessageBox::critical(0, tr("I/O Error"), tr("Couldn't open:")+" "+filePath+" "+tr("in read mode."));
return; continue;
} }
unsigned int nbLine = 0; unsigned int nbLine = 0;
while (!file.atEnd()) { while (!file.atEnd()) {
++nbLine; ++nbLine;
QByteArray line = file.readLine(); QByteArray line = file.readLine();
QString strLine = QString(line.data()); if(!line.startsWith('#') && !line.startsWith("//")){
if(!strLine.startsWith('#') && !strLine.startsWith("//")){
// Line is not commented // Line is not commented
QStringList partsList = strLine.split(','); QList<QByteArray> partsList = line.split(',');
unsigned int nbElem = partsList.size(); unsigned int nbElem = partsList.size();
if(nbElem != 2 && nbElem != 3){ if(nbElem < 2){
QMessageBox::critical(0, tr("Invalid Line"), tr("Line")+" "+QString(misc::toString(nbLine).c_str())+" "+tr("is malformed.")); std::cout << "Ipfilter.dat: line " << nbLine << " is malformed.\n";
return; continue;
} }
int nbAccess = partsList.at(1).trimmed().toInt(); int nbAccess = partsList.at(1).trimmed().toInt();
if(nbAccess <= 127){ if(nbAccess <= 127){
QString strComment; QString strComment;
QString strStartIP = partsList.at(0).split('-').at(0).trimmed(); QString strStartIP = partsList.at(0).split('-').at(0).trimmed();
QString strEndIP = partsList.at(0).split('-').at(1).trimmed(); QString strEndIP = partsList.at(0).split('-').at(1).trimmed();
if(partsList.size() == 3){ if(nbElem > 2){
strComment = partsList.at(2).trimmed(); strComment = partsList.at(2).trimmed();
}else{ }else{
strComment = QString(); strComment = QString();
@ -822,17 +815,19 @@ void options_imp::processFilterFile(const QString& filePath){
// Split IP // Split IP
IP = strStartIP.split('.'); IP = strStartIP.split('.');
if(IP.size() != 4){ if(IP.size() != 4){
std::cout << "Ipfilter.dat: line " << nbLine << ", first IP is malformed.\n";
continue; 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('.'); IP = strEndIP.split('.');
if(IP.size() != 4){ if(IP.size() != 4){
std::cout << "Ipfilter.dat: line " << nbLine << ", second IP is malformed.\n";
continue; 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 // add it to list
QStringList item(strStartIP); QStringList item(QString(start.to_string().c_str()));
item.append(strEndIP); item.append(QString(last.to_string().c_str()));
if(!i){ if(!i){
item.append("Manual"); item.append("Manual");
}else{ }else{

2
src/options_imp.h

@ -70,8 +70,6 @@ class options_imp : public QDialog, private Ui::Dialog{
QString getPreviewProgram() const; QString getPreviewProgram() const;
bool getUseOSDAlways() const; bool getUseOSDAlways() const;
bool getUseOSDWhenHiddenOnly() const; bool getUseOSDWhenHiddenOnly() const;
// Other
void showLoad();
protected slots: protected slots:

2
src/src.pro

@ -4,7 +4,7 @@ ICONS_PATH = Icons
TRAYICON_CPP = trayicon TRAYICON_CPP = trayicon
#Set the following variable to 1 to enable debug #Set the following variable to 1 to enable debug
DEBUG_MODE = 1 DEBUG_MODE = 0
# Global # Global
TEMPLATE = app TEMPLATE = app

Loading…
Cancel
Save