diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/CMakeLists.txt | 26 | ||||
| -rw-r--r-- | src/yuzu/multiplayer/direct_connect.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/multiplayer/validation.h | 16 |
3 files changed, 30 insertions, 14 deletions
diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index 5cc1fbf32..ec9246e74 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt | |||
| @@ -292,7 +292,7 @@ if (APPLE) | |||
| 292 | set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) | 292 | set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) |
| 293 | elseif(WIN32) | 293 | elseif(WIN32) |
| 294 | # compile as a win32 gui application instead of a console application | 294 | # compile as a win32 gui application instead of a console application |
| 295 | if (QT_VERSION VERSION_GREATER 6) | 295 | if (QT_VERSION VERSION_GREATER_EQUAL 6) |
| 296 | target_link_libraries(yuzu PRIVATE Qt6::EntryPointPrivate) | 296 | target_link_libraries(yuzu PRIVATE Qt6::EntryPointPrivate) |
| 297 | else() | 297 | else() |
| 298 | target_link_libraries(yuzu PRIVATE Qt5::WinMain) | 298 | target_link_libraries(yuzu PRIVATE Qt5::WinMain) |
| @@ -308,15 +308,15 @@ endif() | |||
| 308 | create_target_directory_groups(yuzu) | 308 | create_target_directory_groups(yuzu) |
| 309 | 309 | ||
| 310 | target_link_libraries(yuzu PRIVATE common core input_common network video_core) | 310 | target_link_libraries(yuzu PRIVATE common core input_common network video_core) |
| 311 | target_link_libraries(yuzu PRIVATE Boost::boost glad Qt::Widgets Qt::Multimedia) | 311 | target_link_libraries(yuzu PRIVATE Boost::boost glad Qt${QT_MAJOR_VERSION}::Widgets) |
| 312 | target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) | 312 | target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) |
| 313 | 313 | ||
| 314 | target_include_directories(yuzu PRIVATE ../../externals/Vulkan-Headers/include) | 314 | target_include_directories(yuzu PRIVATE ../../externals/Vulkan-Headers/include) |
| 315 | if (NOT WIN32) | 315 | if (NOT WIN32) |
| 316 | target_include_directories(yuzu PRIVATE ${Qt5Gui_PRIVATE_INCLUDE_DIRS}) | 316 | target_include_directories(yuzu PRIVATE ${Qt${QT_MAJOR_VERSION}Gui_PRIVATE_INCLUDE_DIRS}) |
| 317 | endif() | 317 | endif() |
| 318 | if (UNIX AND NOT APPLE) | 318 | if (UNIX AND NOT APPLE) |
| 319 | target_link_libraries(yuzu PRIVATE Qt::DBus) | 319 | target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::DBus) |
| 320 | endif() | 320 | endif() |
| 321 | 321 | ||
| 322 | target_compile_definitions(yuzu PRIVATE | 322 | target_compile_definitions(yuzu PRIVATE |
| @@ -355,8 +355,13 @@ if (ENABLE_WEB_SERVICE) | |||
| 355 | target_compile_definitions(yuzu PRIVATE -DENABLE_WEB_SERVICE) | 355 | target_compile_definitions(yuzu PRIVATE -DENABLE_WEB_SERVICE) |
| 356 | endif() | 356 | endif() |
| 357 | 357 | ||
| 358 | if (YUZU_USE_QT_MULTIMEDIA) | ||
| 359 | target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::Multimedia) | ||
| 360 | target_compile_definitions(yuzu PRIVATE -DYUZU_USE_QT_MULTIMEDIA) | ||
| 361 | endif () | ||
| 362 | |||
| 358 | if (YUZU_USE_QT_WEB_ENGINE) | 363 | if (YUZU_USE_QT_WEB_ENGINE) |
| 359 | target_link_libraries(yuzu PRIVATE Qt::WebEngineCore Qt::WebEngineWidgets) | 364 | target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::WebEngineCore Qt${QT_MAJOR_VERSION}::WebEngineWidgets) |
| 360 | target_compile_definitions(yuzu PRIVATE -DYUZU_USE_QT_WEB_ENGINE) | 365 | target_compile_definitions(yuzu PRIVATE -DYUZU_USE_QT_WEB_ENGINE) |
| 361 | endif () | 366 | endif () |
| 362 | 367 | ||
| @@ -364,7 +369,16 @@ if(UNIX AND NOT APPLE) | |||
| 364 | install(TARGETS yuzu) | 369 | install(TARGETS yuzu) |
| 365 | endif() | 370 | endif() |
| 366 | 371 | ||
| 367 | if (YUZU_USE_BUNDLED_QT) | 372 | if (WIN32 AND QT_VERSION VERSION_GREATER_EQUAL 6) |
| 373 | if (MSVC AND NOT ${CMAKE_GENERATOR} STREQUAL "Ninja") | ||
| 374 | set(YUZU_EXE_DIR "${CMAKE_BINARY_DIR}/bin/$<CONFIG>") | ||
| 375 | else() | ||
| 376 | set(YUZU_EXE_DIR "${CMAKE_BINARY_DIR}/bin") | ||
| 377 | endif() | ||
| 378 | add_custom_command(TARGET yuzu POST_BUILD COMMAND ${WINDEPLOYQT_EXECUTABLE} "${YUZU_EXE_DIR}/yuzu.exe" --dir "${YUZU_EXE_DIR}" --libdir "${YUZU_EXE_DIR}" --plugindir "${YUZU_EXE_DIR}/plugins" --no-compiler-runtime --no-opengl-sw --no-system-d3d-compiler --no-translations --verbose 0) | ||
| 379 | endif() | ||
| 380 | |||
| 381 | if (YUZU_USE_BUNDLED_QT AND QT_VERSION VERSION_LESS 6) | ||
| 368 | include(CopyYuzuQt5Deps) | 382 | include(CopyYuzuQt5Deps) |
| 369 | copy_yuzu_Qt5_deps(yuzu) | 383 | copy_yuzu_Qt5_deps(yuzu) |
| 370 | endif() | 384 | endif() |
diff --git a/src/yuzu/multiplayer/direct_connect.cpp b/src/yuzu/multiplayer/direct_connect.cpp index 10bf0a4fb..cbd52da85 100644 --- a/src/yuzu/multiplayer/direct_connect.cpp +++ b/src/yuzu/multiplayer/direct_connect.cpp | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include <QComboBox> | 4 | #include <QComboBox> |
| 5 | #include <QFuture> | 5 | #include <QFuture> |
| 6 | #include <QIntValidator> | 6 | #include <QIntValidator> |
| 7 | #include <QRegExpValidator> | 7 | #include <QRegularExpressionValidator> |
| 8 | #include <QString> | 8 | #include <QString> |
| 9 | #include <QtConcurrent/QtConcurrentRun> | 9 | #include <QtConcurrent/QtConcurrentRun> |
| 10 | #include "common/settings.h" | 10 | #include "common/settings.h" |
diff --git a/src/yuzu/multiplayer/validation.h b/src/yuzu/multiplayer/validation.h index dabf860be..dd25af280 100644 --- a/src/yuzu/multiplayer/validation.h +++ b/src/yuzu/multiplayer/validation.h | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | #include <QRegExp> | 6 | #include <QRegularExpression> |
| 7 | #include <QString> | 7 | #include <QString> |
| 8 | #include <QValidator> | 8 | #include <QValidator> |
| 9 | 9 | ||
| @@ -29,19 +29,21 @@ public: | |||
| 29 | 29 | ||
| 30 | private: | 30 | private: |
| 31 | /// room name can be alphanumeric and " " "_" "." and "-" and must have a size of 4-20 | 31 | /// room name can be alphanumeric and " " "_" "." and "-" and must have a size of 4-20 |
| 32 | QRegExp room_name_regex = QRegExp(QStringLiteral("^[a-zA-Z0-9._- ]{4,20}$")); | 32 | QRegularExpression room_name_regex = |
| 33 | QRegExpValidator room_name; | 33 | QRegularExpression(QStringLiteral("^[a-zA-Z0-9._ -]{4,20}")); |
| 34 | QRegularExpressionValidator room_name; | ||
| 34 | 35 | ||
| 35 | /// nickname can be alphanumeric and " " "_" "." and "-" and must have a size of 4-20 | 36 | /// nickname can be alphanumeric and " " "_" "." and "-" and must have a size of 4-20 |
| 36 | QRegExp nickname_regex = QRegExp(QStringLiteral("^[a-zA-Z0-9._- ]{4,20}$")); | 37 | const QRegularExpression nickname_regex = |
| 37 | QRegExpValidator nickname; | 38 | QRegularExpression(QStringLiteral("^[a-zA-Z0-9._ -]{4,20}")); |
| 39 | QRegularExpressionValidator nickname; | ||
| 38 | 40 | ||
| 39 | /// ipv4 address only | 41 | /// ipv4 address only |
| 40 | // TODO remove this when we support hostnames in direct connect | 42 | // TODO remove this when we support hostnames in direct connect |
| 41 | QRegExp ip_regex = QRegExp(QStringLiteral( | 43 | QRegularExpression ip_regex = QRegularExpression(QStringLiteral( |
| 42 | "(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|" | 44 | "(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|" |
| 43 | "2[0-4][0-9]|25[0-5])")); | 45 | "2[0-4][0-9]|25[0-5])")); |
| 44 | QRegExpValidator ip; | 46 | QRegularExpressionValidator ip; |
| 45 | 47 | ||
| 46 | /// port must be between 0 and 65535 | 48 | /// port must be between 0 and 65535 |
| 47 | QIntValidator port; | 49 | QIntValidator port; |