Make BitTorrent::TorrentState strongly-typed enum

This is needed to forward declare this type and pass it by value.

Conversion from/to QVariant are hanled via Q_DECLARE_METATYPE, while
TorrentState::toString() function was used in webui only and as such is
moved there.
This commit is contained in:
Eugene Shalygin
2017-02-18 01:38:40 +01:00
parent 19bb6f5fe0
commit db35bb54e1
6 changed files with 79 additions and 97 deletions

View File

@@ -39,6 +39,10 @@ class QStyleOptionViewItem;
class QModelIndex;
QT_END_NAMESPACE
namespace BitTorrent
{
enum class TorrentState;
}
// Defines for download list list columns
class TransferListDelegate: public QItemDelegate
@@ -52,7 +56,7 @@ public:
QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const;
private:
QString getStatusString(const int state) const;
QString getStatusString(const BitTorrent::TorrentState state) const;
};
#endif // TRANSFERLISTDELEGATE_H