From: APTX Date: Wed, 23 May 2012 22:18:43 +0000 (+0200) Subject: Add method to read the vote as double. X-Git-Url: https://gitweb.tyo.aptx.org/?a=commitdiff_plain;h=6f4e69c22e8979aeaa83552867c5cf8cecbe586f;p=anidbudpclient.git Add method to read the vote as double. --- diff --git a/votecommand.cpp b/votecommand.cpp index 8e9cc50..f14b7db 100644 --- a/votecommand.cpp +++ b/votecommand.cpp @@ -188,6 +188,11 @@ int VoteReply::value() const return m_value; } +double VoteReply::vote() const +{ + return double(m_value) / 1000; +} + AniDBUdpClient::VoteCommand::VoteType VoteReply::voteType() const { return m_voteType; diff --git a/votecommand.h b/votecommand.h index cfed933..1ee1616 100644 --- a/votecommand.h +++ b/votecommand.h @@ -72,12 +72,14 @@ class ANIDBUDPCLIENTSHARED_EXPORT VoteReply : public AbstractReply Q_PROPERTY(QString entityName READ entityName); Q_PROPERTY(int value READ value); + Q_PROPERTY(double vote READ vote); // Q_PROPERTY(AniDBUdpClient::VoteCommand::VoteType voteType READ voteType); Q_PROPERTY(int entityId READ entityId); public: QString entityName() const; int value() const; + double vote() const; VoteCommand::VoteType voteType() const; int entityId() const;