Skip to content

Commit c0e1f87

Browse files
committed
fix setDownloadMd5
1 parent 54ab2ed commit c0e1f87

File tree

6 files changed

+456
-434
lines changed

6 files changed

+456
-434
lines changed

src/Data.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,9 @@ void Data::setDownloadMd5(const int id, const QString& newMd5sum) {
246246
"WHERE Zip.ZipID IN ("
247247
" SELECT ZipList.zipID"
248248
" FROM Level"
249+
" JOIN Info ON Level.infoID = Info.InfoID"
249250
" JOIN ZipList ON Level.LevelID = ZipList.levelID"
250-
" WHERE Level.LevelID = :id)");
251+
" WHERE Info.trleID = :id)");
251252

252253
if (status) {
253254
query.bindValue(":newMd5sum", newMd5sum);
@@ -263,9 +264,9 @@ void Data::setDownloadMd5(const int id, const QString& newMd5sum) {
263264
}
264265
}
265266

266-
QVector<FileList> Data::getFileList(const int id) {
267+
QVector<File> Data::getFileList(const int id) {
267268
QSqlQuery query(db);
268-
QVector<FileList> list;
269+
QVector<File> list;
269270

270271
if (!query.prepare(
271272
"SELECT File.path, File.md5sum "

src/Data.hpp

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727

2828

2929
/**
30-
* @struct FileList
30+
* @struct File
3131
* @brief Files object to keep track of files.
3232
*
3333
*/
34-
struct FileList {
34+
struct File {
3535
QString path;
3636
QString md5sum;
3737
};
@@ -333,40 +333,39 @@ class Data : public QObject {
333333
void getCoverPictures(QVector<ListItemData*>* items);
334334
/**
335335
* @brief Get the info page, this is HTML and picture data you see on trel.net
336-
* @param
336+
* @param trle.net lid
337337
* @return The InfoData is a struct of QString and QVector<QPixmap>
338338
*/
339339
InfoData getInfo(int id);
340340
/**
341341
* @brief Get the walkthrough HTML page
342-
* @param
343-
* @return
342+
* @param trle.net lid
343+
* @return HTML and Qt picture data
344344
*/
345345
QString getWalkthrough(int id);
346346
/**
347-
* @brief
348-
* @param
349-
* @return
347+
* @brief Get the type of a level
348+
* @param trle.net lid
349+
* @return Id number of type
350350
*/
351351
int getType(int id);
352352

353353
/**
354-
* @brief
355-
* @param
356-
* @return
354+
* @brief Get a filelist for the original games
355+
* @param Id number for original game
356+
* @return File vector list (path and md5sum)
357357
*/
358-
QVector<FileList> getFileList(const int id);
358+
QVector<File> getFileList(const int id);
359359
/**
360-
* @brief
361-
* @param
362-
* @return
360+
* @brief Get download info for a level
361+
* @param trle.net lid
362+
* @return zip data, url, filename, size, etc...
363363
*/
364364
ZipData getDownload(const int id);
365365
/**
366-
* @brief
367-
* @param
368-
* @param
369-
* @return
366+
* @brief Record new md5sum to database.
367+
* @param trle.net lid
368+
* @param New zip file md5sum
370369
*/
371370
void setDownloadMd5(const int id, const QString& newMd5sum);
372371

0 commit comments

Comments
 (0)