X-Git-Url: http://git.maemo.org/git/?p=qtrapids;a=blobdiff_plain;f=src%2Fgui%2FSeedView.h;h=37fdf75792cc6d37ebf472e39028a57c9d2101b2;hp=9b05e998aaf5503db24fc107e42f12a8c3e51cf2;hb=5032546701da06d7307fc543d74be93e5319c350;hpb=08828f51a534f17235944d186b8f1b0c69696e1b diff --git a/src/gui/SeedView.h b/src/gui/SeedView.h index 9b05e99..37fdf75 100644 --- a/src/gui/SeedView.h +++ b/src/gui/SeedView.h @@ -31,64 +31,64 @@ class SeedViewItem; */ class SeedView : public QTreeWidget { -Q_OBJECT - public: - SeedView(QWidget* parent); - - ~SeedView(); - - void newItem(QTorrentHandle const* handle); - void updateItem(QTorrentHandle const* handle); - - private slots: - void on_itemPressed(QTreeWidgetItem *item, int column); - - private: - // Maps torrent to SeedView item. - // Key: SHA1 info hash of torrent. Data: View item corresponding to torrent. - std::map items_; - - // Name - // Size - // Status - // UP speed - // Seeds/Leechers - // Connected peers - // total uploaded - // ratio + Q_OBJECT +public: + SeedView(QWidget* parent); + + ~SeedView(); + + void newItem(qtrapids::QTorrentHandle const* handle); + void updateItem(qtrapids::QTorrentHandle const* handle); + +private slots: + void on_itemPressed(QTreeWidgetItem *item, int column); + +private: + // Maps torrent to SeedView item. + // Key: SHA1 info hash of torrent. Data: View item corresponding to torrent. + std::map items_; + + // Name + // Size + // Status + // UP speed + // Seeds/Leechers + // Connected peers + // total uploaded + // ratio }; /** @class DownloadViewItem @brief Represents one item row of DownloadView */ -class SeedViewItem : public QTreeWidgetItem { - - public: - - SeedViewItem(QTreeWidget* parent, int type) : +class SeedViewItem : public QTreeWidgetItem +{ + +public: + + SeedViewItem(QTreeWidget* parent, int type) : QTreeWidgetItem(parent, type = QTreeWidgetItem::UserType) {}; - - SeedViewItem(const QStringList& strings, int type = QTreeWidgetItem::UserType ) : + + SeedViewItem(const QStringList& strings, int type = QTreeWidgetItem::UserType ) : QTreeWidgetItem (strings, type = Type) {}; - - - /// @return An item comprising of string list, suitable for QTableView - /// header. - static SeedViewItem *getHeaderItem() - { - SeedViewItem *item - = new SeedViewItem(QStringList() - << "Name" - << "Size" << "Status" - << "Progress" << "UL speed" << "Seeds/Leechers" - << "Conn. peers" - << "Ratio"); - - return item; - } - - /// @todo QTorrentHandle as one hidden column + + + /// @return An item comprising of string list, suitable for QTableView + /// header. + static SeedViewItem *getHeaderItem() { + SeedViewItem *item + = new SeedViewItem(QStringList() + << "Name" + << "Size" << "Status" + << "Progress" << "UL speed" << "Seeds/Leechers" + << "Conn. peers" + << "Ratio"); + + return item; + } + + /// @todo QTorrentHandle as one hidden column }; #endif