Now user-created labels "all" and "none" works as regular labels

This commit is contained in:
Ivan Sorokin 2014-11-09 03:36:53 +03:00
parent f235c0ae6c
commit 976982ba09
3 changed files with 7 additions and 10 deletions

View file

@ -359,10 +359,10 @@ void TransferListFiltersWidget::removeSelectedLabel() {
void TransferListFiltersWidget::applyLabelFilter(int row) {
switch(row) {
case 0:
transferList->applyLabelFilter("all");
transferList->applyLabelFilterAll();
break;
case 1:
transferList->applyLabelFilter("none");
transferList->applyLabelFilter(QString());
break;
default:
transferList->applyLabelFilter(labelFilters->labelFromRow(row));

View file

@ -885,15 +885,11 @@ void TransferListWidget::currentChanged(const QModelIndex& current, const QModel
emit currentTorrentChanged(h);
}
void TransferListWidget::applyLabelFilterAll() {
nameFilterModel->disableLabelFilter();
}
void TransferListWidget::applyLabelFilter(QString label) {
if (label == "all") {
nameFilterModel->disableLabelFilter();
return;
}
if (label == "none") {
nameFilterModel->setLabelFilter(QString());
return;
}
qDebug("Applying Label filter: %s", qPrintable(label));
nameFilterModel->setLabelFilter(label);
}

View file

@ -80,6 +80,7 @@ public slots:
void displayDLHoSMenu(const QPoint&);
void applyNameFilter(const QString& name);
void applyStatusFilter(int f);
void applyLabelFilterAll();
void applyLabelFilter(QString label);
void previewFile(QString filePath);
void removeLabelFromRows(QString label);