2015-09-07 14:50:01 +03:00
|
|
|
/*
|
|
|
|
* Copyright (C) by Roeland Jago Douma <roeland@famdouma.nl>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "thumbnailjob.h"
|
|
|
|
#include "networkjobs.h"
|
|
|
|
#include "account.h"
|
|
|
|
#include "json.h"
|
|
|
|
|
|
|
|
namespace OCC {
|
|
|
|
|
|
|
|
ThumbnailJob::ThumbnailJob(const QString &path, AccountPtr account, QObject* parent)
|
2015-10-15 23:18:22 +03:00
|
|
|
: AbstractNetworkJob(account, QLatin1String("index.php/apps/files/api/v1/thumbnail/150/150/") + path, parent)
|
2015-09-07 14:50:01 +03:00
|
|
|
{
|
|
|
|
setIgnoreCredentialFailure(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ThumbnailJob::start()
|
|
|
|
{
|
2015-10-16 13:48:48 +03:00
|
|
|
setReply(getRequest(path()));
|
2015-09-07 14:50:01 +03:00
|
|
|
setupConnections(reply());
|
|
|
|
AbstractNetworkJob::start();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool ThumbnailJob::finished()
|
|
|
|
{
|
|
|
|
emit jobFinished(reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), reply()->readAll());
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|