Prefer the use of _isDirectory over item._type == SyncFileItem::Directory

This commit is contained in:
Olivier Goffart 2014-03-20 14:58:56 +01:00
parent c5f8a2555d
commit 756e1c4a12
2 changed files with 3 additions and 5 deletions

View file

@ -314,12 +314,10 @@ void Folder::bubbleUpSyncResult()
} else {
// add new directories or remove gone away dirs to the watcher
if (item._type == SyncFileItem::Directory &&
item._instruction == CSYNC_INSTRUCTION_NEW ) {
if (item._isDirectory && item._instruction == CSYNC_INSTRUCTION_NEW ) {
FolderMan::instance()->addMonitorPath( alias(), path()+item._file );
}
if (item._type == SyncFileItem::Directory &&
item._instruction == CSYNC_INSTRUCTION_REMOVE ) {
if (item._isDirectory && item._instruction == CSYNC_INSTRUCTION_REMOVE ) {
FolderMan::instance()->removeMonitorPath( alias(), path()+item._file );
}

View file

@ -79,7 +79,7 @@ bool PropagateItemJob::checkForProblemsWithShared(int httpStatusCode, const QStr
PropagateItemJob *newJob = NULL;
if( httpStatusCode == 403 && _propagator->isInSharedDirectory(_item._file )) {
if( _item._type != SyncFileItem::Directory ) {
if( !_item._isDirectory ) {
SyncFileItem downloadItem(_item);
if (downloadItem._instruction == CSYNC_INSTRUCTION_NEW) {
// don't try to recover pushing new files