Refactor side panel code. Encapsulate each widget's logic in their own subclass.

This commit is contained in:
sledgehammer999
2015-03-26 03:39:45 +02:00
parent 1bb968f9fd
commit ff1aaa8733
3 changed files with 468 additions and 473 deletions

View File

@@ -1583,16 +1583,18 @@ void Preferences::setTorrentLabels(const QStringList& labels)
void Preferences::addTorrentLabel(const QString& label)
{
QStringList labels = value("TransferListFilters/customLabels").toStringList();
if (!labels.contains(label))
labels << label;
if (labels.contains(label))
return;
labels << label;
setValue("TransferListFilters/customLabels", labels);
}
void Preferences::removeTorrentLabel(const QString& label)
{
QStringList labels = value("TransferListFilters/customLabels").toStringList();
if (labels.contains(label))
labels.removeOne(label);
if (!labels.contains(label))
return;
labels.removeOne(label);
setValue("TransferListFilters/customLabels", labels);
}