comparison SqliteDBLink.cpp @ 86:af7962f3274b

Use quint64 for sizes, rather than qint64.
author Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no>
date Thu, 10 Oct 2013 16:07:35 +0200
parents 1f9e27a0bd7f
children 9e337bd96bd3
comparison
equal deleted inserted replaced
85:1f9e27a0bd7f 86:af7962f3274b
69 return MTIME_DIFFERENT; 69 return MTIME_DIFFERENT;
70 } 70 }
71 return NONE; 71 return NONE;
72 } 72 }
73 73
74 void SqliteDBLink::addFile(const QString& path, qint64 size, 74 void SqliteDBLink::addFile(const QString& path, quint64 size,
75 const QDateTime& dtime, const QByteArray& hash) 75 const QDateTime& dtime, const QByteArray& hash)
76 { 76 {
77 addFile(DBInfo(path, size, dtime, hash)); 77 addFile(DBInfo(path, size, dtime, hash));
78 } 78 }
79 79
93 } 93 }
94 return true; 94 return true;
95 } 95 }
96 96
97 void SqliteDBLink::updateFile(const QString& path, 97 void SqliteDBLink::updateFile(const QString& path,
98 qint64 size, const QDateTime& dtime, 98 quint64 size, const QDateTime& dtime,
99 const QByteArray& hash) 99 const QByteArray& hash)
100 { 100 {
101 updateFile(DBInfo(path, size, dtime, hash)); 101 updateFile(DBInfo(path, size, dtime, hash));
102 } 102 }
103 103
159 int sizeIndex = query.record().indexOf("size"); 159 int sizeIndex = query.record().indexOf("size");
160 int dateIndex = query.record().indexOf("mtime"); 160 int dateIndex = query.record().indexOf("mtime");
161 int checksumIndex = query.record().indexOf("checksum"); 161 int checksumIndex = query.record().indexOf("checksum");
162 while (query.next()) { 162 while (query.next()) {
163 QString path = query.value(pathIndex).toString(); 163 QString path = query.value(pathIndex).toString();
164 qint64 size = query.value(sizeIndex).toInt(); 164 quint64 size = query.value(sizeIndex).toInt();
165 QDateTime mtime = query.value(dateIndex).toDateTime(); 165 QDateTime mtime = query.value(dateIndex).toDateTime();
166 QByteArray checksum = query.value(checksumIndex).toByteArray(); 166 QByteArray checksum = query.value(checksumIndex).toByteArray();
167 167
168 values << 168 values <<
169 FileDBLink::dbinf_ptr_t(new FileDBLink::DBInfo(path, 169 FileDBLink::dbinf_ptr_t(new FileDBLink::DBInfo(path,
196 foreach(QString path, list) { 196 foreach(QString path, list) {
197 deleteFileFromDB(path); 197 deleteFileFromDB(path);
198 } 198 }
199 } 199 }
200 200
201 const QList<FileDBLink::dbinf_ptr_t> 201 const QList<FileDBLink::dbinf_ptr_t>
202 SqliteDBLink::filesWithSize(qint64 size, const QString& prefix) const 202 SqliteDBLink::filesWithSize(quint64 size, const QString& prefix) const
203 { 203 {
204 //This is incredibly inefficient and should be reimplemented 204 //This is incredibly inefficient and should be reimplemented
205 return FileDBLink::filesWithSize(size, prefix); 205 return FileDBLink::filesWithSize(size, prefix);
206 } 206 }
207