Kgapi

filetrashjob.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 "filetrashjob.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 FileTrashJob::Private
19{
20};
21
22FileTrashJob::FileTrashJob(const QString &fileId, const AccountPtr &account, QObject *parent)
23 : FileAbstractModifyJob(fileId, account, parent)
24 , d(new Private)
25{
26}
27
28FileTrashJob::FileTrashJob(const QStringList &filesIds, const AccountPtr &account, QObject *parent)
29 : FileAbstractModifyJob(filesIds, account, parent)
30 , d(new Private)
31{
32}
33
34FileTrashJob::FileTrashJob(const FilePtr &file, const AccountPtr &account, QObject *parent)
35 : FileAbstractModifyJob(file, account, parent)
36 , d(new Private)
37{
38}
39
40FileTrashJob::FileTrashJob(const FilesList &files, const AccountPtr &account, QObject *parent)
41 : FileAbstractModifyJob(files, account, parent)
42 , d(new Private)
43{
44}
45
46FileTrashJob::~FileTrashJob()
47{
48 delete d;
49}
50
51QUrl FileTrashJob::url(const QString &fileId)
52{
53 return DriveService::trashFileUrl(fileId);
54}
55
56void FileTrashJob::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_filetrashjob.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 Sat Dec 21 2024 17:00:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.