mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 12:34:19 +00:00
Improve drawing speed of transferlist with many torrents.
This commit is contained in:
parent
0322002b46
commit
01307b377e
@ -9,6 +9,7 @@
|
|||||||
- BUGFIX: Add confirmation dialog for "Force recheck" action (closes #131)
|
- BUGFIX: Add confirmation dialog for "Force recheck" action (closes #131)
|
||||||
- BUGFIX: Greatly improve RSS manager performance (closes #34)
|
- BUGFIX: Greatly improve RSS manager performance (closes #34)
|
||||||
- OTHER: Generate translations at configure time to reduce tarball size
|
- OTHER: Generate translations at configure time to reduce tarball size
|
||||||
|
- PERFORMANCE: Impove drawing speed of tranferlist when there are many torrents(>100)
|
||||||
|
|
||||||
* Thu Aug 09 2012 - Christophe Dumez <chris@qbittorrent.org> - v3.0.0
|
* Thu Aug 09 2012 - Christophe Dumez <chris@qbittorrent.org> - v3.0.0
|
||||||
- FEATURE: Brand new torrent addition dialog
|
- FEATURE: Brand new torrent addition dialog
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QFontMetrics>
|
||||||
|
|
||||||
#include "torrentmodel.h"
|
#include "torrentmodel.h"
|
||||||
#include "torrentpersistentdata.h"
|
#include "torrentpersistentdata.h"
|
||||||
@ -301,6 +302,19 @@ QVariant TorrentModel::data(const QModelIndex &index, int role) const
|
|||||||
if (!index.isValid()) return QVariant();
|
if (!index.isValid()) return QVariant();
|
||||||
try {
|
try {
|
||||||
if (index.row() >= 0 && index.row() < rowCount() && index.column() >= 0 && index.column() < columnCount())
|
if (index.row() >= 0 && index.row() < rowCount() && index.column() >= 0 && index.column() < columnCount())
|
||||||
|
if (role == Qt::SizeHintRole)
|
||||||
|
{
|
||||||
|
QSize size(m_torrents[index.row()]->data(index.column(), role).toSize());
|
||||||
|
QFont font;
|
||||||
|
QFontMetrics fm(font);
|
||||||
|
QIcon icon(":/Icons/skin/downloading.png");
|
||||||
|
int fm_height(fm.height());
|
||||||
|
QList<QSize> ic_sizes(icon.availableSizes());
|
||||||
|
int icon_height(ic_sizes[0].height());
|
||||||
|
size.setHeight(fm_height > icon_height ? fm_height : icon_height);
|
||||||
|
return QVariant(size);
|
||||||
|
}
|
||||||
|
else
|
||||||
return m_torrents[index.row()]->data(index.column(), role);
|
return m_torrents[index.row()]->data(index.column(), role);
|
||||||
} catch(invalid_handle&) {}
|
} catch(invalid_handle&) {}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
@ -67,6 +67,7 @@ using namespace libtorrent;
|
|||||||
TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window, QBtSession *_BTSession):
|
TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window, QBtSession *_BTSession):
|
||||||
QTreeView(parent), BTSession(_BTSession), main_window(main_window) {
|
QTreeView(parent), BTSession(_BTSession), main_window(main_window) {
|
||||||
|
|
||||||
|
setUniformRowHeights(true);
|
||||||
// Load settings
|
// Load settings
|
||||||
bool column_loaded = loadSettings();
|
bool column_loaded = loadSettings();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user