diff --git a/qt/file-tree.cc b/qt/file-tree.cc index 006e7107c..6eb5df49a 100644 --- a/qt/file-tree.cc +++ b/qt/file-tree.cc @@ -86,7 +86,7 @@ FileTreeItem :: data( int column ) const QVariant value; switch( column ) { - case COL_NAME: value.setValue( name() ); break; + case COL_NAME: value.setValue( fileSizeName( ) ); break; case COL_PROGRESS: value.setValue( progress( ) ); break; case COL_WANTED: value.setValue( isSubtreeWanted( ) ); break; case COL_PRIORITY: value.setValue( priorityString( ) ); break; @@ -116,6 +116,16 @@ FileTreeItem :: progress( ) const return d; } +QString +FileTreeItem :: fileSizeName( ) const +{ + uint64_t have(0), total(0); + QString str; + getSubtreeSize( have, total ); + str = QString( name() + " (%1)" ).arg( Utils::sizeToString( total ) ); + return str; +} + bool FileTreeItem :: update( int index, bool wanted, int priority, uint64_t totalSize, uint64_t haveSize ) { diff --git a/qt/file-tree.h b/qt/file-tree.h index 226621a94..7714afccd 100644 --- a/qt/file-tree.h +++ b/qt/file-tree.h @@ -60,6 +60,7 @@ class FileTreeItem: public QObject void setSubtreeWanted( bool, QSet& fileIds ); QString priorityString( ) const; void getSubtreeSize( uint64_t& have, uint64_t& total ) const; + QString fileSizeName( ) const; double progress( ) const; int priority( ) const; int isSubtreeWanted( ) const;