Changeset 13383 for trunk/qt/file-tree.h


Ignore:
Timestamp:
Jul 12, 2012, 11:37:04 PM (10 years ago)
Author:
jordan
Message:

(trunk, qt) #4961 -- make the file list more responsive when a torrent has an extreme number of files.

Before this patch, the test torrent I had with ~10k files took 8 seconds to load. After this patch, it takes less than 1 second.

File:
1 edited

Legend:

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

    r11092 r13383  
    1818#include <QItemDelegate>
    1919#include <QList>
     20#include <QHash>
    2021#include <QSet>
    2122#include <QSize>
     
    4445            myIndex(fileIndex), myParent(0), myName(name),
    4546            myPriority(0), myIsWanted(0),
    46             myHaveSize(0), myTotalSize(0) { }
     47            myHaveSize(0), myTotalSize(0),
     48            myChildRowsDirty(false) { }
    4749
    4850    public:
     
    7375        FileTreeItem * myParent;
    7476        QList<FileTreeItem*> myChildren;
     77        QHash<QString,int> myChildRows;
     78        QHash<QString,int>& getMyChildRows();
    7579        const QString myName;
    7680        int myPriority;
     
    7882        uint64_t myHaveSize;
    7983        uint64_t myTotalSize;
     84        bool myChildRowsDirty;
    8085};
    8186
Note: See TracChangeset for help on using the changeset viewer.