Repository: cordova-plugin-file Updated Branches: refs/heads/master a9b6b4022 -> 23fba71ff
ubuntu: Return size with Entry.getMetadata() method Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/290ba65f Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/290ba65f Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/290ba65f Branch: refs/heads/master Commit: 290ba65f297ba59a981333a3c62194b18a9c57c7 Parents: a9b6b40 Author: Maxim Ermilov <[email protected]> Authored: Wed Apr 23 15:47:08 2014 +0400 Committer: Maxim Ermilov <[email protected]> Committed: Tue Jun 3 20:23:48 2014 +0400 ---------------------------------------------------------------------- src/ubuntu/file.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/290ba65f/src/ubuntu/file.cpp ---------------------------------------------------------------------- diff --git a/src/ubuntu/file.cpp b/src/ubuntu/file.cpp index 4c751e2..3ab6f06 100644 --- a/src/ubuntu/file.cpp +++ b/src/ubuntu/file.cpp @@ -387,8 +387,12 @@ void File::getMetadata(int scId, int ecId, const QString &path) { if (!fileInfo.exists()) this->callback(ecId, FileError::kNotFoundErr); - else - this->cb(scId, fileInfo.lastModified().toMSecsSinceEpoch()); + else { + QVariantMap obj; + obj.insert("modificationTime", fileInfo.lastModified().toMSecsSinceEpoch()); + obj.insert("size", fileInfo.isDir() ? 0 : fileInfo.size()); + this->cb(scId, obj); + } } void File::readEntries(int scId, int ecId, QString path) {
