mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-11 18:45:17 -04:00
- Implemented chunk-based file transfer from partial sources. This in particular means:
- exchange of chunk availability maps from different peers - correct handling of what is available to which source before asking the data - correct display of chunks in the progress bars - generalised the use of compressed chunk maps - removed the size parameters from the hash search functions - In addition: - suppressed a number of per-value transfers of std::string - improved the FileTransferInfo Widget, to show some additional info Still to be done: - chunk map exchange for non anonymous traffic (easy) - improve accuracy of completion for uploads (for now it's a integer number of chunks) - check compilation on windows git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1993 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
add5d45eeb
commit
cfaaec31c7
36 changed files with 1247 additions and 573 deletions
|
@ -19,6 +19,7 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
#include <rsiface/rstypes.h>
|
||||
#include <QModelIndex>
|
||||
#include <QPainter>
|
||||
#include <QStyleOptionProgressBarV2>
|
||||
|
@ -28,6 +29,8 @@
|
|||
|
||||
#include "ULListDelegate.h"
|
||||
|
||||
Q_DECLARE_METATYPE(FileProgressInfo)
|
||||
|
||||
ULListDelegate::ULListDelegate(QObject *parent) : QAbstractItemDelegate(parent)
|
||||
{
|
||||
;
|
||||
|
@ -123,25 +126,22 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
|||
painter->drawText(option.rect, Qt::AlignRight, temp);
|
||||
break;
|
||||
case UPROGRESS:
|
||||
{
|
||||
progress = index.data().toDouble();
|
||||
// create a xProgressBar
|
||||
xProgressBar progressBar(option.rect, painter );// the 3rd param is the color schema (0 is the default value)
|
||||
|
||||
QString ext = QFileInfo(QString::fromStdString(index.sibling(index.row(), UNAME).data().toString().toStdString())).suffix();;
|
||||
if (ext == "rsfc" || ext == "rsrl" || ext == "dist" || ext == "rsfb")
|
||||
{
|
||||
progressBar.setColorSchema( 9);
|
||||
}
|
||||
else
|
||||
{
|
||||
progressBar.setColorSchema( 8);
|
||||
}
|
||||
|
||||
progressBar.setDisplayText(false); // should display % text?
|
||||
progressBar.setValue(progress); // set the progress value
|
||||
progressBar.setVerticalSpan(1);
|
||||
progressBar.paint(); // paint the progress bar
|
||||
{
|
||||
FileProgressInfo pinfo = index.data().value<FileProgressInfo>() ;
|
||||
|
||||
// create a xProgressBar
|
||||
xProgressBar progressBar(pinfo.cmap,option.rect,painter,0);// the 3rd param is the color schema (0 is the default value)
|
||||
|
||||
QString ext = QFileInfo(QString::fromStdString(index.sibling(index.row(), UNAME).data().toString().toStdString())).suffix();;
|
||||
if (ext == "rsfc" || ext == "rsrl" || ext == "dist" || ext == "rsfb")
|
||||
progressBar.setColorSchema( 9);
|
||||
else
|
||||
progressBar.setColorSchema( 8);
|
||||
|
||||
progressBar.setDisplayText(true); // should display % text?
|
||||
progressBar.setValue(pinfo.progress); // set the progress value
|
||||
progressBar.setVerticalSpan(1);
|
||||
progressBar.paint(); // paint the progress bar
|
||||
}
|
||||
painter->drawText(option.rect, Qt::AlignCenter, newopt.text);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue