diff --git a/src/mirall/owncloudpropagator.cpp b/src/mirall/owncloudpropagator.cpp index 5cb20eb510..6b01dafd3d 100644 --- a/src/mirall/owncloudpropagator.cpp +++ b/src/mirall/owncloudpropagator.cpp @@ -297,19 +297,13 @@ void PropagateUploadFile::start() // the file id should only be empty for new files up- or downloaded QString fid = QString::fromUtf8( hbf_transfer_file_id( trans.data() )); - if( _item._fileId.isEmpty() ) { - if( fid.isEmpty() ) { - const char *plain_uri = uri.data(); - getFileId(plain_uri); - } else { - _item._fileId = fid; - } - } else { - if( _item._fileId != fid ) { + if( !fid.isEmpty() ) { + if( !_item._fileId.isEmpty() && _item._fileId != fid ) { qDebug() << "WARN: File ID changed!" << _item._fileId << fid; } else { - qDebug() << "FileID remains" << _item._fileId; + qDebug() << "FileID is" << fid; } + _item._fileId = fid; } /* Handle errors. */ @@ -409,21 +403,6 @@ void PropagateItemJob::updateMTimeAndETag(const char* uri, time_t mtime) } } -void PropagateItemJob::getFileId(const char* uri) -{ - if( ! uri ) return; - - QScopedPointer req(ne_request_create(_propagator->_session, "HEAD", uri)); - qDebug() << "Querying the fileID from " << uri; - int neon_stat = ne_request_dispatch(req.data()); - if( neon_stat != NE_OK ) { - // error happend - qDebug() << "Could not issue HEAD request for FileID."; - } else { - _item._fileId = parseFileId( req.data() ); - } -} - void PropagateItemJob::limitBandwidth(qint64 progress, qint64 bandwidth_limit) { if (bandwidth_limit > 0) { diff --git a/src/mirall/owncloudpropagator.h b/src/mirall/owncloudpropagator.h index 5d94f71437..6962817b76 100644 --- a/src/mirall/owncloudpropagator.h +++ b/src/mirall/owncloudpropagator.h @@ -114,7 +114,6 @@ protected: } void updateMTimeAndETag(const char *uri, time_t); - void getFileId( const char *uri ); /* fetch the error code and string from the session in case of error, calls done with the error and returns true.