Skip to content

Commit b6ab644

Browse files
authored
Sort filter cleanup
* implementing sorting and filter with QSortFilterProxyModel pictures should load where the scrolling position of list is at first then in some sequential order, also if filtering and sorting takes place early then we must update the pictures at scrolling position * fix crash if exiting the app before loading all covers * update at scroll position * fix some bugs * fix some commandline startup options * add libbacktrace * set codacy version * fix LevelListProxy::getItemType logic * update to QT6 * fix the signal logic
1 parent 6b4bbe5 commit b6ab644

22 files changed

+1311
-873
lines changed

.github/workflows/codacy.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,13 @@ jobs:
3434
name: Codacy Security Scan
3535
runs-on: ubuntu-latest
3636
steps:
37-
# Install dependencies required for `ueberzug`
38-
- name: Install system dependencies
39-
run: sudo apt-get update && sudo apt-get install -y libxres-dev
40-
4137
# Checkout the repository to the GitHub Actions runner
4238
- name: Checkout code
4339
uses: actions/checkout@v3
4440

45-
# Install dependencies
46-
- name: Install dependencies
47-
run: |
48-
python -m pip install --upgrade pip
49-
pip install -r requirements.txt
50-
5141
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
5242
- name: Run Codacy Analysis CLI
53-
uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b
43+
uses: codacy/codacy-analysis-cli-action@releases/v4
5444
with:
5545
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
5646
# You can also omit the token and run the tools that support default configurations

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule "libs/LIEF"]
55
path = libs/LIEF
66
url = https://github.com/lief-project/LIEF
7+
[submodule "libs/libbacktrace"]
8+
path = libs/libbacktrace
9+
url = https://github.com/ianlancetaylor/libbacktrace

CMakeLists.txt

Lines changed: 66 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,37 @@ else()
1414
set(CMAKE_BUILD_TYPE Release)
1515
endif()
1616

17-
find_package(Qt5 COMPONENTS Core Gui Test Widgets WebEngineWidgets Sql REQUIRED)
17+
find_package(Qt6 COMPONENTS Core Gui Test Widgets WebEngineWidgets Sql REQUIRED)
1818

1919
find_package(CURL REQUIRED)
2020

21+
# Add miniz as a subdirectory
2122
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/libs/miniz/CMakeLists.txt")
2223
message(STATUS "Submodule 'libs/miniz' not found. Updating submodules...")
2324
execute_process(
2425
COMMAND git submodule update --init --recursive
2526
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
2627
)
27-
file(READ "${CMAKE_SOURCE_DIR}/libs/miniz/CMakeLists.txt" cmake)
28+
file(READ "${CMAKE_SOURCE_DIR}/libs/miniz/CMakeLists.txt" MINIZ_CMAKE)
2829
string(REPLACE "cmake_minimum_required(VERSION 3.5)"
29-
"cmake_minimum_required(VERSION 3.16)" my_cmake "${cmake}")
30-
file(WRITE "${CMAKE_SOURCE_DIR}/libs/miniz/CMakeLists.txt" "${my_cmake}")
31-
endif()
32-
33-
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/database/tombll.db")
34-
message(STATUS "Database not found, running get_trle.sh...")
35-
execute_process(
36-
COMMAND bash "${CMAKE_SOURCE_DIR}/database/get_trle.sh"
37-
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
30+
"cmake_minimum_required(VERSION 3.16)"
31+
NEW_MINIZ_CMAKE
32+
"${MINIZ_CMAKE}"
33+
)
34+
file(WRITE "${CMAKE_SOURCE_DIR}/libs/miniz/CMakeLists.txt"
35+
"${NEW_MINIZ_CMAKE}"
3836
)
3937
endif()
40-
4138
add_subdirectory(libs/miniz)
4239

4340
# Add LIEF as a subdirectory
41+
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/libs/LIEF/CMakeLists.txt")
42+
message(STATUS "Submodule 'libs/LIEF' not found. Updating submodules...")
43+
execute_process(
44+
COMMAND git submodule update --init --recursive
45+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
46+
)
47+
endif()
4448
set(LIEF_INSTALL OFF CACHE BOOL "Disable installation of LIEF")
4549
set(LIEF_EXAMPLES OFF)
4650
set(LIEF_TESTS OFF)
@@ -51,29 +55,60 @@ set(LIEF_PE ON)
5155
set(LIEF_MACHO OFF)
5256
set(LIEF_DEX OFF)
5357
set(LIEF_ART OFF)
58+
add_subdirectory(libs/LIEF)
5459

55-
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/libs/LIEF/CMakeLists.txt"
56-
AND NOT NO_DATABASE
60+
# Add libbacktrace as a subdirectory
61+
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/libs/libbacktrace/configure")
62+
message(STATUS
63+
"Submodule 'libs/libbacktrace' not found. Updating submodules..."
5764
)
58-
message(STATUS "Submodule 'libs/LIEF' not found. Updating submodules...")
5965
execute_process(
6066
COMMAND git submodule update --init --recursive
6167
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
6268
)
6369
endif()
70+
if(EXISTS "${CMAKE_SOURCE_DIR}/libs/libbacktrace/configure")
71+
message(STATUS "Running autoconf to prepare libbacktrace")
72+
execute_process(
73+
COMMAND bash "${CMAKE_SOURCE_DIR}/libs/libbacktrace/configure"
74+
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/libs/libbacktrace"
75+
RESULT_VARIABLE AUTOCONF_RESULT
76+
)
77+
if(NOT AUTOCONF_RESULT EQUAL 0)
78+
message(
79+
FATAL_ERROR
80+
"Autoconf failed with exit code ${AUTOCONF_RESULT}"
81+
)
82+
endif()
83+
execute_process(
84+
COMMAND make
85+
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/libs/libbacktrace"
86+
RESULT_VARIABLE MAKE_RESULT
87+
)
88+
if(NOT MAKE_RESULT EQUAL 0)
89+
message(
90+
FATAL_ERROR
91+
"Make failed with exit code ${MAKE__RESULT}"
92+
)
93+
endif()
94+
endif()
6495

