Be more relaxed in the return type, some may be maps, hence return directly a QVariant.
This commit is contained in:
parent
d19030658c
commit
41136fb89b
2 changed files with 12 additions and 3 deletions
|
@ -35,10 +35,16 @@ namespace Danbooru {
|
||||||
KUrl danbooruUrl = KUrl(url);
|
KUrl danbooruUrl = KUrl(url);
|
||||||
danbooruUrl.addPath(path);
|
danbooruUrl.addPath(path);
|
||||||
|
|
||||||
|
qDebug() << "Starting step URL" << danbooruUrl.url();
|
||||||
|
qDebug() << "Tags" << tags;
|
||||||
|
|
||||||
// If we have parameters, add them
|
// If we have parameters, add them
|
||||||
|
|
||||||
if (!parameters.isEmpty()) {
|
if (!parameters.isEmpty()) {
|
||||||
|
|
||||||
|
qDebug() << "Handling parameters";
|
||||||
|
qDebug() << "Adding" << parameters;
|
||||||
|
|
||||||
QMap<QString, QString>::const_iterator iter;
|
QMap<QString, QString>::const_iterator iter;
|
||||||
|
|
||||||
for (iter = parameters.constBegin(); iter!= parameters.constEnd();
|
for (iter = parameters.constBegin(); iter!= parameters.constEnd();
|
||||||
|
@ -47,6 +53,9 @@ namespace Danbooru {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qDebug() << "First step URL" << danbooruUrl.url();
|
||||||
|
|
||||||
// Now, let's add tags should we have them
|
// Now, let's add tags should we have them
|
||||||
|
|
||||||
if (!tags.isEmpty()) {
|
if (!tags.isEmpty()) {
|
||||||
|
@ -149,7 +158,7 @@ namespace Danbooru {
|
||||||
return postData;
|
return postData;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList< QVariant > parseDanbooruResult(QByteArray data, bool* result)
|
QVariant parseDanbooruResult(QByteArray data, bool* result)
|
||||||
{
|
{
|
||||||
QJson::Parser parser;
|
QJson::Parser parser;
|
||||||
|
|
||||||
|
@ -164,7 +173,7 @@ namespace Danbooru {
|
||||||
|
|
||||||
*result = true;
|
*result = true;
|
||||||
|
|
||||||
return postData.toList();
|
return postData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@ namespace Danbooru {
|
||||||
|
|
||||||
QList<QVariant> parseDanbooruResult(QByteArray data, QString xlmElement,
|
QList<QVariant> parseDanbooruResult(QByteArray data, QString xlmElement,
|
||||||
bool* result);
|
bool* result);
|
||||||
QList<QVariant> parseDanbooruResult(QByteArray data, bool* result);
|
QVariant parseDanbooruResult(QByteArray data, bool* result);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue