]> Some of my projects - anidbudpclient.git/commitdiff
Add method to read the vote as double.
authorAPTX <redacted>
Wed, 23 May 2012 22:18:43 +0000 (00:18 +0200)
committerAPTX <redacted>
Wed, 23 May 2012 22:18:43 +0000 (00:18 +0200)
votecommand.cpp
votecommand.h

index 8e9cc50..f14b7db 100644 (file)
@@ -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;
index cfed933..1ee1616 100644 (file)
@@ -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;