Commit 3362e298 authored by David Barchiesi's avatar David Barchiesi
Browse files

Expose GDrive File version attribute.

parent fbe8ef0e
Pipeline #21916 passed with stage
in 16 minutes and 18 seconds
......@@ -559,6 +559,7 @@ QString File::Thumbnail::mimeType() const
File::Private::Private():
fileSize(-1),
version(-1),
quotaBytesUsed(-1),
editable(false),
writersCanShare(false),
......@@ -585,6 +586,7 @@ File::Private::Private(const Private& other):
fileSize(other.fileSize),
alternateLink(other.alternateLink),
embedLink(other.embedLink),
version(other.version),
sharedWithMeDate(other.sharedWithMeDate),
parents(other.parents),
exportLinks(other.exportLinks),
......@@ -630,6 +632,7 @@ bool File::operator==(const File &other) const
GAPI_COMPARE(fileSize)
GAPI_COMPARE(alternateLink)
GAPI_COMPARE(embedLink)
GAPI_COMPARE(version)
GAPI_COMPARE(sharedWithMeDate)
GAPI_COMPARE_CONTAINERS(parents)
GAPI_COMPARE(exportLinks)
......@@ -697,6 +700,7 @@ FilePtr File::Private::fromJSON(const QVariantMap &map)
file->d->fileSize = map[Fields::FileSize].toLongLong();
file->d->alternateLink = map[Fields::AlternateLink].toUrl();
file->d->embedLink = map[Fields::EmbedLink].toUrl();
file->d->version = map[Fields::Version].toLongLong();
file->d->sharedWithMeDate = QDateTime::fromString(map[Fields::SharedWithMeDate].toString(), Qt::ISODate);
const QVariantList parents = map[Fields::Parents].toList();
......@@ -876,6 +880,11 @@ QUrl File::embedLink() const
return d->embedLink;
}
qlonglong File::version() const
{
return d->version;
}
QDateTime File::sharedWithMeDate() const
{
return d->sharedWithMeDate;
......
......@@ -475,6 +475,11 @@ class KGAPIDRIVE_EXPORT File: public KGAPI2::Object
*/
QUrl embedLink() const;
/**
* @brief Returns the version of the file;
*/
qlonglong version() const;
/**
* @brief Returns the time at which this file was shared with the user.
*/
......
......@@ -54,6 +54,7 @@ class Q_DECL_HIDDEN File::Private
qlonglong fileSize;
QUrl alternateLink;
QUrl embedLink;
qlonglong version;
QDateTime sharedWithMeDate;
ParentReferencesList parents;
QMap<QString,QUrl> exportLinks;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment