Use kdelibs coding style
This commit is contained in:
parent
0084798a2c
commit
d965371d23
31 changed files with 201 additions and 234 deletions
|
@ -17,7 +17,6 @@
|
|||
* along with Danbooru Client. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
// Own
|
||||
|
||||
#include "danboorupostmodel.h"
|
||||
|
@ -80,41 +79,38 @@ QVariant DanbooruPostModel::data(const QModelIndex &index, int role) const
|
|||
return QVariant();
|
||||
}
|
||||
|
||||
switch(role) {
|
||||
case Qt::DisplayRole:
|
||||
{
|
||||
QVariant variant;
|
||||
variant.setValue(post);
|
||||
switch (role) {
|
||||
case Qt::DisplayRole: {
|
||||
QVariant variant;
|
||||
variant.setValue(post);
|
||||
|
||||
return variant;
|
||||
}
|
||||
return variant;
|
||||
}
|
||||
|
||||
case Qt::DecorationRole:
|
||||
{
|
||||
const QPixmap pixmap = post->pixmap();
|
||||
return pixmap;
|
||||
}
|
||||
case Qt::ToolTipRole:
|
||||
return post->fileUrl().fileName();
|
||||
case FileUrlRole:
|
||||
return post->fileUrl();
|
||||
case ThumbUrlRole:
|
||||
return post->thumbnailUrl();
|
||||
case SizeRole:
|
||||
return post->size();
|
||||
case ResolutionRole:
|
||||
return QSize(post->width(), post->height());
|
||||
case RatingRole:
|
||||
return post->rating();
|
||||
case TagRole:
|
||||
{
|
||||
QStringList tagList = post->tags().toList();
|
||||
return tagList;
|
||||
}
|
||||
case SampleUrlRole:
|
||||
return post->sampleUrl();
|
||||
default:
|
||||
return QVariant();
|
||||
case Qt::DecorationRole: {
|
||||
const QPixmap pixmap = post->pixmap();
|
||||
return pixmap;
|
||||
}
|
||||
case Qt::ToolTipRole:
|
||||
return post->fileUrl().fileName();
|
||||
case FileUrlRole:
|
||||
return post->fileUrl();
|
||||
case ThumbUrlRole:
|
||||
return post->thumbnailUrl();
|
||||
case SizeRole:
|
||||
return post->size();
|
||||
case ResolutionRole:
|
||||
return QSize(post->width(), post->height());
|
||||
case RatingRole:
|
||||
return post->rating();
|
||||
case TagRole: {
|
||||
QStringList tagList = post->tags().toList();
|
||||
return tagList;
|
||||
}
|
||||
case SampleUrlRole:
|
||||
return post->sampleUrl();
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue