Move to the new rating structure

This commit is contained in:
Luca Beltrame 2014-10-04 00:03:01 +02:00
parent 25ee41c5e8
commit f22c0b6d94
2 changed files with 14 additions and 17 deletions

View file

@ -45,7 +45,6 @@
#include "danbooru.h"
class QPixmap;
namespace Danbooru {
@ -78,7 +77,7 @@ namespace Danbooru {
Q_PROPERTY(QUrl thumbnailUrl READ thumbnailUrl)
public:
/**
* @brief Ratings for a Danbooru item
*
@ -91,10 +90,10 @@ namespace Danbooru {
Explicit = 4 /**< Explicit material **/
};
private:
const QPixmap m_pixmap;
QPixmap m_pixmap;
// basic features of a post
@ -106,7 +105,7 @@ namespace Danbooru {
QUrl m_url;
QUrl m_thumbnailUrl;
QSet<QString> m_tags;
Ratings m_rating;
DanbooruPost::Rating m_rating;
static const QMap<QString, Rating> RATING_MAP;
@ -193,18 +192,18 @@ namespace Danbooru {
/**
* @return A pointer to the thumbnail's pixmap.
**/
const QPixmap pixmap() const;
QPixmap pixmap() const;
/**
* @return The current post's rating.
**/
const Ratings rating() const;
const Rating rating() const;
/**
* Set the post's pixmap to a specific QPixmap instance's pointer.
*
**/
void setPixmap(const QPixmap pixmap);
void setPixmap(const QPixmap& pixmap);
/**
* @return A string representation of the post.
@ -213,7 +212,7 @@ namespace Danbooru {
const QString toString();
};
Q_DECLARE_FLAGS(Ratings, DanbooruPost::Rating)
Q_DECLARE_OPERATORS_FOR_FLAGS(Ratings)