From 1cff97f65d6e651aa35ee7605acd005cbb7e570c Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Wed, 16 May 2007 18:55:34 +0000 Subject: [PATCH] - Bugfix: User can't empty the trackers list --- src/properties_imp.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/properties_imp.cpp b/src/properties_imp.cpp index a4a5bb64e..402733b9e 100644 --- a/src/properties_imp.cpp +++ b/src/properties_imp.cpp @@ -23,6 +23,7 @@ #include "misc.h" #include "PropListDelegate.h" #include +#include // Constructor properties::properties(QWidget *parent, torrent_handle &h, QStringList trackerErrors): QDialog(parent), h(h){ @@ -190,9 +191,16 @@ void properties::deleteSelectedTrackers(){ QList 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