Move the tag and rating information
Perhaps tags should be made a struct instead, but for the moment they've been moved, along with the ratings, to DanbooruPost as they're properties of the post.
This commit is contained in:
		
					parent
					
						
							
								f5aa505e0b
							
						
					
				
			
			
				commit
				
					
						9a49a1830a
					
				
			
		
					 2 changed files with 37 additions and 34 deletions
				
			
		| 
						 | 
				
			
			@ -34,40 +34,6 @@
 | 
			
		|||
 **/
 | 
			
		||||
namespace Danbooru {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @brief Types of tags
 | 
			
		||||
     *
 | 
			
		||||
     * A Danbooru tag is not simply a string, but carries some (limited)
 | 
			
		||||
     * semantic information. In particular, tags are organized in what they
 | 
			
		||||
     * refer to, either something related to the image itself, or to the
 | 
			
		||||
     * artist that drew it, or the copyrights associated to the image, or even
 | 
			
		||||
     * the characters that are represented in it.
 | 
			
		||||
     *
 | 
			
		||||
     **/
 | 
			
		||||
    enum TagType {
 | 
			
		||||
          General = 1, /**< Generic tags **/
 | 
			
		||||
          Artist = 2, /**< Tags related to artists **/
 | 
			
		||||
          Copyright = 4, /**<Tags related to copyrights **/
 | 
			
		||||
          Character= 8, /**<Tags related to characters **/
 | 
			
		||||
          Unknown = 16 /**< Unknown tags **/
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @brief Ratings for a Danbooru item
 | 
			
		||||
     *
 | 
			
		||||
     * A rating is how appropriate is an item for a general audience.
 | 
			
		||||
     *
 | 
			
		||||
     **/
 | 
			
		||||
    enum Rating {
 | 
			
		||||
        Safe = 1, /**< Safe for the general public **/
 | 
			
		||||
        Questionable = 2, /**< Might contain hints of risqueness of violence **/
 | 
			
		||||
        Explicit = 4 /**< Explicit material **/
 | 
			
		||||
     };
 | 
			
		||||
 | 
			
		||||
    Q_DECLARE_FLAGS(Ratings, Rating)
 | 
			
		||||
    Q_DECLARE_OPERATORS_FOR_FLAGS(Ratings)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}; // namespace Danbooru
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -77,6 +77,40 @@ namespace Danbooru {
 | 
			
		|||
    Q_PROPERTY(QSet<QString> tags READ tags)
 | 
			
		||||
    Q_PROPERTY(KUrl thumbnailUrl READ thumbnailUrl)
 | 
			
		||||
 | 
			
		||||
    public:
 | 
			
		||||
  
 | 
			
		||||
     /**
 | 
			
		||||
     * @brief Types of tags
 | 
			
		||||
     *
 | 
			
		||||
     * A Danbooru tag is not simply a string, but carries some (limited)
 | 
			
		||||
     * semantic information. In particular, tags are organized in what they
 | 
			
		||||
     * refer to, either something related to the image itself, or to the
 | 
			
		||||
     * artist that drew it, or the copyrights associated to the image, or even
 | 
			
		||||
     * the characters that are represented in it.
 | 
			
		||||
     *
 | 
			
		||||
     **/
 | 
			
		||||
 | 
			
		||||
    enum TagType {
 | 
			
		||||
        General = 1, /**< Generic tags **/
 | 
			
		||||
        Artist = 2, /**< Tags related to artists **/
 | 
			
		||||
        Copyright = 4, /**<Tags related to copyrights **/
 | 
			
		||||
        Character= 8, /**<Tags related to characters **/
 | 
			
		||||
        Unknown = 16 /**< Unknown tags **/
 | 
			
		||||
    };
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     * @brief Ratings for a Danbooru item
 | 
			
		||||
     *
 | 
			
		||||
     * A rating is how appropriate is an item for a general audience.
 | 
			
		||||
     *
 | 
			
		||||
     **/
 | 
			
		||||
    enum Rating {
 | 
			
		||||
        Safe = 1, /**< Safe for the general public **/
 | 
			
		||||
        Questionable = 2, /**< Might contain hints of risqueness of violence **/
 | 
			
		||||
        Explicit = 4 /**< Explicit material **/
 | 
			
		||||
     };
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    private:
 | 
			
		||||
 | 
			
		||||
        const QPixmap m_pixmap;
 | 
			
		||||
| 
						 | 
				
			
			@ -198,6 +232,9 @@ namespace Danbooru {
 | 
			
		|||
        const QString toString();
 | 
			
		||||
 | 
			
		||||
    };
 | 
			
		||||
    
 | 
			
		||||
    Q_DECLARE_FLAGS(Ratings, DanbooruPost::Rating)
 | 
			
		||||
    Q_DECLARE_OPERATORS_FOR_FLAGS(Ratings)
 | 
			
		||||
 | 
			
		||||
}; // namespace Danbooru
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue