Merge pull request #2791 from pmzqla/file-priority

Increase priority value of "High"
This commit is contained in:
sledgehammer999 2015-06-20 21:13:03 +03:00
commit c61566d133
2 changed files with 11 additions and 10 deletions

View file

@ -42,6 +42,7 @@
#include <QApplication> #include <QApplication>
#include "misc.h" #include "misc.h"
#include "propertieswidget.h" #include "propertieswidget.h"
#include "torrentcontentmodelitem.h"
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
@ -109,16 +110,16 @@ public:
QItemDelegate::drawBackground(painter, opt, index); QItemDelegate::drawBackground(painter, opt, index);
QString text = ""; QString text = "";
switch(index.data().toInt()) { switch(index.data().toInt()) {
case -1: case prio::MIXED:
text = tr("Mixed", "Mixed (priorities"); text = tr("Mixed", "Mixed (priorities");
break; break;
case 0: case prio::IGNORED:
text = tr("Not downloaded"); text = tr("Not downloaded");
break; break;
case 2: case prio::HIGH:
text = tr("High", "High (priority)"); text = tr("High", "High (priority)");
break; break;
case 7: case prio::MAXIMUM:
text = tr("Maximum", "Maximum (priority)"); text = tr("Maximum", "Maximum (priority)");
break; break;
default: default:
@ -139,10 +140,10 @@ public:
QComboBox *combobox = static_cast<QComboBox*>(editor); QComboBox *combobox = static_cast<QComboBox*>(editor);
// Set combobox index // Set combobox index
switch(index.data().toInt()) { switch(index.data().toInt()) {
case 2: case prio::HIGH:
combobox->setCurrentIndex(1); combobox->setCurrentIndex(1);
break; break;
case 7: case prio::MAXIMUM:
combobox->setCurrentIndex(2); combobox->setCurrentIndex(2);
break; break;
default: default:
@ -177,13 +178,13 @@ public slots:
qDebug("PropListDelegate: setModelData(%d)", value); qDebug("PropListDelegate: setModelData(%d)", value);
switch(value) { switch(value) {
case 1: case 1:
model->setData(index, 2); // HIGH model->setData(index, prio::HIGH);
break; break;
case 2: case 2:
model->setData(index, 7); // MAX model->setData(index, prio::MAXIMUM);
break; break;
default: default:
model->setData(index, 1); // NORMAL model->setData(index, prio::NORMAL);
} }
emit filteredFilesChanged(); emit filteredFilesChanged();
} }

View file

@ -37,7 +37,7 @@
#include <libtorrent/torrent_info.hpp> #include <libtorrent/torrent_info.hpp>
namespace prio { namespace prio {
enum FilePriority {IGNORED=0, NORMAL=1, HIGH=2, MAXIMUM=7, MIXED=-1}; enum FilePriority {IGNORED=0, NORMAL=1, HIGH=6, MAXIMUM=7, MIXED=-1};
} }
class TorrentContentModelFolder; class TorrentContentModelFolder;