Kgapi

fileuntrashjob.cpp
1/*
2 * This file is part of LibKGAPI library
3 *
4 * SPDX-FileCopyrightText: 2013 Daniel Vrátil <dvratil@redhat.com>
5 *
6 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8
9#include "fileuntrashjob.h"
10#include "driveservice.h"
11
12#include <QNetworkAccessManager>
13#include <QNetworkRequest>
14
15using namespace KGAPI2;
16using namespace KGAPI2::Drive;
17
18class Q_DECL_HIDDEN FileUntrashJob::Private
19{
20};
21
22FileUntrashJob::FileUntrashJob(const QString &fileId, const AccountPtr &account, QObject *parent)
23 : FileAbstractModifyJob(fileId, account, parent)
24 , d(new Private)
25{
26}
27
28FileUntrashJob::FileUntrashJob(const QStringList &filesIds, const AccountPtr &account, QObject *parent)
29 : FileAbstractModifyJob(filesIds, account, parent)
30 , d(new Private)
31{
32}
33
34FileUntrashJob::FileUntrashJob(const FilePtr &file, const AccountPtr &account, QObject *parent)
35 : FileAbstractModifyJob(file, account, parent)
36 , d(new Private)
37{
38}
39
40FileUntrashJob::FileUntrashJob(const FilesList &files, const AccountPtr &account, QObject *parent)
41 : FileAbstractModifyJob(files, account, parent)
42 , d(new Private)
43{
44}
45
46FileUntrashJob::~FileUntrashJob()
47{
48 delete d;
49}
50
51QUrl FileUntrashJob::url(const QString &fileId)
52{
53 return DriveService::untrashFileUrl(fileId);
54}
55
56void FileUntrashJob::dispatchRequest(QNetworkAccessManager *accessManager, const QNetworkRequest &request, const QByteArray &data, const QString &contentType)
57{
58 QNetworkRequest r(request);
59 r.setHeader(QNetworkRequest::ContentTypeHeader, contentType);
60 r.setHeader(QNetworkRequest::ContentLengthHeader, data.size());
61 accessManager->post(r, data);
62}
63
64#include "moc_fileuntrashjob.cpp"
A job to fetch a single map tile described by a StaticMapUrl.
Definition blog.h:16
qsizetype size() const const
QNetworkReply * post(const QNetworkRequest &request, QHttpMultiPart *multiPart)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:08:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.