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 ...@@ -559,6 +559,7 @@ QString File::Thumbnail::mimeType() const
File::Private::Private(): File::Private::Private():
fileSize(-1), fileSize(-1),
version(-1),
quotaBytesUsed(-1), quotaBytesUsed(-1),
editable(false), editable(false),
writersCanShare(false), writersCanShare(false),
...@@ -585,6 +586,7 @@ File::Private::Private(const Private& other): ...@@ -585,6 +586,7 @@ File::Private::Private(const Private& other):
fileSize(other.fileSize), fileSize(other.fileSize),
alternateLink(other.alternateLink), alternateLink(other.alternateLink),
embedLink(other.embedLink), embedLink(other.embedLink),
version(other.version),
sharedWithMeDate(other.sharedWithMeDate), sharedWithMeDate(other.sharedWithMeDate),
parents(other.parents), parents(other.parents),
exportLinks(other.exportLinks), exportLinks(other.exportLinks),
...@@ -630,6 +632,7 @@ bool File::operator==(const File &other) const ...@@ -630,6 +632,7 @@ bool File::operator==(const File &other) const
GAPI_COMPARE(fileSize) GAPI_COMPARE(fileSize)
GAPI_COMPARE(alternateLink) GAPI_COMPARE(alternateLink)
GAPI_COMPARE(embedLink) GAPI_COMPARE(embedLink)
GAPI_COMPARE(version)
GAPI_COMPARE(sharedWithMeDate) GAPI_COMPARE(sharedWithMeDate)
GAPI_COMPARE_CONTAINERS(parents) GAPI_COMPARE_CONTAINERS(parents)
GAPI_COMPARE(exportLinks) GAPI_COMPARE(exportLinks)
...@@ -697,6 +700,7 @@ FilePtr File::Private::fromJSON(const QVariantMap &map) ...@@ -697,6 +700,7 @@ FilePtr File::Private::fromJSON(const QVariantMap &map)
file->d->fileSize = map[Fields::FileSize].toLongLong(); file->d->fileSize = map[Fields::FileSize].toLongLong();
file->d->alternateLink = map[Fields::AlternateLink].toUrl(); file->d->alternateLink = map[Fields::AlternateLink].toUrl();
file->d->embedLink = map[Fields::EmbedLink].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); file->d->sharedWithMeDate = QDateTime::fromString(map[Fields::SharedWithMeDate].toString(), Qt::ISODate);
const QVariantList parents = map[Fields::Parents].toList(); const QVariantList parents = map[Fields::Parents].toList();
...@@ -876,6 +880,11 @@ QUrl File::embedLink() const ...@@ -876,6 +880,11 @@ QUrl File::embedLink() const
return d->embedLink; return d->embedLink;
} }
qlonglong File::version() const
{
return d->version;
}
QDateTime File::sharedWithMeDate() const QDateTime File::sharedWithMeDate() const
{ {
return d->sharedWithMeDate; return d->sharedWithMeDate;
......
...@@ -475,6 +475,11 @@ class KGAPIDRIVE_EXPORT File: public KGAPI2::Object ...@@ -475,6 +475,11 @@ class KGAPIDRIVE_EXPORT File: public KGAPI2::Object
*/ */
QUrl embedLink() const; 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. * @brief Returns the time at which this file was shared with the user.
*/ */
......
...@@ -54,6 +54,7 @@ class Q_DECL_HIDDEN File::Private ...@@ -54,6 +54,7 @@ class Q_DECL_HIDDEN File::Private
qlonglong fileSize; qlonglong fileSize;
QUrl alternateLink; QUrl alternateLink;
QUrl embedLink; QUrl embedLink;
qlonglong version;
QDateTime sharedWithMeDate; QDateTime sharedWithMeDate;
ParentReferencesList parents; ParentReferencesList parents;
QMap<QString,QUrl> exportLinks; 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