Skip to content

Commit 1391c58

Browse files
committed
fix: 修复和调整项目;
1 parent 6a97c51 commit 1391c58

46 files changed

Lines changed: 2018 additions & 1276 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/qt-build-release-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Configure CMake
3939
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
4040
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
41-
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWINGHEX_USE_FRAMELESS=ON -DBUILD_TEST_PLUGIN=OFF -DBUILD_SHARED_MEM_EXT=OFF -DANGEL_LSP=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/package
41+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWINGHEX_USE_FRAMELESS=ON -DWINGHEX_BUILD_TEST_PLUGIN=OFF -DWINGHEX_BUILD_SHARED_MEM_EXT=OFF -DWINGHEX_ANGEL_LSP=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/package
4242

4343
- name: Build
4444
# Build your program with the given configuration

.github/workflows/qt-build-release-win.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: Configure CMake
4949
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
5050
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
51-
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWINGHEX_USE_FRAMELESS=ON -DBUILD_TEST_PLUGIN=OFF -DBUILD_SHARED_MEM_EXT=OFF -DANGEL_LSP=ON
51+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWINGHEX_USE_FRAMELESS=ON -DWINGHEX_BUILD_TEST_PLUGIN=OFF -DWINGHEX_BUILD_SHARED_MEM_EXT=OFF -DWINGHEX_ANGEL_LSP=ON
5252

5353
- name: Build
5454
# Build your program with the given configuration

.github/workflows/qt-build-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
- name: Configure CMake
6060
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
6161
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
62-
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWINGHEX_USE_FRAMELESS=ON -DBUILD_TEST_PLUGIN=OFF -DBUILD_SHARED_MEM_EXT=OFF -DANGEL_LSP=ON
62+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWINGHEX_USE_FRAMELESS=ON -DWINGHEX_BUILD_TEST_PLUGIN=OFF -DWINGHEX_BUILD_SHARED_MEM_EXT=OFF -DWINGHEX_ANGEL_LSP=ON
6363

6464
- name: Build
6565
# Build your program with the given configuration

3rdparty/QConsoleWidget/QConsoleIODevice.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,15 @@ QConsoleWidget *QConsoleIODevice::widget() const { return widget_; }
6262
qint64 QConsoleIODevice::readData(char *data, qint64 len) {
6363
int b = bytesAvailable();
6464
if (b) {
65-
b = qMin((int)len, b);
65+
b = qMin(len, b);
6666
memcpy(data, readbuff_.constData() + readpos_, b);
6767
readpos_ += b;
6868
}
6969
return (qint64)b;
7070
}
7171

