Browse Source

- Bugfix: User can't empty the trackers list

adaptive-webui-19844
Christophe Dumez 18 years ago
parent
commit
1cff97f65d
  1. 10
      src/properties_imp.cpp

10
src/properties_imp.cpp

@ -23,6 +23,7 @@ @@ -23,6 +23,7 @@
#include "misc.h"
#include "PropListDelegate.h"
#include <QInputDialog>
#include <QMessageBox>
// Constructor
properties::properties(QWidget *parent, torrent_handle &h, QStringList trackerErrors): QDialog(parent), h(h){
@ -190,9 +191,16 @@ void properties::deleteSelectedTrackers(){ @@ -190,9 +191,16 @@ void properties::deleteSelectedTrackers(){
QList<QListWidgetItem *> selectedItems;
selectedItems = trackersURLS->selectedItems();
QListWidgetItem *item;
unsigned int nbTrackers = trackers.size();
if(nbTrackers == (unsigned int) selectedItems.size()){
QMessageBox::warning(this, tr("qBittorrent"),
tr("Trackers list can't be empty."),
QMessageBox::Ok);
return;
}
foreach(item, selectedItems){
QString url = item->text();
for(unsigned int i=0; i<trackers.size(); ++i){
for(unsigned int i=0; i<nbTrackers; ++i){
if(QString(trackers.at(i).url.c_str()) == url){
trackers.erase(trackers.begin()+i);
break;

Loading…
Cancel
Save