65-
add_subdirectory(libs/LIEF)
6696

67-
# Update submodules if we forget
68-
# git submodule update --init --recursive
69-
# git submodule update --remote --merge
70-
# git submodule sync # (optional) if URL change
97+
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/database/tombll.db")
98+
message(STATUS "Database not found, running get_trle.sh...")
99+
execute_process(
100+
COMMAND bash "${CMAKE_SOURCE_DIR}/database/get_trle.sh"
101+
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
102+
)
103+
endif()
71104

72105
set(SOURCES_TESTS
73106
test/test.hpp
74107
)
75108

76109
set(SOURCES_MC
110+
src/CommandLineParser.hpp
111+
src/CommandLineParser.cpp
77112
src/Controller.hpp
78113
src/Controller.cpp
79114
src/Data.hpp
@@ -82,6 +117,8 @@ set(SOURCES_MC
82117
src/FileManager.cpp
83118
src/GameFileTree.hpp
84119
src/GameFileTree.cpp
120+
src/LevelViewList.hpp
121+
src/LevelViewList.cpp
85122
src/LoadingIndicator.hpp
86123
src/LoadingIndicator.cpp
87124
src/Model.hpp
@@ -94,9 +131,9 @@ set(SOURCES_MC
94131
src/PyRunner.hpp
95132
src/Runner.cpp
96133
src/Runner.hpp
134+
src/assert.hpp
97135
src/binary.hpp
98136
src/binary.cpp
99-
src/levelViewList.hpp
100137
src/main.cpp
101138
src/staticData.hpp
102139
)
@@ -109,23 +146,25 @@ set(SOURCES_VIEW
109146
)
110147

111148
set(LINK_COMMON
112-
Qt5::Core
113-
Qt5::Widgets
114-
Qt5::WebEngineWidgets
115-
Qt5::Sql
149+
Qt6::Core
150+
Qt6::Widgets
151+
Qt6::WebEngineWidgets
152+
Qt6::Sql
116153
miniz
117154
LIEF::LIEF
118155
${CURL_LIBRARY}
156+
"${CMAKE_SOURCE_DIR}/libs/libbacktrace/.libs/libbacktrace.a"
119157
)
120158

121159
set(LINK_GUI
122-
Qt5::Gui
160+
Qt6::Gui
123161
)
124162

125163
set(INCLUDE_DIR
126164
${CURL_INCLUDE_DIR}
127165
libs/miniz
128166
libs/LIEF/include
167+
libs/libbacktrace
129168
src
130169
)
131170

@@ -137,7 +176,7 @@ if(TEST)
137176
set(SOURCES ${SOURCES_MC} ${SOURCES_TESTS})
138177
add_executable(${PROJECT_NAME}Test ${SOURCES})
139178
add_test(NAME ${PROJECT_NAME}Test COMMAND ${PROJECT_NAME}Test)
140-
target_link_libraries(${PROJECT_NAME}Test PUBLIC ${LINK_COMMON} Qt5::Test)
179+
target_link_libraries(${PROJECT_NAME}Test PUBLIC ${LINK_COMMON} Qt6::Test)
141180
target_include_directories(${PROJECT_NAME}Test PRIVATE ${INCLUDE_DIR} test)
142181
target_compile_definitions(${PROJECT_NAME}Test PRIVATE TEST)
143182
set_target_properties(${PROJECT_NAME}Test PROPERTIES

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ sudo zypper install python3-pycurl python3-tqdm python3-cryptography python3-bea
102102
```shell
103103
sudo apk add py3-pycurl py3-tqdm py3-cryptography py3-beautifulsoup4 py3-pillow
104104
```
105+
105106
Use the -sc flag to sync to trle
106107

107108
```shell
@@ -139,6 +140,7 @@ I tested the original, unpatched Tomb Raider III on an i7-4800MQ using its integ
139140
```shell
140141
WINEPREFIX="/home/noisecode3/.newtombprefix" PROTONPATH="/home/noisecode3/.steam/steam/compatibilitytools.d/GE-Proton10-10" GAMEID="225320" MESA_SHADER_CACHE="true"
141142
```
143+
142144
It ran nearly perfectly — only a tiny framedrop once per hour, or sometimes not at all. Timing jitter caused by Wine’s threading system is largely eliminated under NTSync.
143145
NTSync can help DDraw, DirectSound other I/O thread workers in wine. On Arch Linux (or other distros with a modular kernel), you’ll need to manually load the ntsync driver to enable proper synchronization support:
144146

libs/libbacktrace

Submodule libbacktrace added at 7939218

setup_nvim_lsp.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ cmake \
1515
cd ..
1616

1717
git config submodule.libs/miniz.ignore all
18+
git config submodule.libs/libbacktrace.ignore all
1819

1920
./build.sh

0 commit comments

Comments
 (0)