From a4626f5306ed3c5e52c28bb49d61ec50c7c2f329 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Fri, 5 Apr 2013 00:19:21 +0200 Subject: add avatars to topic view --- topicmodel.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'topicmodel.cpp') diff --git a/topicmodel.cpp b/topicmodel.cpp index 653934a..65d3e4b 100644 --- a/topicmodel.cpp +++ b/topicmodel.cpp @@ -248,7 +248,7 @@ QList TopicModel::loadPosts(int start, int end) Q_ASSERT(_board); QList posts; QSqlQuery query(_board->database()); - query.prepare("SELECT post_id, post_title, post_content, post_author_id, post_author_name, post_time, last_update_time FROM posts " + query.prepare("SELECT post_id, post_title, post_content, icon_url, post_author_id, post_author_name, post_time, last_update_time FROM posts " "WHERE topic_id = :topic_id AND position BETWEEN :start AND :end " "ORDER by position ASC "); query.bindValue(":topic_id", _topicId); @@ -262,10 +262,11 @@ QList TopicModel::loadPosts(int start, int end) post.post_id = query.value(0).toInt(); post.title = query.value(1).toString(); post.content = query.value(2).toString(); - post.user_id = query.value(3).toInt(); - post.user_name = query.value(4).toString(); - post.time = parseDbDateTime(query.value(5)); - post.last_update_time = parseDbDateTime(query.value(6)); + post.icon = query.value(3).toUrl(); + post.user_id = query.value(4).toInt(); + post.user_name = query.value(5).toString(); + post.time = parseDbDateTime(query.value(6)); + post.last_update_time = parseDbDateTime(query.value(7)); posts.append(post); loaded++; } -- cgit v1.2.3