Initial work to make enums saner
This commit is contained in:
		
					parent
					
						
							
								bcecd30031
							
						
					
				
			
			
				commit
				
					
						6533b64a22
					
				
			
		
					 1 changed files with 9 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -25,6 +25,7 @@
 | 
			
		|||
#include <QDebug>
 | 
			
		||||
#include <qjson/parser.h>
 | 
			
		||||
#include <kdebug.h>
 | 
			
		||||
#include <QStack>
 | 
			
		||||
 | 
			
		||||
// KDE
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -254,19 +255,19 @@ const QStringList DanbooruService::allowedRatings() const
 | 
			
		|||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DanbooruService::setMaximumAllowedRating(const Danbooru::Ratings& rating)
 | 
			
		||||
void DanbooruService::setMaximumAllowedRating(const DanbooruPost::Rating& rating)
 | 
			
		||||
{
 | 
			
		||||
    Ratings flags;
 | 
			
		||||
    DanbooruPost::Rating flags;
 | 
			
		||||
 | 
			
		||||
    switch (rating) {
 | 
			
		||||
    case Safe:
 | 
			
		||||
        flags = Safe;
 | 
			
		||||
    case DanbooruPost::Safe:
 | 
			
		||||
        flags = DanbooruPost::Safe;
 | 
			
		||||
        break;
 | 
			
		||||
    case Questionable:
 | 
			
		||||
        flags = Safe | Questionable;
 | 
			
		||||
    case DanbooruPost::Questionable:
 | 
			
		||||
        flags = DanbooruPost::Safe | DanbooruPost::Questionable;
 | 
			
		||||
        break;
 | 
			
		||||
    case Explicit:
 | 
			
		||||
        flags = Safe | Questionable | Explicit;
 | 
			
		||||
    case DanbooruPost::Explicit:
 | 
			
		||||
        flags = DanbooruPost::Safe | DanbooruPost::Questionable | DanbooruPost::Explicit;
 | 
			
		||||
        break;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -302,10 +303,7 @@ void DanbooruService::processPostList(KJob* job)
 | 
			
		|||
 | 
			
		||||
    QByteArray data = jobResult->data();
 | 
			
		||||
 | 
			
		||||
    kDebug() << jobResult->mimetype();
 | 
			
		||||
 | 
			
		||||
    bool ok;
 | 
			
		||||
 | 
			
		||||
    bool needsXML = job->property("needsXML").toBool();
 | 
			
		||||
 | 
			
		||||
    QList<QVariant> postList;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue