9#include "fileabstractdatajob.h"
16using namespace KGAPI2::Drive;
18class Q_DECL_HIDDEN FileAbstractDataJob::Private
24 bool enforceSingleParent =
false;
25 QString includePermissionsForView;
29 bool supportsAllDrives =
true;
32 bool useContentAsIndexableText =
false;
35FileAbstractDataJob::Private::Private()
45FileAbstractDataJob::~FileAbstractDataJob()
50bool FileAbstractDataJob::convert()
const
55void FileAbstractDataJob::setConvert(
bool convert)
58 qCWarning(KGAPIDebug) <<
"Can't modify setConvert property when job is running";
65bool FileAbstractDataJob::enforceSingleParent()
const
67 return d->enforceSingleParent;
70void FileAbstractDataJob::setEnforceSingleParent(
bool enforceSingleParent)
73 qCWarning(KGAPIDebug) <<
"Can't modify enforceSingleParent property when job is running";
77 d->enforceSingleParent = enforceSingleParent;
80QString FileAbstractDataJob::includePermissionsForView()
const
82 return d->includePermissionsForView;
85void FileAbstractDataJob::setIncludePermissionsForView(
const QString &includePermissionsForView)
88 qCWarning(KGAPIDebug) <<
"Can't modify includePermissionsForView property when job is running";
92 d->includePermissionsForView = includePermissionsForView;
95bool FileAbstractDataJob::ocr()
const
100void FileAbstractDataJob::setOcr(
bool ocr)
103 qCWarning(KGAPIDebug) <<
"Can't modify ocr property when job is running";
110QString FileAbstractDataJob::ocrLanguage()
const
112 return d->ocrLanguage;
115void FileAbstractDataJob::setOcrLanguage(
const QString &ocrLanguage)
118 qCWarning(KGAPIDebug) <<
"Can't modify ocrLanguage property when job is running";
122 d->ocrLanguage = ocrLanguage;
125bool FileAbstractDataJob::pinned()
const
130void FileAbstractDataJob::setPinned(
bool pinned)
133 qCWarning(KGAPIDebug) <<
"Can't modify pinned property when job is running";
140bool FileAbstractDataJob::supportsAllDrives()
const
142 return d->supportsAllDrives;
145void FileAbstractDataJob::setSupportsAllDrives(
bool supportsAllDrives)
147 d->supportsAllDrives = supportsAllDrives;
150QString FileAbstractDataJob::timedTextLanguage()
const
152 return d->timedTextLanguage;
155void FileAbstractDataJob::setTimedTextLanguage(
const QString &timedTextLanguage)
158 qCWarning(KGAPIDebug) <<
"Can't modify timedTextLanguage property when job is running";
162 d->timedTextLanguage = timedTextLanguage;
165QString FileAbstractDataJob::timedTextTrackName()
const
167 return d->timedTextLanguage;
170void FileAbstractDataJob::setTimedTextTrackName(
const QString &timedTextTrackName)
173 qCWarning(KGAPIDebug) <<
"Can't modify timedTextTrackName property when job is running";
177 d->timedTextTrackName = timedTextTrackName;
180void FileAbstractDataJob::setUseContentAsIndexableText(
bool useContentAsIndexableText)
183 qCWarning(KGAPIDebug) <<
"Can't modify useContentAsIndexableText property when job is running";
187 d->useContentAsIndexableText = useContentAsIndexableText;
190bool FileAbstractDataJob::useContentAsIndexableText()
const
192 return d->useContentAsIndexableText;
195QUrl FileAbstractDataJob::updateUrl(
QUrl &url)
198 query.removeQueryItem(QStringLiteral(
"convert"));
199 query.addQueryItem(QStringLiteral(
"convert"), Utils::bool2Str(d->convert));
201 query.removeQueryItem(QStringLiteral(
"enforceSingleParent"));
202 query.removeQueryItem(QStringLiteral(
"includePermissionsForView"));
203 query.addQueryItem(QStringLiteral(
"enforceSingleParent"), Utils::bool2Str(d->enforceSingleParent));
204 if (!d->includePermissionsForView.
isEmpty()) {
205 query.addQueryItem(QStringLiteral(
"includePermissionsForView"), d->includePermissionsForView);
208 query.removeQueryItem(QStringLiteral(
"ocr"));
209 query.removeQueryItem(QStringLiteral(
"ocrLanguage"));
210 query.addQueryItem(QStringLiteral(
"ocr"), Utils::bool2Str(d->ocr));
211 if (d->ocr && !d->ocrLanguage.
isEmpty()) {
212 query.addQueryItem(QStringLiteral(
"ocrLanguage"), d->ocrLanguage);
215 query.removeQueryItem(QStringLiteral(
"pinned"));
216 query.addQueryItem(QStringLiteral(
"pinned"), Utils::bool2Str(d->pinned));
218 query.removeQueryItem(QStringLiteral(
"timedTextLanguage"));
219 if (!d->timedTextLanguage.
isEmpty()) {
220 query.addQueryItem(QStringLiteral(
"timedTextLanguage"), d->timedTextLanguage);
223 query.removeQueryItem(QStringLiteral(
"timedTextTrackName"));
224 if (!d->timedTextTrackName.
isEmpty()) {
225 query.addQueryItem(QStringLiteral(
"timedTextTrackName"), d->timedTextTrackName);
228 query.removeQueryItem(QStringLiteral(
"useContentAsIndexableText"));
229 query.addQueryItem(QStringLiteral(
"useContentAsIndexableText"), Utils::bool2Str(d->useContentAsIndexableText));
231 query.removeQueryItem(QStringLiteral(
"supportsAllDrives"));
232 query.addQueryItem(QStringLiteral(
"supportsAllDrives"), Utils::bool2Str(d->supportsAllDrives));
238#include "moc_fileabstractdatajob.cpp"
Abstract base class for all jobs in LibKGAPI.
AccountPtr account() const
Returns account used to authenticate requests.
bool isRunning
Whether the job is running.
KSERVICE_EXPORT KService::List query(FilterFunc filterFunc)
A job to fetch a single map tile described by a StaticMapUrl.
T convert(const QVariant &value)
QObject * parent() const const
bool isEmpty() const const
void setQuery(const QString &query, ParsingMode mode)