SyncJournalFileRecord: Remove unused mode field

This commit is contained in:
Christian Kamm 2015-11-11 09:32:13 +01:00
parent 1d9c591c08
commit 25c177ca3b
5 changed files with 10 additions and 18 deletions

View file

@ -467,7 +467,7 @@ SqlQuery* SocketApi::getSqlQuery( Folder *folder )
/* No valid sql query object yet for this folder */ /* No valid sql query object yet for this folder */
int rc; int rc;
const QString sql("SELECT inode, mode, modtime, type, md5, fileid, remotePerm FROM " const QString sql("SELECT inode, modtime, type, md5, fileid, remotePerm FROM "
"metadata WHERE phash=?1"); "metadata WHERE phash=?1");
QString dbFileName = folder->journalDb()->databaseFilePath(); QString dbFileName = folder->journalDb()->databaseFilePath();
@ -521,12 +521,11 @@ SyncJournalFileRecord SocketApi::dbFileRecord_capi( Folder *folder, QString file
if (query->next()) { if (query->next()) {
rec._path = fileName; rec._path = fileName;
rec._inode = query->int64Value(0); rec._inode = query->int64Value(0);
rec._mode = query->intValue(1); rec._modtime = Utility::qDateTimeFromTime_t( query->int64Value(1));
rec._modtime = Utility::qDateTimeFromTime_t( query->int64Value(2)); rec._type = query->intValue(2);
rec._type = query->intValue(3); rec._etag = query->baValue(3);
rec._etag = query->baValue(4); rec._fileId = query->baValue(4);
rec._fileId = query->baValue(5); rec._remotePerm = query->baValue(5);
rec._remotePerm = query->baValue(6);
} }
query->reset(); query->reset();
} }

View file

@ -685,7 +685,7 @@ bool SyncJournalDb::setFileRecord( const SyncJournalFileRecord& _record )
_setFileRecordQuery->bindValue(4, record._inode ); _setFileRecordQuery->bindValue(4, record._inode );
_setFileRecordQuery->bindValue(5, 0 ); // uid Not used _setFileRecordQuery->bindValue(5, 0 ); // uid Not used
_setFileRecordQuery->bindValue(6, 0 ); // gid Not used _setFileRecordQuery->bindValue(6, 0 ); // gid Not used
_setFileRecordQuery->bindValue(7, record._mode ); _setFileRecordQuery->bindValue(7, 0 ); // mode Not used
_setFileRecordQuery->bindValue(8, QString::number(Utility::qDateTimeToTime_t(record._modtime))); _setFileRecordQuery->bindValue(8, QString::number(Utility::qDateTimeToTime_t(record._modtime)));
_setFileRecordQuery->bindValue(9, QString::number(record._type) ); _setFileRecordQuery->bindValue(9, QString::number(record._type) );
_setFileRecordQuery->bindValue(10, etag ); _setFileRecordQuery->bindValue(10, etag );
@ -703,7 +703,6 @@ bool SyncJournalDb::setFileRecord( const SyncJournalFileRecord& _record )
} }
qDebug() << _setFileRecordQuery->lastQuery() << phash << plen << record._path << record._inode qDebug() << _setFileRecordQuery->lastQuery() << phash << plen << record._path << record._inode
<< record._mode
<< QString::number(Utility::qDateTimeToTime_t(record._modtime)) << QString::number(record._type) << QString::number(Utility::qDateTimeToTime_t(record._modtime)) << QString::number(record._type)
<< record._etag << record._fileId << record._remotePerm << record._fileSize << (record._serverHasIgnoredFiles ? 1:0) << record._etag << record._fileId << record._remotePerm << record._fileSize << (record._serverHasIgnoredFiles ? 1:0)
<< record._transmissionChecksum << record._transmissionChecksumType << checksumTypeId; << record._transmissionChecksum << record._transmissionChecksumType << checksumTypeId;
@ -778,7 +777,7 @@ SyncJournalFileRecord SyncJournalDb::getFileRecord( const QString& filename )
rec._inode = _getFileRecordQuery->intValue(1); rec._inode = _getFileRecordQuery->intValue(1);
//rec._uid = _getFileRecordQuery->value(2).toInt(&ok); Not Used //rec._uid = _getFileRecordQuery->value(2).toInt(&ok); Not Used
//rec._gid = _getFileRecordQuery->value(3).toInt(&ok); Not Used //rec._gid = _getFileRecordQuery->value(3).toInt(&ok); Not Used
rec._mode = _getFileRecordQuery->intValue(4); //rec._mode = _getFileRecordQuery->intValue(4);
rec._modtime = Utility::qDateTimeFromTime_t(_getFileRecordQuery->int64Value(5)); rec._modtime = Utility::qDateTimeFromTime_t(_getFileRecordQuery->int64Value(5));
rec._type = _getFileRecordQuery->intValue(6); rec._type = _getFileRecordQuery->intValue(6);
rec._etag = _getFileRecordQuery->baValue(7); rec._etag = _getFileRecordQuery->baValue(7);
@ -923,7 +922,6 @@ bool SyncJournalDb::setFileRecordMetadata(const SyncJournalFileRecord& record)
// Update the metadata on the existing record. // Update the metadata on the existing record.
existing._inode = record._inode; existing._inode = record._inode;
existing._mode = record._mode;
existing._modtime = record._modtime; existing._modtime = record._modtime;
existing._type = record._type; existing._type = record._type;
existing._etag = record._etag; existing._etag = record._etag;

