Cleanup + docs

This commit is contained in:
Luca Beltrame 2013-06-09 18:39:26 +02:00
commit c363891de3
4 changed files with 54 additions and 12 deletions

View file

@ -20,9 +20,13 @@
*
*/
// Own
#include "danboorutablemodel.h"
#include "libdanbooru/danboorupost.h"
// Qt
#include <QDebug>
#include <QPixmap>
@ -47,7 +51,7 @@ namespace Danbooru {
void DanbooruTableModel::addPost(Danbooru::DanbooruPost* post)
{
beginInsertRows(QModelIndex(), m_posts.length(), m_posts.length()+1);
beginInsertRows(QModelIndex(), m_posts.length(), m_posts.length() + 1);
m_posts.append(post);
endInsertRows();
}
@ -70,8 +74,12 @@ namespace Danbooru {
if (role == Qt::DisplayRole) {
DanbooruPost* post = m_posts.at(index.row());
return post->fileUrl().fileName();
Danbooru::DanbooruPost* post = m_posts.at(index.row());
QVariant variant;
variant.setValue(post);
return variant;
}
if (role == Qt::DecorationRole) {