Merge branch 'master' into tooomm_doxy2

This commit is contained in:
tooomm 2025-10-05 18:25:16 +02:00 committed by GitHub
commit fd42c5383d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 38 additions and 11 deletions

View file

@ -66,6 +66,10 @@ while [[ $# != 0 ]]; do
shift
fi
;;
'--vcpkg')
USE_VCPKG=1
shift
;;
'--dir')
shift
if [[ $# == 0 ]]; then
@ -116,6 +120,9 @@ fi
if [[ $PACKAGE_TYPE ]]; then
flags+=("-DCPACK_GENERATOR=$PACKAGE_TYPE")
fi
if [[ $USE_VCPKG ]]; then
flags+=("-DUSE_VCPKG=1")
fi
# Add cmake --build flags
buildflags=(--config "$BUILDTYPE")

View file

@ -329,7 +329,7 @@ jobs:
CMAKE_GENERATOR: '${{env.CMAKE_GENERATOR}}'
VCPKG_DISABLE_METRICS: 1
VCPKG_BINARY_SOURCES: 'clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite'
run: .ci/compile.sh --server --test --ccache "$CCACHE_SIZE"
run: .ci/compile.sh --server --test --ccache "$CCACHE_SIZE" --vcpkg
- name: Sign app bundle
if: matrix.make_package && (github.ref == 'refs/heads/master' || needs.configure.outputs.tag != null)

View file

@ -24,6 +24,8 @@ option(WITH_ORACLE "build oracle" ON)
option(WITH_DBCONVERTER "build dbconverter" ON)
# Compile tests
option(TEST "build tests" OFF)
# Use vcpkg regardless of OS
option(USE_VCPKG "Use vcpkg regardless of OS" OFF)
# Default to "Release" build type
# User-provided value for CMAKE_BUILD_TYPE must be checked before the PROJECT() call
@ -48,8 +50,8 @@ if(USE_CCACHE)
endif()
endif()
if(WIN32 OR APPLE)
# Use vcpkg toolchain on Windows and macOS
if(WIN32 OR USE_VCPKG)
# Use vcpkg toolchain on Windows (and on macOS in CI)
set(CMAKE_TOOLCHAIN_FILE
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake
CACHE STRING "Vcpkg toolchain file"

View file

@ -60,6 +60,7 @@ void PlayerManager::removePlayer(int playerId)
emit playerRemoved(player);
emit playerCountChanged();
players.remove(playerId);
player->deleteLater();
}
Player *PlayerManager::getPlayer(int playerId) const

View file

@ -650,14 +650,6 @@ void TabGame::notifyPlayerKicked()
msgBox.exec();
}
void TabGame::processPlayerLeave(Player *leavingPlayer)
{
QString playerName = "@" + leavingPlayer->getPlayerInfo()->getName();
removePlayerFromAutoCompleteList(playerName);
scene->removePlayer(leavingPlayer);
}
Player *TabGame::addPlayer(Player *newPlayer)
{
QString newPlayerName = "@" + newPlayer->getPlayerInfo()->getName();
@ -707,6 +699,31 @@ void TabGame::addLocalPlayer(Player *newPlayer, int playerId)
}
}
void TabGame::processPlayerLeave(Player *leavingPlayer)
{
QString playerName = "@" + leavingPlayer->getPlayerInfo()->getName();
removePlayerFromAutoCompleteList(playerName);
scene->removePlayer(leavingPlayer);
// When we inserted the playerMenu into the gameMenu earlier, Qt wrapped the playerMenu into a QAction*, which lives
// independently and does not get cleaned up when the source menu gets destroyed. We have to manually clean here.
if (leavingPlayer->getPlayerMenu()) {
QMenu *menu = leavingPlayer->getPlayerMenu()->getPlayerMenu();
if (menu) {
// Find and remove the QAction pointing to this menu
QList<QAction *> actions = gameMenu->actions();
for (QAction *act : actions) {
if (act->menu() == menu) {
gameMenu->removeAction(act);
delete act; // deletes the QAction wrapper around the submenu
break;
}
}
}
}
}
void TabGame::processRemotePlayerDeckSelect(QString deckList, int playerId, QString playerName)
{
DeckList loader;