From 4955cc93bd10b02a86388e76795d9acaf9f8c186 Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Tue, 24 Feb 2015 00:15:57 +0100 Subject: [PATCH] Allow sending tags as well as the selected URL This required two changes: 1. in the QML view, the signal has been changed to url, var 2. the model directly outputs a QStringList for ease of use --- src/model/danboorupostmodel.cpp | 5 ++--- src/qml/danbooruimageview.qml | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/model/danboorupostmodel.cpp b/src/model/danboorupostmodel.cpp index 4d6798e..756b20a 100644 --- a/src/model/danboorupostmodel.cpp +++ b/src/model/danboorupostmodel.cpp @@ -108,9 +108,8 @@ QVariant DanbooruPostModel::data(const QModelIndex &index, int role) const return post->rating(); case TagRole: { - QVariant variant; - variant.setValue(post->tags()); - return variant; + QStringList tagList = post->tags().toList(); + return tagList; } default: return QVariant(); diff --git a/src/qml/danbooruimageview.qml b/src/qml/danbooruimageview.qml index 2fb0ad3..c0113fb 100644 --- a/src/qml/danbooruimageview.qml +++ b/src/qml/danbooruimageview.qml @@ -36,7 +36,7 @@ Rectangle { property bool poolMode: false; signal downloadFinished() - signal downloadRequested(url url) + signal downloadRequested(url url, var tags) signal downloadStarted() signal fileInfo(url name, var tags) @@ -167,7 +167,7 @@ Rectangle { z: 1 onClicked: { - rootObj.downloadRequested(fileUrl) + rootObj.downloadRequested(fileUrl, tags) } Behavior on opacity {