Skip to content

Commit f78dc9b

Browse files
committed
load in the background
1 parent a6e6c9c commit f78dc9b

22 files changed

+78
-66
lines changed

Doxyfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,13 +524,13 @@ TIMESTAMP = NO
524524
# normally produced when WARNINGS is set to YES.
525525
# The default value is: NO.
526526

527-
EXTRACT_ALL = NO
527+
EXTRACT_ALL = YES
528528

529529
# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
530530
# be included in the documentation.
531531
# The default value is: NO.
532532

533-
EXTRACT_PRIVATE = NO
533+
EXTRACT_PRIVATE = YES
534534

535535
# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual
536536
# methods of a class will be included in the documentation.
@@ -548,7 +548,7 @@ EXTRACT_PACKAGE = NO
548548
# included in the documentation.
549549
# The default value is: NO.
550550

551-
EXTRACT_STATIC = NO
551+
EXTRACT_STATIC = YES
552552

553553
# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
554554
# locally in source files will be included in the documentation. If set to NO,
@@ -2377,7 +2377,7 @@ ENABLE_PREPROCESSING = YES
23772377
# The default value is: NO.
23782378
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
23792379

2380-
MACRO_EXPANSION = NO
2380+
MACRO_EXPANSION = YES
23812381

23822382
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
23832383
# the macro expansion is limited to the macros specified with the PREDEFINED and
@@ -2418,7 +2418,12 @@ INCLUDE_FILE_PATTERNS =
24182418
# recursively expanded use the := operator instead of the = operator.
24192419
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
24202420

2421-
PREDEFINED =
2421+
PREDEFINED = Q_OBJECT= \
2422+
Q_SLOT= \
2423+
Q_SIGNAL= \
2424+
signals=signals: \
2425+
slots=slots:
2426+
24222427

24232428
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
24242429
# tag can be used to specify a list of macro names that should be expanded. The