View file

@ -28,14 +28,14 @@
namespace OCC { namespace OCC {
SyncJournalFileRecord::SyncJournalFileRecord() SyncJournalFileRecord::SyncJournalFileRecord()
:_inode(0), _type(0), _fileSize(0), _mode(0), _serverHasIgnoredFiles(false) :_inode(0), _type(0), _fileSize(0), _serverHasIgnoredFiles(false)
{ {
} }
SyncJournalFileRecord::SyncJournalFileRecord(const SyncFileItem &item, const QString &localFileName) SyncJournalFileRecord::SyncJournalFileRecord(const SyncFileItem &item, const QString &localFileName)
: _path(item._file), _modtime(Utility::qDateTimeFromTime_t(item._modtime)), : _path(item._file), _modtime(Utility::qDateTimeFromTime_t(item._modtime)),
_type(item._type), _etag(item._etag), _fileId(item._fileId), _fileSize(item._size), _type(item._type), _etag(item._etag), _fileId(item._fileId), _fileSize(item._size),
_remotePerm(item._remotePerm), _mode(0), _serverHasIgnoredFiles(item._serverHasIgnoredFiles), _remotePerm(item._remotePerm), _serverHasIgnoredFiles(item._serverHasIgnoredFiles),
_transmissionChecksum(item._transmissionChecksum), _transmissionChecksum(item._transmissionChecksum),
_transmissionChecksumType(item._transmissionChecksumType) _transmissionChecksumType(item._transmissionChecksumType)
{ {
@ -96,7 +96,6 @@ SyncFileItem SyncJournalFileRecord::toSyncFileItem()
item._fileId = _fileId; item._fileId = _fileId;
item._size = _fileSize; item._size = _fileSize;
item._remotePerm = _remotePerm; item._remotePerm = _remotePerm;
// item has no _mode
item._serverHasIgnoredFiles = _serverHasIgnoredFiles; item._serverHasIgnoredFiles = _serverHasIgnoredFiles;
item._transmissionChecksum = _transmissionChecksum; item._transmissionChecksum = _transmissionChecksum;
item._transmissionChecksumType = _transmissionChecksumType; item._transmissionChecksumType = _transmissionChecksumType;
@ -176,7 +175,6 @@ bool operator==(const SyncJournalFileRecord & lhs,
&& lhs._fileId == rhs._fileId && lhs._fileId == rhs._fileId
&& lhs._fileSize == rhs._fileSize && lhs._fileSize == rhs._fileSize
&& lhs._remotePerm == rhs._remotePerm && lhs._remotePerm == rhs._remotePerm
&& lhs._mode == rhs._mode
&& lhs._serverHasIgnoredFiles == rhs._serverHasIgnoredFiles && lhs._serverHasIgnoredFiles == rhs._serverHasIgnoredFiles
&& lhs._transmissionChecksum == rhs._transmissionChecksum && lhs._transmissionChecksum == rhs._transmissionChecksum
&& lhs._transmissionChecksumType == rhs._transmissionChecksumType; && lhs._transmissionChecksumType == rhs._transmissionChecksumType;

View file

@ -54,7 +54,6 @@ public:
QByteArray _fileId; QByteArray _fileId;
qint64 _fileSize; qint64 _fileSize;
QByteArray _remotePerm; QByteArray _remotePerm;
int _mode;
bool _serverHasIgnoredFiles; bool _serverHasIgnoredFiles;
QByteArray _transmissionChecksum; QByteArray _transmissionChecksum;
QByteArray _transmissionChecksumType; QByteArray _transmissionChecksumType;

View file

@ -58,7 +58,6 @@ private slots:
record._etag = "789789"; record._etag = "789789";
record._fileId = "abcd"; record._fileId = "abcd";
record._remotePerm = "744"; record._remotePerm = "744";
record._mode = -17;
record._fileSize = 213089055; record._fileSize = 213089055;
record._transmissionChecksum = "mychecksum"; record._transmissionChecksum = "mychecksum";
record._transmissionChecksumType = "MD5"; record._transmissionChecksumType = "MD5";
@ -81,7 +80,6 @@ private slots:
record._etag = "789FFF"; record._etag = "789FFF";
record._fileId = "efg"; record._fileId = "efg";
record._remotePerm = "777"; record._remotePerm = "777";
record._mode = 12;
record._fileSize = 289055; record._fileSize = 289055;
_db.setFileRecordMetadata(record); _db.setFileRecordMetadata(record);
storedRecord = _db.getFileRecord("foo"); storedRecord = _db.getFileRecord("foo");