7272
qint64 QConsoleIODevice::writeData(const char *data, qint64 len) {
73-
QByteArray ba(data, (int)len);
74-
widget_->write(ba);
73+
widget_->write(QString::fromLatin1(data, len));
7574
writtenSinceLastEmit_ += len;
7675
if (!signalsBlocked()) {
7776
Q_EMIT bytesWritten(writtenSinceLastEmit_);

3rdparty/qtsingleapplication/src/qtlocalpeer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ QtLocalPeer::QtLocalPeer(QObject *parent, const QString &appId)
3333
#endif
3434
prefix = id.section(QLatin1Char('/'), -1);
3535
}
36-
static QRegularExpression regex("[^a-zA-Z]");
36+
static QRegularExpression regex(QStringLiteral("[^a-zA-Z]"));
3737
prefix.remove(regex);
3838
prefix.truncate(6);
3939

CMakeLists.txt

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ message("Build ${PROJECT_NAME} with ${CMAKE_BUILD_TYPE}.")
2424
install(CODE "set(CMAKE_INSTALL_LOCAL_ONLY TRUE)" ALL_COMPONENTS)
2525

2626
option(WINGHEX_USE_FRAMELESS ON)
27-
option(BUILD_TEST_PLUGIN OFF)
28-
option(BUILD_SHARED_MEM_EXT OFF)
29-
option(ANGEL_LSP ON)
30-
option(BUILD_TEST OFF)
27+
option(WINGHEX_BUILD_TEST_PLUGIN OFF)
28+
option(WINGHEX_BUILD_SHARED_MEM_EXT OFF)
29+
option(WINGHEX_ANGEL_LSP ON)
30+
option(WINGHEX_BUILD_TEST OFF)
3131

3232
add_definitions(-DAS_NO_THREADS)
3333
add_definitions(-DWING_SYSTEM_NAME="${CMAKE_SYSTEM_NAME}")
3434

35-
if(BUILD_TEST)
35+
if(WINGHEX_BUILD_TEST)
3636
add_subdirectory(test/TestStructGen)
3737
endif()
3838

@@ -51,14 +51,14 @@ else()
5151
message(FATAL_ERROR "CMAKE_CXX_BYTE_ORDER not set or empty")
5252
endif()
5353

54-
if(BUILD_TEST_PLUGIN)
54+
if(WINGHEX_BUILD_TEST_PLUGIN)
5555
add_subdirectory(TestPlugin)
5656
add_subdirectory(TestBadPlugin)
5757
add_subdirectory(TestHexExt)
5858
add_subdirectory(TestManager)
5959
endif()
6060

61-
if(BUILD_SHARED_MEM_EXT)
61+
if(WINGHEX_BUILD_SHARED_MEM_EXT)
6262
add_subdirectory(ShareMemoryDrv)
6363
endif()
6464

@@ -587,6 +587,14 @@ else()
587587
qt_add_executable(WingHexExplorer2 MANUAL_FINALIZATION ${PROJECT_SOURCES})
588588
endif()
589589

590+
if(Qt6_VERSION VERSION_GREATER_EQUAL 6.7.0)
591+
target_compile_definitions(
592+
WingHexExplorer2
593+
PRIVATE QT_NO_CONTEXTLESS_CONNECT
594+
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
595+
QT_RESTRICTED_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII)
596+
endif()
597+
590598
target_link_libraries(
591599
${CMAKE_PROJECT_NAME}
592600
PRIVATE Qt6::Widgets
@@ -686,7 +694,7 @@ target_link_options(
686694
$<$<AND:$<CONFIG:Release>,$<CXX_COMPILER_ID:GNU>>:-Wl,--gc-sections>
687695
$<$<AND:$<CONFIG:Release>,$<CXX_COMPILER_ID:Clang>>:-Wl,--gc-sections>)
688696

689-
if(ANGEL_LSP)
697+
if(WINGHEX_ANGEL_LSP)
690698
set(NODE_SUBDIR "${CMAKE_SOURCE_DIR}/3rdparty/angel-lsp/server")
691699
set(BUILD_BIN_DIR "${CMAKE_BINARY_DIR}/lsp")
692700
set(BUILD_BIN_BUILD_DIR "${CMAKE_BINARY_DIR}/lsp-build")
@@ -766,6 +774,6 @@ if(ANGEL_LSP)
766774
COMMAND ${PKG_CMD}
767775
COMMENT "Packaging with pkg"
768776
VERBATIM)
769-
add_custom_target(build_angel_lsp ALL DEPENDS ${OUT_BIN})
770-
add_dependencies(WingHexExplorer2 build_angel_lsp)
777+
add_custom_target(build_WINGHEX_ANGEL_LSP ALL DEPENDS ${OUT_BIN})
778+
add_dependencies(WingHexExplorer2 build_WINGHEX_ANGEL_LSP)
771779
endif()

ShareMemoryDrv/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
1616
# 测试模式,启用请配置主程序目录,方便调试
1717

1818
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
19-
option(TEST_MODE TRUE)
19+
option(WINGHEX_TEST_MODE TRUE)
2020

2121
# For Qt
2222
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets LinguistTools)
@@ -59,7 +59,7 @@ add_library(
5959

6060
set_target_properties(ShareMemoryDrv PROPERTIES SUFFIX ".wingdrv")
6161

62-
if(TEST_MODE)
62+
if(WINGHEX_TEST_MODE)
6363
# If you want to be able to debug easily every time you compile, please set
6464
# this variable. Because this test plugin is a subproject of the main
6565
# project, use CMAKE_BINARY_DIR

TestBadPlugin/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
1616
# 测试模式,启用请配置主程序目录,方便调试
1717

1818
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
19-
option(TEST_MODE TRUE)
19+
option(WINGHEX_TEST_MODE TRUE)
2020

2121
# For Qt
2222
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
@@ -30,7 +30,7 @@ add_library(TestBadPlugin SHARED TestBadPlugin.json
3030

3131
set_target_properties(TestBadPlugin PROPERTIES SUFFIX ".wingplg")
3232

33-
if(TEST_MODE)
33+
if(WINGHEX_TEST_MODE)
3434
# If you want to be able to debug easily every time you compile, please set
3535
# this variable. Because this test plugin is a subproject of the main
3636
# project, use CMAKE_BINARY_DIR

TestHexExt/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
1616
# 测试模式,启用请配置主程序目录,方便调试
1717

1818
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
19-
option(TEST_MODE TRUE)
19+
option(WINGHEX_TEST_MODE TRUE)
2020

2121
# For Qt
2222
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
@@ -31,7 +31,7 @@ add_library(TestHexExt SHARED TestHexExt.json testhexext.h testhexext.cpp)
3131

3232
set_target_properties(TestHexExt PROPERTIES SUFFIX ".winghexe")
3333

34-
if(TEST_MODE)
34+
if(WINGHEX_TEST_MODE)
3535
# If you want to be able to debug easily every time you compile, please set
3636
# this variable. Because this test plugin is a subproject of the main
3737
# project, use CMAKE_BINARY_DIR

TestManager/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
1616
# 测试模式,启用请配置主程序目录,方便调试
1717

1818
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
19-
option(TEST_MODE TRUE)
19+
option(WINGHEX_TEST_MODE TRUE)
2020

2121
# For Qt
2222
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
@@ -29,7 +29,7 @@ add_library(TestManager SHARED testmanager.h testmanager.cpp TestManager.json)
2929

3030
set_target_properties(TestManager PROPERTIES SUFFIX ".wingman")
3131

32-
if(TEST_MODE)
32+
if(WINGHEX_TEST_MODE)
3333
# If you want to be able to debug easily every time you compile, please set
3434
# this variable. Because this test plugin is a subproject of the main
3535
# project, use CMAKE_BINARY_DIR

0 commit comments

Comments
 (0)