mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Merge pull request #1021 from PhenomRetroShare/Fix_ProgressSorting
Fix File Transfert Progress Sorting.
This commit is contained in:
commit
54ee6509d1
@ -161,7 +161,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
|||||||
case COLUMN_PROGRESS:
|
case COLUMN_PROGRESS:
|
||||||
{
|
{
|
||||||
// create a xProgressBar
|
// create a xProgressBar
|
||||||
FileProgressInfo pinfo = index.data().value<FileProgressInfo>() ;
|
FileProgressInfo pinfo = index.data(Qt::UserRole).value<FileProgressInfo>() ;
|
||||||
|
|
||||||
// std::cerr << "drawing progress info: nb_chunks = " << pinfo.nb_chunks ;
|
// std::cerr << "drawing progress info: nb_chunks = " << pinfo.nb_chunks ;
|
||||||
// for(uint i=0;i<pinfo.cmap._map.size();++i)
|
// for(uint i=0;i<pinfo.cmap._map.size();++i)
|
||||||
|
@ -979,7 +979,8 @@ int TransfersDialog::addDLItem(int row, const FileInfo &fileInfo)
|
|||||||
|
|
||||||
DLListModel->setData(DLListModel->index(row, COLUMN_COMPLETED), QVariant((qlonglong)completed));
|
DLListModel->setData(DLListModel->index(row, COLUMN_COMPLETED), QVariant((qlonglong)completed));
|
||||||
DLListModel->setData(DLListModel->index(row, COLUMN_DLSPEED), QVariant((double)fileDlspeed));
|
DLListModel->setData(DLListModel->index(row, COLUMN_DLSPEED), QVariant((double)fileDlspeed));
|
||||||
DLListModel->setData(DLListModel->index(row, COLUMN_PROGRESS), QVariant::fromValue(pinfo));
|
DLListModel->setData(DLListModel->index(row, COLUMN_PROGRESS), QVariant((float)pinfo.progress));
|
||||||
|
DLListModel->setData(DLListModel->index(row, COLUMN_PROGRESS), QVariant::fromValue(pinfo), Qt::UserRole);
|
||||||
DLListModel->setData(DLListModel->index(row, COLUMN_STATUS), QVariant(status));
|
DLListModel->setData(DLListModel->index(row, COLUMN_STATUS), QVariant(status));
|
||||||
DLListModel->setData(DLListModel->index(row, COLUMN_PRIORITY), QVariant(priority));
|
DLListModel->setData(DLListModel->index(row, COLUMN_PRIORITY), QVariant(priority));
|
||||||
DLListModel->setData(DLListModel->index(row, COLUMN_REMAINING), QVariant((qlonglong)remaining));
|
DLListModel->setData(DLListModel->index(row, COLUMN_REMAINING), QVariant((qlonglong)remaining));
|
||||||
@ -1083,7 +1084,8 @@ int TransfersDialog::addPeerToDLItem(QStandardItem *dlItem, const QString& name,
|
|||||||
iSize->setData(QVariant(QString()), Qt::DisplayRole);
|
iSize->setData(QVariant(QString()), Qt::DisplayRole);
|
||||||
iCompleted->setData(QVariant(QString()), Qt::DisplayRole);
|
iCompleted->setData(QVariant(QString()), Qt::DisplayRole);
|
||||||
iDlSpeed->setData(QVariant((double)dlspeed), Qt::DisplayRole);
|
iDlSpeed->setData(QVariant((double)dlspeed), Qt::DisplayRole);
|
||||||
iProgress->setData(QVariant::fromValue(peerInfo), Qt::DisplayRole);
|
iProgress->setData(QVariant((float)peerInfo.progress), Qt::DisplayRole);
|
||||||
|
iProgress->setData(QVariant::fromValue(peerInfo), Qt::UserRole);
|
||||||
iSource->setData(QVariant(QString()), Qt::DisplayRole);
|
iSource->setData(QVariant(QString()), Qt::DisplayRole);
|
||||||
|
|
||||||
iPriority->setData(QVariant(QString()), Qt::DisplayRole); // blank field for priority
|
iPriority->setData(QVariant(QString()), Qt::DisplayRole); // blank field for priority
|
||||||
@ -1113,7 +1115,8 @@ int TransfersDialog::addPeerToDLItem(QStandardItem *dlItem, const QString& name,
|
|||||||
} else {
|
} else {
|
||||||
// just update the child (peer)
|
// just update the child (peer)
|
||||||
dlItem->child(childRow, COLUMN_DLSPEED)->setData(QVariant((double)dlspeed), Qt::DisplayRole);
|
dlItem->child(childRow, COLUMN_DLSPEED)->setData(QVariant((double)dlspeed), Qt::DisplayRole);
|
||||||
dlItem->child(childRow, COLUMN_PROGRESS)->setData(QVariant::fromValue(peerInfo), Qt::DisplayRole);
|
dlItem->child(childRow, COLUMN_PROGRESS)->setData(QVariant((float)peerInfo.progress), Qt::DisplayRole);
|
||||||
|
dlItem->child(childRow, COLUMN_PROGRESS)->setData(QVariant::fromValue(peerInfo), Qt::UserRole);
|
||||||
|
|
||||||
siName = dlItem->child(childRow,COLUMN_NAME);
|
siName = dlItem->child(childRow,COLUMN_NAME);
|
||||||
siStatus = dlItem->child(childRow, COLUMN_STATUS);
|
siStatus = dlItem->child(childRow, COLUMN_STATUS);
|
||||||
|
Loading…
Reference in New Issue
Block a user