[Pkg-owncloud-commits] [owncloud-client] 21/89: Maintain the file type correctly.
Sandro Knauß
hefee-guest at moszumanska.debian.org
Sat Dec 14 01:02:30 UTC 2013
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit e5afd8b901311220daf78c3f8f5e9acf17f20462
Author: Klaas Freitag <freitag at owncloud.com>
Date: Fri Dec 6 14:11:51 2013 +0100
Maintain the file type correctly.
---
src/mirall/csyncthread.cpp | 27 +++++++++++++--------------
src/mirall/syncfileitem.h | 9 +++++----
src/mirall/syncjournalfilerecord.cpp | 2 +-
3 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/src/mirall/csyncthread.cpp b/src/mirall/csyncthread.cpp
index 69d552b..3f8fb6b 100644
--- a/src/mirall/csyncthread.cpp
+++ b/src/mirall/csyncthread.cpp
@@ -288,6 +288,19 @@ int CSyncThread::treewalkFile( TREE_WALK_FILE *file, bool remote )
item._etag = file->etag;
item._size = file->size;
item._should_update_etag = file->should_update_etag;
+ switch( file->type ) {
+ case CSYNC_FTW_TYPE_DIR:
+ item._type = SyncFileItem::Directory;
+ break;
+ case CSYNC_FTW_TYPE_FILE:
+ item._type = SyncFileItem::File;
+ break;
+ case CSYNC_FTW_TYPE_SLINK:
+ item._type = SyncFileItem::SoftLink;
+ break;
+ default:
+ item._type = SyncFileItem::UnknownType;
+ }
SyncFileItem::Direction dir;
@@ -348,20 +361,6 @@ int CSyncThread::treewalkFile( TREE_WALK_FILE *file, bool remote )
break;
}
- switch( file->type ) {
- case CSYNC_FTW_TYPE_DIR:
- item._type = SyncFileItem::Directory;
- break;
- case CSYNC_FTW_TYPE_FILE:
- item._type = SyncFileItem::File;
- break;
- case CSYNC_FTW_TYPE_SLINK:
- item._type = SyncFileItem::SoftLink;
- break;
- default:
- item._type = SyncFileItem::UnknownType;
- }
-
item._dir = dir;
// check for blacklisting of this item.
// if the item is on blacklist, the instruction was set to IGNORE
diff --git a/src/mirall/syncfileitem.h b/src/mirall/syncfileitem.h
index b381c29..d063921 100644
--- a/src/mirall/syncfileitem.h
+++ b/src/mirall/syncfileitem.h
@@ -31,10 +31,10 @@ public:
Down };
enum Type {
- UnknownType,
- File = CSYNC_FTW_TYPE_FILE,
+ UnknownType = 0,
+ File = CSYNC_FTW_TYPE_FILE,
Directory = CSYNC_FTW_TYPE_DIR,
- SoftLink = CSYNC_FTW_TYPE_SLINK
+ SoftLink = CSYNC_FTW_TYPE_SLINK
};
enum Status {
@@ -49,7 +49,8 @@ public:
FileIgnored ///< The file is in the ignored list
};
- SyncFileItem() : _should_update_etag(false), _blacklistedInDb(false), _status(NoStatus), _httpErrorCode(0) {}
+ SyncFileItem() : _type(UnknownType), _should_update_etag(false), _blacklistedInDb(false),
+ _status(NoStatus), _httpErrorCode(0) {}
friend bool operator==(const SyncFileItem& item1, const SyncFileItem& item2) {
return item1._file == item2._file;
diff --git a/src/mirall/syncjournalfilerecord.cpp b/src/mirall/syncjournalfilerecord.cpp
index 6fd4ea1..7c63103 100644
--- a/src/mirall/syncjournalfilerecord.cpp
+++ b/src/mirall/syncjournalfilerecord.cpp
@@ -26,7 +26,7 @@
namespace Mirall {
SyncJournalFileRecord::SyncJournalFileRecord()
- :_uid(0), _gid(0), _mode(0)
+ :_inode(0), _type(0), _uid(0), _gid(0), _mode(0)
{
}
--
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