mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-04-06 14:03:54 -04:00
Use macro for priority values instead of constants.
This commit is contained in:
parent
c5c406bb98
commit
8072d245f3
@ -198,13 +198,13 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
||||
case COLUMN_PRIORITY:
|
||||
{
|
||||
double dblValue = index.data().toDouble();
|
||||
if (dblValue == 0.0)
|
||||
if (dblValue == PRIORITY_NULL)
|
||||
temp = "";
|
||||
else if (dblValue == 0.1)
|
||||
else if (dblValue == PRIORITY_FASTER)
|
||||
temp = tr("Faster");
|
||||
else if (dblValue == 0.2)
|
||||
else if (dblValue == PRIORITY_AVERAGE)
|
||||
temp = tr("Average");
|
||||
else if (dblValue == 0.3)
|
||||
else if (dblValue == PRIORITY_SLOWER)
|
||||
temp = tr("Slower");
|
||||
else
|
||||
temp = QString::number((uint32_t)dblValue);
|
||||
|
@ -42,6 +42,11 @@
|
||||
#define COLUMN_PATH 12
|
||||
#define COLUMN_COUNT 13
|
||||
|
||||
#define PRIORITY_NULL 0.0
|
||||
#define PRIORITY_FASTER 0.1
|
||||
#define PRIORITY_AVERAGE 0.2
|
||||
#define PRIORITY_SLOWER 0.3
|
||||
|
||||
|
||||
#define MAX_CHAR_TMP 128
|
||||
|
||||
|
@ -885,7 +885,7 @@ int TransfersDialog::addDLItem(int row, const FileInfo &fileInfo)
|
||||
default: status = tr("Unknown"); break;
|
||||
}
|
||||
|
||||
double priority = 0;
|
||||
double priority = PRIORITY_NULL;
|
||||
|
||||
if (fileInfo.downloadStatus == FT_STATE_QUEUED) {
|
||||
priority = fileInfo.queue_position;
|
||||
@ -893,10 +893,10 @@ int TransfersDialog::addDLItem(int row, const FileInfo &fileInfo)
|
||||
priority = 0;
|
||||
} else {
|
||||
switch (fileInfo.priority) {
|
||||
case SPEED_LOW: priority = 0.3; break;
|
||||
case SPEED_NORMAL: priority = 0.2; break;
|
||||
case SPEED_HIGH: priority = 0.1; break;
|
||||
default: priority = 0.2; break;
|
||||
case SPEED_LOW: priority = PRIORITY_SLOWER; break;
|
||||
case SPEED_NORMAL: priority = PRIORITY_AVERAGE; break;
|
||||
case SPEED_HIGH: priority = PRIORITY_FASTER; break;
|
||||
default: priority = PRIORITY_AVERAGE; break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1082,7 +1082,7 @@ int TransfersDialog::addPeerToDLItem(QStandardItem *dlItem, const RsPeerId& peer
|
||||
iProgress->setData(QVariant::fromValue(peerInfo), Qt::UserRole);
|
||||
iSource->setData(QVariant(QString()), Qt::DisplayRole);
|
||||
|
||||
iPriority->setData(QVariant((double)0.0), Qt::DisplayRole); // blank field for priority
|
||||
iPriority->setData(QVariant((double)PRIORITY_NULL), Qt::DisplayRole); // blank field for priority
|
||||
iRemaining->setData(QVariant(QString()), Qt::DisplayRole);
|
||||
iDownloadTime->setData(QVariant(QString()), Qt::DisplayRole);
|
||||
iID->setData(QVariant() , Qt::DisplayRole);
|
||||
|
Loading…
x
Reference in New Issue
Block a user