src/Controller.cpp

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* TombRaiderLinuxLauncher
2-
* Martin Bångens Copyright (C) 2024
2+
* Martin Bångens Copyright (C) 2025
33
* This program is free software: you can redistribute it and/or modify
44
* it under the terms of the GNU General Public License as published by
55
* the Free Software Foundation, either version 3 of the License, or
@@ -30,12 +30,10 @@ void Controller::initializeThread() {
3030
controllerThread->start();
3131

3232
// Using the controller thread to start model work
33-
/*
34-
connect(this, &Controller::checkCommonFilesThreadSignal,
35-
this, [this]() {
36-
model.checkCommonFiles();
33+
connect(this, &Controller::getCoverListThreadSignal,
34+
this, [this](QVector<ListItemData*>* items) {
35+
model.getCoverList(items);
3736
});
38-
*/
3937

4038
connect(this, &Controller::setupThreadSignal,
4139
this, [this](const QString& level, const QString& game) {
@@ -72,6 +70,11 @@ void Controller::initializeThread() {
7270
this, [this](const QList<int>& availableGames) {
7371
emit controllerGenerateList(availableGames);
7472
}, Qt::QueuedConnection);
73+
74+
connect(&model, &Model::modelReloadLevelListSignal,
75+
this, [this]() {
76+
emit controllerReloadLevelList();
77+
}, Qt::QueuedConnection);
7578
}
7679

7780
void Controller::checkCommonFiles() {
@@ -82,6 +85,10 @@ void Controller::setup(const QString& level, const QString& game) {
8285
emit setupThreadSignal(level, game);
8386
}
8487

88+
void Controller::getCoverList(QVector<ListItemData*>* items) {
89+
emit getCoverListThreadSignal(items);
90+
}
91+
8592
void Controller::setupGame(int id) {
8693
emit setupGameThreadSignal(id);
8794
}
@@ -99,10 +106,6 @@ void Controller::getList(QVector<ListItemData>* list) {
99106
model.getList(list);
100107
}
101108

102-
void Controller::getCoverList(QVector<ListItemData*>* list) {
103-
model.getCoverList(list);
104-
}
105-
106109
const InfoData Controller::getInfo(int id) {
107110
return model.getInfo(id);
108111
}

src/Controller.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* TombRaiderLinuxLauncher
2-
* Martin Bångens Copyright (C) 2024
2+
* Martin Bångens Copyright (C) 2025
33
* This program is free software: you can redistribute it and/or modify
44
* it under the terms of the GNU General Public License as published by
55
* the Free Software Foundation, either version 3 of the License, or
@@ -38,7 +38,7 @@ class Controller : public QObject {
3838
void setupLevel(int id);
3939

4040
void getList(QVector<ListItemData>* list);
41-
void getCoverList(QVector<ListItemData*>* list);
41+
void getCoverList(QVector<ListItemData*>* items);
4242
const InfoData getInfo(int id);
4343
const QString getWalkthrough(int id);
4444
bool link(int id);
@@ -48,11 +48,13 @@ class Controller : public QObject {
4848
void controllerGenerateList(const QList<int>& availableGames);
4949
void controllerTickSignal();
5050
void controllerDownloadError(int status);
51+
void controllerReloadLevelList();
5152

5253
void checkCommonFilesThreadSignal();
5354
void setupThreadSignal(const QString& level, const QString& game);
5455
void setupGameThreadSignal(int id);
5556
void setupLevelThreadSignal(int id);
57+
void getCoverListThreadSignal(QVector<ListItemData*>* items);
5658

5759
private:
5860
Controller();

src/Data.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,11 @@ void Data::getCoverPictures(QVector<ListItemData*>* items) {
9898
}
9999

100100
if (status) {
101-
qint64 size = items->size();
102-
for (qint64 i = size-100; i < size; i++) {
103-
ListItemData* level = (*items)[i];
104-
query.bindValue(":id", level->m_trle_id);
101+
for (ListItemData* item : *items) {
102+
query.bindValue(":id", item->m_trle_id);
105103
if (query.exec()) {
106104
if (query.next() == true) {
107-
level->addPicture(
105+
item->addPicture(
108106
query.value("Picture.data").toByteArray());
109107
}
110108
} else {

src/Data.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* TombRaiderLinuxLauncher
2-
* Martin Bångens Copyright (C) 2024
2+
* Martin Bångens Copyright (C) 2025
33
* This program is free software: you can redistribute it and/or modify
44
* it under the terms of the GNU General Public License as published by
55
* the Free Software Foundation, either version 3 of the License, or

src/FileManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* TombRaiderLinuxLauncher
2-
* Martin Bångens Copyright (C) 2024
2+
* Martin Bångens Copyright (C) 2025
33
* This program is free software: you can redistribute it and/or modify
44
* it under the terms of the GNU General Public License as published by
55
* the Free Software Foundation, either version 3 of the License, or

src/FileManager.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* TombRaiderLinuxLauncher
2-
* Martin Bångens Copyright (C) 2024
2+
* Martin Bångens Copyright (C) 2025
33
* This program is free software: you can redistribute it and/or modify
44
* it under the terms of the GNU General Public License as published by
55
* the Free Software Foundation, either version 3 of the License, or

src/GameFileTree.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* TombRaiderLinuxLauncher
2-
* Martin Bångens Copyright (C) 2024
2+
* Martin Bångens Copyright (C) 2025
33
* This program is free software: you can redistribute it and/or modify
44
* it under the terms of the GNU General Public License as published by
55
* the Free Software Foundation, either version 3 of the License, or
@@ -24,7 +24,7 @@
2424
* and maybe other files. We compare/match and verify game files here.
2525
*/
2626

27-
#include "GameFileTree.hpp"
27+
#include "../src/GameFileTree.hpp"
2828
#include <QDir>
2929
#include <QFileInfo>
3030
#include <QQueue>

src/GameFileTree.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* TombRaiderLinuxLauncher
2-
* Martin Bångens Copyright (C) 2024
2+
* Martin Bångens Copyright (C) 2025
33
* This program is free software: you can redistribute it and/or modify
44
* it under the terms of the GNU General Public License as published by
55
* the Free Software Foundation, either version 3 of the License, or

src/Model.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* TombRaiderLinuxLauncher
2-
* Martin Bångens Copyright (C) 2024
2+
* Martin Bångens Copyright (C) 2025
33
* This program is free software: you can redistribute it and/or modify
44
* it under the terms of the GNU General Public License as published by
55
* the Free Software Foundation, either version 3 of the License, or
@@ -103,8 +103,9 @@ void Model::getList(QVector<ListItemData>* list) {
103103
*list = data.getListItems();
104104
}
105105

106-
void Model::getCoverList(QVector<ListItemData*>* list) {
107-
data.getCoverPictures(list);
106+
void Model::getCoverList(QVector<ListItemData*>* items) {
107+
data.getCoverPictures(items);
108+
emit modelReloadLevelListSignal();
108109
}
109110

110111
int Model::getItemState(int id) {

0 commit comments

Comments
 (0)