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
|
2016-10-25 12:00:07 +03:00
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
2015-09-07 14:50:01 +03:00
|
|
|
*
|
|
|
|
* 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"
|
|
|
|
|
|
|
|
namespace OCC {
|
|
|
|
|
2017-05-17 11:55:42 +03:00
|
|
|
ThumbnailJob::ThumbnailJob(const QString &path, AccountPtr account, QObject *parent)
|
|
|
|
: 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()
|
|
|
|
{
|
2017-03-03 13:20:53 +03:00
|
|
|
sendRequest("GET", makeAccountUrl(path()));
|
2015-09-07 14:50:01 +03:00
|
|
|
AbstractNetworkJob::start();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool ThumbnailJob::finished()
|
|
|
|
{
|
|
|
|
emit jobFinished(reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), reply()->readAll());
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|