TorrentContentModel code clean up

This commit is contained in:
Christophe Dumez
2012-08-26 20:52:53 +03:00
parent 268dad58f6
commit c43c362903
4 changed files with 7 additions and 8 deletions

View File

@@ -113,7 +113,7 @@ bool TorrentContentModel::setData(const QModelIndex& index, const QVariant& valu
qDebug("setData(%s, %d", qPrintable(item->name()), value.toInt());
if (item->priority() != value.toInt()) {
if (value.toInt() == Qt::PartiallyChecked)
item->setPriority(prio::PARTIAL);
item->setPriority(prio::MIXED);
else if (value.toInt() == Qt::Unchecked)
item->setPriority(prio::IGNORED);
else
@@ -171,7 +171,7 @@ QVariant TorrentContentModel::data(const QModelIndex& index, int role) const
if (index.column() == 0 && role == Qt::CheckStateRole) {
if (item->data(TorrentContentModelItem::COL_PRIO).toInt() == prio::IGNORED)
return Qt::Unchecked;
if (item->data(TorrentContentModelItem::COL_PRIO).toInt() == prio::PARTIAL)
if (item->data(TorrentContentModelItem::COL_PRIO).toInt() == prio::MIXED)
return Qt::PartiallyChecked;
return Qt::Checked;
}