Changeset 10440


Ignore:
Timestamp:
Apr 3, 2010, 1:56:23 PM (11 years ago)
Author:
charles
Message:

(trunk qt) #3116 "show file sizes in the file tree" -- implemented for 2.00 by a patch from Longinus00

Location:
trunk/qt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/file-tree.cc

    r9890 r10440  
    8787
    8888    switch( column ) {
    89         case COL_NAME: value.setValue( name() ); break;
     89        case COL_NAME: value.setValue( fileSizeName( ) ); break;
    9090        case COL_PROGRESS: value.setValue( progress( ) ); break;
    9191        case COL_WANTED: value.setValue( isSubtreeWanted( ) ); break;
     
    115115        d = have / (double)total;
    116116    return d;
     117}
     118
     119QString
     120FileTreeItem :: fileSizeName( ) const
     121{
     122    uint64_t have(0), total(0);
     123    QString str;
     124    getSubtreeSize( have, total );
     125    str = QString( name() + " (%1)" ).arg( Utils::sizeToString( total ) );
     126    return str;
    117127}
    118128
  • trunk/qt/file-tree.h

    r9868 r10440  
    6161        QString priorityString( ) const;
    6262        void getSubtreeSize( uint64_t& have, uint64_t& total ) const;
     63        QString fileSizeName( ) const;
    6364        double progress( ) const;
    6465        int priority( ) const;
Note: See TracChangeset for help on using the changeset viewer.