[Pkg-owncloud-commits] [owncloud-client] 38/171: csync_vio_local_stat: Win: fetch mtime and size if not previously fetched

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Feb 17 09:36:46 UTC 2016


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to annotated tag upstream/2.1.1+dfsg
in repository owncloud-client.

commit cf5b1e401c0e0c8284bcfd8c12721a09175ed1b4
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Mon Dec 21 14:25:30 2015 +0100

    csync_vio_local_stat: Win: fetch mtime and size if not previously fetched
    
    Since owncloud 2.1, csync_vio_local_stat was optimized because readdir
    would already fetch most of the info.  This works for the discovery,
    but not later.  And we used this function later for symliks and co.
    
    So this fixes the .lnk on windows
    
    Issue #4300
---
 csync/src/vio/csync_vio_local_win.c | 11 +++++++++++
 src/libsync/filesystem.cpp          |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/csync/src/vio/csync_vio_local_win.c b/csync/src/vio/csync_vio_local_win.c
index 80e1228..7bf4033 100644
--- a/csync/src/vio/csync_vio_local_win.c
+++ b/csync/src/vio/csync_vio_local_win.c
@@ -250,6 +250,17 @@ int csync_vio_local_stat(const char *uri, csync_vio_file_stat_t *buf) {
     /* printf("Index: %I64i\n", FileIndex.QuadPart); */
     buf->inode = FileIndex.QuadPart;
 
+    if (!(buf->fields & CSYNC_VIO_FILE_STAT_FIELDS_SIZE)) {
+        buf->size = (fileInfo.nFileSizeHigh * ((int64_t)(MAXDWORD)+1)) + fileInfo.nFileSizeLow;
+        buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_SIZE;
+    }
+    if (!(buf->fields & CSYNC_VIO_FILE_STAT_FIELDS_MTIME)) {
+        DWORD rem;
+        buf->mtime = FileTimeToUnixTime(&fileInfo.ftLastWriteTime, &rem);
+        /* CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "Local File MTime: %llu", (unsigned long long) buf->mtime ); */
+        buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_MTIME;
+    }
+
     c_free_locale_string(wuri);
     CloseHandle(h);
     return 0;
diff --git a/src/libsync/filesystem.cpp b/src/libsync/filesystem.cpp
index e28cfde..5699979 100644
--- a/src/libsync/filesystem.cpp
+++ b/src/libsync/filesystem.cpp
@@ -414,7 +414,7 @@ static qint64 getSizeWithCsync(const QString& filename)
             && (stat->fields & CSYNC_VIO_FILE_STAT_FIELDS_SIZE)) {
         result = stat->size;
     } else {
-        qDebug() << "Could not get size time for" << filename << "with csync";
+        qDebug() << "Could not get size for" << filename << "with csync";
     }
     csync_vio_file_stat_destroy(stat);
     return result;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list