From 77aa253222387be817c2c5a74b4afb9dcb15ba50 Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Wed, 14 Dec 2022 09:29:09 +0800 Subject: [PATCH 01/11] action:change log --- .github/workflows/macos-homebrew.yml | 33 +++++++++------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/.github/workflows/macos-homebrew.yml b/.github/workflows/macos-homebrew.yml index 89014914..2dac2244 100644 --- a/.github/workflows/macos-homebrew.yml +++ b/.github/workflows/macos-homebrew.yml @@ -51,7 +51,7 @@ jobs: - uses: actions/checkout@v3 with: - fetch-depth: 1 + fetch-depth: 0 - name: Set outputs id: githash run: | @@ -296,12 +296,14 @@ jobs: mv ${targetName}.app ./tmp # --background "installer_background.png" create-dmg --volname "${targetName} Installer" --volicon "icons/macicon.icns" --window-pos 200 120 --window-size 800 400 --icon-size 100 --icon "${targetName}.app" 200 190 --hide-extension "${targetName}.app" --app-drop-link 600 185 --skip-jenkins "${targetName}.dmg" tmp/ - - name: Generate changelog - if: ${{!env.prerelease}} - id: changelog1 - uses: metcalfc/changelog-generator@v3.0.0 + - name: Release Changelog Builder + id: changelog + uses: mikepenz/release-changelog-builder-action@v3.5.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - myToken: ${{ secrets.GITHUB_TOKEN }} + # ignorePreReleases: true + commitMode: true - name: Set outputs id: vars @@ -311,21 +313,7 @@ jobs: echo "::set-output name=release_time::$(date +'%H%M%S')" echo "::set-output name=release_time_clock::$(date +'%H:%M:%S')" echo "::set-output name=release_hm::$(date +'%y%m%d')" - - - name: changelog - if: $${{env.prerelease}} - id: changelog2 - run: | - previousTag=$(git tag --sort=-creatordate | sed -n 2p) - echo "previousTag : $previousTag" - - CHANGELOG="$(git log --oneline --no-decorate $previousTag..HEAD)" - CHANGELOG="${CHANGELOG//'%'/'%25'}" - CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" - CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" - CHANGELOG="${CHANGELOG//'\"'/'%22'}" - CHANGELOG="${CHANGELOG//"'"/ }" - echo "::set-output name=COMMIT_SUMMARY::$(echo "$CHANGELOG")" + # tag 上传Release - name: uploadRelease uses: svenstaro/upload-release-action@v2 @@ -355,5 +343,4 @@ jobs: Filename pattern: **[Qt version]-GoldenDict-[OS]-[release-date].[ext]** CHANGES: - ${{ steps.changelog1.outputs.changelog }} - ${{ steps.changelog2.outputs.COMMIT_SUMMARY }} + ${{ steps.changelog.outputs.changelog }} From c0d15ee30e85eed88f739ac8b4332af001b48c4e Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Wed, 14 Dec 2022 09:51:03 +0800 Subject: [PATCH 02/11] macos specific: change github action --- .github/workflows/macos-homebrew.yml | 192 +-------------------------- 1 file changed, 3 insertions(+), 189 deletions(-) diff --git a/.github/workflows/macos-homebrew.yml b/.github/workflows/macos-homebrew.yml index 2dac2244..22c38fc5 100644 --- a/.github/workflows/macos-homebrew.yml +++ b/.github/workflows/macos-homebrew.yml @@ -69,196 +69,10 @@ jobs: brew install wavpack brew install automake fdk-aac git lame libass libtool libvorbis libvpx opus sdl shtool texi2html theora wget x264 x265 xvid nasm brew install speex - git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg - cd ffmpeg - ./configure --prefix=/usr/local \ - --enable-shared \ - --disable-static \ - --disable-debug \ - --disable-programs \ - --disable-network \ - --disable-avdevice \ - --disable-avfilter \ - --disable-swscale \ - --disable-network \ - --disable-muxers \ - --disable-demuxers \ - --enable-rdft \ - --enable-demuxer=aac \ - --enable-demuxer=ac3 \ - --enable-demuxer=aiff \ - --enable-demuxer=ape \ - --enable-demuxer=asf \ - --enable-demuxer=flac \ - --enable-demuxer=matroska \ - --enable-demuxer=mp3 \ - --enable-demuxer=mpc \ - --enable-demuxer=mov \ - --enable-demuxer=mpc8 \ - --enable-demuxer=ogg \ - --enable-demuxer=tta \ - --enable-demuxer=wav \ - --enable-demuxer=wv \ - --disable-bsfs \ - --disable-filters \ - --disable-parsers \ - --enable-parser=aac \ - --enable-parser=ac3 \ - --enable-parser=mpegaudio \ - --disable-protocols \ - --disable-indevs \ - --disable-outdevs \ - --disable-encoders \ - --disable-decoders \ - --enable-decoder=eightsvx_exp \ - --enable-decoder=eightsvx_fib \ - --enable-decoder=aac \ - --enable-decoder=aac_latm \ - --enable-decoder=ac3 \ - --enable-decoder=adpcm_4xm \ - --enable-decoder=adpcm_adx \ - --enable-decoder=adpcm_afc \ - --enable-decoder=adpcm_ct \ - --enable-decoder=adpcm_ea \ - --enable-decoder=adpcm_ea_maxis_xa \ - --enable-decoder=adpcm_ea_r1 \ - --enable-decoder=adpcm_ea_r2 \ - --enable-decoder=adpcm_ea_r3 \ - --enable-decoder=adpcm_ea_xas \ - --enable-decoder=adpcm_g722 \ - --enable-decoder=adpcm_g726 \ - --enable-decoder=adpcm_ima_amv \ - --enable-decoder=adpcm_ima_apc \ - --enable-decoder=adpcm_ima_dk3 \ - --enable-decoder=adpcm_ima_dk4 \ - --enable-decoder=adpcm_ima_ea_eacs \ - --enable-decoder=adpcm_ima_ea_sead \ - --enable-decoder=adpcm_ima_iss \ - --enable-decoder=adpcm_ima_oki \ - --enable-decoder=adpcm_ima_qt \ - --enable-decoder=adpcm_ima_smjpeg \ - --enable-decoder=adpcm_ima_wav \ - --enable-decoder=adpcm_ima_ws \ - --enable-decoder=adpcm_ms \ - --enable-decoder=adpcm_sbpro_2 \ - --enable-decoder=adpcm_sbpro_3 \ - --enable-decoder=adpcm_sbpro_4 \ - --enable-decoder=adpcm_swf \ - --enable-decoder=adpcm_thp \ - --enable-decoder=adpcm_xa \ - --enable-decoder=adpcm_yamaha \ - --enable-decoder=alac \ - --enable-decoder=amrnb \ - --enable-decoder=libopencore_amrnb \ - --enable-decoder=amrwb \ - --enable-decoder=libopencore_amrwb \ - --enable-decoder=ape \ - --enable-decoder=atrac1 \ - --enable-decoder=atrac3 \ - --enable-decoder=binkaudio_dct \ - --enable-decoder=binkaudio_rdft \ - --enable-decoder=bmv_audio \ - --enable-decoder=comfortnoise \ - --enable-decoder=cook \ - --enable-decoder=dsicinaudio \ - --enable-decoder=dca \ - --enable-decoder=eac3 \ - --enable-decoder=flac \ - --enable-decoder=g723_1 \ - --enable-decoder=g729 \ - --enable-decoder=gsm \ - --enable-decoder=libgsm \ - --enable-decoder=gsm_ms \ - --enable-decoder=libgsm_ms \ - --enable-decoder=iac \ - --enable-decoder=imc \ - --enable-decoder=interplay_dpcm \ - --enable-decoder=mace3 \ - --enable-decoder=mace6 \ - --enable-decoder=mlp \ - --enable-decoder=mp1 \ - --enable-decoder=mp1float \ - --enable-decoder=mp2 \ - --enable-decoder=mp2float \ - --enable-decoder=mp3 \ - --enable-decoder=mp3float \ - --enable-decoder=mp3adu \ - --enable-decoder=mp3adufloat \ - --enable-decoder=mp3on4 \ - --enable-decoder=mp3on4float \ - --enable-decoder=als \ - --enable-decoder=mpc7 \ - --enable-decoder=mpc8 \ - --enable-decoder=mp3*,pcm* \ - --enable-decoder=nellymoser \ - --enable-decoder=libopus \ - --enable-decoder=paf_audio \ - --enable-decoder=pcm_alaw \ - --enable-decoder=pcm_bluray \ - --enable-decoder=pcm_dvd \ - --enable-decoder=pcm_f32be \ - --enable-decoder=pcm_f32le \ - --enable-decoder=pcm_f64be \ - --enable-decoder=pcm_f64le \ - --enable-decoder=pcm_lxf \ - --enable-decoder=pcm_mulaw \ - --enable-decoder=pcm_s16be \ - --enable-decoder=pcm_s16be_planar \ - --enable-decoder=pcm_s16le \ - --enable-decoder=pcm_s16le_planar \ - --enable-decoder=pcm_s24be \ - --enable-decoder=pcm_s24daud \ - --enable-decoder=pcm_s24le \ - --enable-decoder=pcm_s24le_planar \ - --enable-decoder=pcm_s32be \ - --enable-decoder=pcm_s32le \ - --enable-decoder=pcm_s32le_planar \ - --enable-decoder=pcm_s8 \ - --enable-decoder=pcm_s8_planar \ - --enable-decoder=pcm_u16be \ - --enable-decoder=pcm_u16le \ - --enable-decoder=pcm_u24be \ - --enable-decoder=pcm_u24le \ - --enable-decoder=pcm_u32be \ - --enable-decoder=pcm_u32le \ - --enable-decoder=pcm_u8 \ - --enable-decoder=pcm_zork \ - --enable-decoder=qcelp \ - --enable-decoder=qdm2 \ - --enable-decoder=ra_144 \ - --enable-decoder=ra_288 \ - --enable-decoder=ralf \ - --enable-decoder=roq_dpcm \ - --enable-decoder=s302m \ - --enable-decoder=shorten \ - --enable-decoder=sipr \ - --enable-decoder=smackaud \ - --enable-decoder=sol_dpcm \ - --enable-decoder=sonic \ - --enable-decoder=libspeex \ - --enable-decoder=tak \ - --enable-decoder=truehd \ - --enable-decoder=truespeech \ - --enable-decoder=tta \ - --enable-decoder=twinvq \ - --enable-decoder=vima \ - --enable-decoder=vmdaudio \ - --enable-decoder=vorbis \ - --enable-decoder=ffwavesynth \ - --enable-decoder=wavpack \ - --enable-decoder=ws_snd1 \ - --enable-decoder=wmalossless \ - --enable-decoder=wmapro \ - --enable-decoder=wmav1 \ - --enable-decoder=wmav2 \ - --enable-decoder=wmavoice \ - --enable-decoder=xan_dpcm \ - --enable-libmp3lame \ - --enable-libspeex + + brew tap homebrew-ffmpeg/ffmpeg + brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-speex - make - sudo make install - cd .. brew install libiconv brew install lzo bzip2 brew install libogg From afb5c4f95197bf3d483c3dbe587ef000d60301bf Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Wed, 14 Dec 2022 10:02:20 +0800 Subject: [PATCH 03/11] action: generate version.txt give github action the opportunity to generate this file . If not existed , qmake will generate one --- .github/workflows/windows-6.x-xapian.yml | 2 -- goldendict.pro | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows-6.x-xapian.yml b/.github/workflows/windows-6.x-xapian.yml index 73ee62d7..cfd839a5 100644 --- a/.github/workflows/windows-6.x-xapian.yml +++ b/.github/workflows/windows-6.x-xapian.yml @@ -75,8 +75,6 @@ jobs: previousTag=$(git tag --sort=-creatordate | sed -n 1p |cut -c 2-) echo "$previousTag">version.txt cat version.txt - pwd - ls # # msvc编译 - uses: ilammy/msvc-dev-cmd@v1 diff --git a/goldendict.pro b/goldendict.pro index a7018b4f..cdf3ba9a 100644 --- a/goldendict.pro +++ b/goldendict.pro @@ -13,7 +13,11 @@ system(git describe --tags --always --dirty): hasGit=1 GIT_HASH=$$system(git rev-parse --short=8 HEAD ) } -system(echo $${VERSION}.$${GIT_HASH} on $${_DATE_} > version.txt) +!exists( version.txt ) { + message( "generate version.txt...." ) + system(echo $${VERSION}.$${GIT_HASH} on $${_DATE_} > version.txt) +} + !CONFIG( verbose_build_output ) { !win32|*-msvc* { From 1744843956e5bb635dd1d063661c5339211abd97 Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Tue, 6 Dec 2022 09:45:58 +0800 Subject: [PATCH 04/11] sonar:fix linux build --- .github/workflows/cmake build test.yml | 110 +++++++++++++++++++++++++ .gitmodules | 4 +- CMakeLists.txt | 28 +++++-- eb | 1 - thirdparty/eb | 1 + 5 files changed, 133 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/cmake build test.yml delete mode 160000 eb create mode 160000 thirdparty/eb diff --git a/.github/workflows/cmake build test.yml b/.github/workflows/cmake build test.yml new file mode 100644 index 00000000..b7965cb4 --- /dev/null +++ b/.github/workflows/cmake build test.yml @@ -0,0 +1,110 @@ +name: CMake Test +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +on: + workflow_dispatch: + # push: + # branches: + # - dev + # pull_request: + # types: [opened, synchronize, reopened] +jobs: + job1: + name: Build and analyze + runs-on: ubuntu-latest + steps: + - uses: actions/setup-python@v3 + with: + python-version: '3.9' + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + version: 6.3.2 + arch: gcc_64 + cached: 'false' + #serialport linuxdeploy need serialport to work. + modules: qtwebengine qtwebchannel qtpositioning qt5compat qtmultimedia qtimageformats qtserialport + setup-python: 'false' + + - name: ubuntu install thirdparty dependencies + run: | + sudo apt-get install git pkg-config build-essential + sudo apt-get install libvorbis-dev zlib1g-dev libhunspell-dev x11proto-record-dev + sudo apt-get install libxtst-dev liblzo2-dev libbz2-dev + sudo apt-get install libao-dev libavutil-dev libavformat-dev libtiff5-dev libeb16-dev + sudo apt-get install doxygen libzstd-dev libxkbcommon-dev libgstreamer-plugins-base1.0-0 libgstreamer-gl1.0-0 + sudo ln -sf /usr/bin/x86_64-linux-gnu-ld.gold /usr/bin/ld + + #build opencc + git clone https://github.com/BYVoid/OpenCC + cd OpenCC/ + make PREFIX=/usr -j$(nproc) + sudo make install + cd .. + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + submodules: true + + - name: Run build-wrapper + run: | + cmake . + cmake --build . + + job2: + name: Build and analyze + runs-on: windows-2019 + steps: + - uses: actions/setup-python@v3 + with: + python-version: '3.9' + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + version: 6.3.2 + arch: gcc_64 + cached: 'false' + #serialport linuxdeploy need serialport to work. + modules: qtwebengine qtwebchannel qtpositioning qt5compat qtmultimedia qtimageformats qtserialport + setup-python: 'false' + - uses: ilammy/msvc-dev-cmd@v1 + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + submodules: true + + - name: Run build-wrapper + run: | + cmake . + cmake --build . + job3: + name: Build and analyze + runs-on: macos-12 + steps: + - uses: actions/setup-python@v3 + with: + python-version: '3.9' + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + version: 6.3.2 + arch: gcc_64 + cached: 'false' + #serialport linuxdeploy need serialport to work. + modules: qtwebengine qtwebchannel qtpositioning qt5compat qtmultimedia qtimageformats qtserialport + setup-python: 'false' + - uses: ilammy/msvc-dev-cmd@v1 + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + submodules: true + - name: install dependencies + run: | + brew uninstall opencc hunspell ffmpeg@5 ffmpeg@4 libtiff xz lzo libogg libvorbis zstd || true + brew install create-dmg + - name: Run build-wrapper + run: | + cmake . + cmake --build . + \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index a1ff2db7..842f8e43 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "eb"] - path = eb - url = git@github.com:xiaoyifang/simple-eb.git + path = thirdparty/eb + url = https://github.com/xiaoyifang/simple-eb.git diff --git a/CMakeLists.txt b/CMakeLists.txt index b2cee462..bf136187 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,14 +5,14 @@ cmake_minimum_required(VERSION 3.23) # LINUX, APPLE and MSVC are used to detect system option(WITH_FFMPEG_PLAYER "Enable support for FFMPEG player" ON) - +option(WITH_EPWING_SUPPORT "Enable epwing support" ON) # Remove this once cmake 5.25 becomes minimum version if(UNIX AND NOT APPLE) set(LINUX TRUE) endif() if (APPLE) - add_subdirectory(eb) + add_subdirectory(thirdparty/eb) endif () project(goldendict @@ -76,9 +76,12 @@ if(LINUX) find_package(X11 REQUIRED) pkg_check_modules (LIBXTST IMPORTED_TARGET xtst) - add_library(libeb SHARED IMPORTED) - set_target_properties(libeb PROPERTIES IMPORTED_LOCATION /usr/lib/libeb.so) - set_target_properties(libeb PROPERTIES INCLUDE_DIRECTORIES /usr/include/) + if(WITH_EPWING_SUPPORT) + add_subdirectory(thirdparty/eb EXCLUDE_FROM_ALL) + endif() + # add_library(libeb SHARED IMPORTED) + # set_target_properties(libeb PROPERTIES IMPORTED_LOCATION /usr/lib/libeb.so) + # set_target_properties(libeb PROPERTIES INCLUDE_DIRECTORIES /usr/include/) endif() #### Compile time files and preprocessor flags @@ -144,7 +147,7 @@ set(UI_SRC scanpopup.ui sources.ui ) - +if(WITH_EPWING_SUPPORT) set(EPWING_SUPPORT_SRC epwing.cc epwing.hh @@ -153,6 +156,9 @@ set(EPWING_SUPPORT_SRC epwing_charmap.cc epwing_charmap.hh ) +else() + add_compile_definitions(NO_EPWING_SUPPORT) +endif() if (APPLE) set(MAC_SRC @@ -489,10 +495,12 @@ if(APPLE) endif() if(UNIX) + target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE + ${PROJECT_SOURCE_DIR}/thirdparty) + target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE # pkg-config packages need manually link PkgConfig::PKGCONFIG_DEPS - BZip2::BZip2 ZLIB::ZLIB #hidden requirement of dsl_details.cc and more? ) @@ -507,7 +515,11 @@ endif() if(LINUX) - target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE libeb X11 PkgConfig::LIBXTST) + target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE X11 PkgConfig::LIBXTST) + + if(WITH_EPWING_SUPPORT) + target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE eb ) + endif() endif () if(APPLE) diff --git a/eb b/eb deleted file mode 160000 index cda41734..00000000 --- a/eb +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cda417343ceedcb4b44e37e54590979f59c748c9 diff --git a/thirdparty/eb b/thirdparty/eb new file mode 160000 index 00000000..b4d020be --- /dev/null +++ b/thirdparty/eb @@ -0,0 +1 @@ +Subproject commit b4d020bee71b10c8fc1d15beb5849c5b19fd5fa1 From d1634c2e707a67fd7da8ba1d33029ccc95254b62 Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Wed, 14 Dec 2022 16:07:03 +0800 Subject: [PATCH 05/11] github: cmake build action --- .github/workflows/cmake build test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cmake build test.yml b/.github/workflows/cmake build test.yml index b7965cb4..bd4861ef 100644 --- a/.github/workflows/cmake build test.yml +++ b/.github/workflows/cmake build test.yml @@ -11,7 +11,7 @@ on: # types: [opened, synchronize, reopened] jobs: job1: - name: Build and analyze + name: ubuntu Build and analyze runs-on: ubuntu-latest steps: - uses: actions/setup-python@v3 @@ -53,7 +53,7 @@ jobs: cmake --build . job2: - name: Build and analyze + name: windows Build and analyze runs-on: windows-2019 steps: - uses: actions/setup-python@v3 @@ -63,7 +63,7 @@ jobs: uses: jurplel/install-qt-action@v3 with: version: 6.3.2 - arch: gcc_64 + arch: win64_msvc2019_64 cached: 'false' #serialport linuxdeploy need serialport to work. modules: qtwebengine qtwebchannel qtpositioning qt5compat qtmultimedia qtimageformats qtserialport @@ -79,7 +79,7 @@ jobs: cmake . cmake --build . job3: - name: Build and analyze + name: macos Build and analyze runs-on: macos-12 steps: - uses: actions/setup-python@v3 @@ -89,7 +89,7 @@ jobs: uses: jurplel/install-qt-action@v3 with: version: 6.3.2 - arch: gcc_64 + arch: clang_64 cached: 'false' #serialport linuxdeploy need serialport to work. modules: qtwebengine qtwebchannel qtpositioning qt5compat qtmultimedia qtimageformats qtserialport From 3f7530340cede231d48c5f24f2df9045b9af7a0f Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Wed, 14 Dec 2022 16:21:25 +0800 Subject: [PATCH 06/11] github: cmake build action ,macos dependencies --- .github/workflows/cmake build test.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake build test.yml b/.github/workflows/cmake build test.yml index bd4861ef..cb83c0a1 100644 --- a/.github/workflows/cmake build test.yml +++ b/.github/workflows/cmake build test.yml @@ -101,8 +101,28 @@ jobs: submodules: true - name: install dependencies run: | - brew uninstall opencc hunspell ffmpeg@5 ffmpeg@4 libtiff xz lzo libogg libvorbis zstd || true - brew install create-dmg + brew install pcre2 harfbuzz freetype + brew install cmake ninja python + brew install automake + brew install autoconf + brew install libtool + brew install opencc + brew install ffmpeg@5 + #brew reinstall $(brew deps ffmpeg) ffmpeg + brew install libao + brew install libiconv + brew install lzo bzip2 + brew install libogg + brew install zstd lzip + brew install libtiff + brew install libvorbis --force + brew install hunspell + wget ftp://ftp.sra.co.jp/pub/misc/eb/eb-4.4.3.tar.bz2 + tar xvjf eb-4.4.3.tar.bz2 + cd eb-4.4.3 && ./configure && make -j 8 && sudo make install && cd .. + #brew install qt # or use official offline installer + brew install xz lzo + brew install pkg-config - name: Run build-wrapper run: | cmake . From 1e6b13421fbc52475f6d79283c4794dc83b11652 Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Wed, 14 Dec 2022 16:26:07 +0800 Subject: [PATCH 07/11] github: cmake build action ,windows --- .github/workflows/cmake build test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake build test.yml b/.github/workflows/cmake build test.yml index cb83c0a1..da10e665 100644 --- a/.github/workflows/cmake build test.yml +++ b/.github/workflows/cmake build test.yml @@ -76,7 +76,7 @@ jobs: - name: Run build-wrapper run: | - cmake . + cmake . -DCMAKE_BUILD_TYPE=Release cmake --build . job3: name: macos Build and analyze From edc412c2cdcf2a42efb94ea20e0dca9f23859b79 Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Wed, 14 Dec 2022 18:00:15 +0800 Subject: [PATCH 08/11] github: cmake build action fix macos ,windows build error --- .github/workflows/cmake build test.yml | 5 +++-- CMakeLists.txt | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake build test.yml b/.github/workflows/cmake build test.yml index da10e665..e6844679 100644 --- a/.github/workflows/cmake build test.yml +++ b/.github/workflows/cmake build test.yml @@ -76,8 +76,9 @@ jobs: - name: Run build-wrapper run: | - cmake . -DCMAKE_BUILD_TYPE=Release - cmake --build . + mkdir build_dir + cmake -S . -B build_dir -DCMAKE_BUILD_TYPE=Release + cmake --build build_dir --parallel 7 --config Release job3: name: macos Build and analyze runs-on: macos-12 diff --git a/CMakeLists.txt b/CMakeLists.txt index bf136187..770536d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,11 @@ if(UNIX AND NOT APPLE) endif() if (APPLE) + if(WITH_EPWING_SUPPORT) add_subdirectory(thirdparty/eb) + endif() + + include_directories(/usr/local/include /opt/homebrew/include) endif () project(goldendict @@ -477,6 +481,9 @@ if(MSVC) target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/winlibs/include/ ) + + set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY + MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") endif() target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE @@ -491,7 +498,9 @@ target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE ) if(APPLE) + if(WITH_EPWING_SUPPORT) target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE eb) + endif() endif() if(UNIX) From b1e888cf18dabc900928ac4759077f7df7b19921 Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Thu, 15 Dec 2022 10:49:49 +0800 Subject: [PATCH 09/11] github: cmake build action ,windows runtime library --- .github/workflows/cmake build test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake build test.yml b/.github/workflows/cmake build test.yml index e6844679..68886c46 100644 --- a/.github/workflows/cmake build test.yml +++ b/.github/workflows/cmake build test.yml @@ -76,9 +76,8 @@ jobs: - name: Run build-wrapper run: | - mkdir build_dir - cmake -S . -B build_dir -DCMAKE_BUILD_TYPE=Release - cmake --build build_dir --parallel 7 --config Release + cmake -S . -DCMAKE_BUILD_TYPE=Release + cmake --build . --config Release job3: name: macos Build and analyze runs-on: macos-12 From 08c0df49e1dbd01c332112bd631703ea8c583a3a Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Thu, 15 Dec 2022 15:11:09 +0800 Subject: [PATCH 10/11] fix: change macro QT_NO_OPENSSL to QT_NO_SSL --- article_netmgr.cc | 2 +- mainwindow.cc | 4 ++-- mediawiki.cc | 4 ++-- webmultimediadownload.cc | 4 ++-- website.cc | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/article_netmgr.cc b/article_netmgr.cc index 6d565284..e96d55f3 100644 --- a/article_netmgr.cc +++ b/article_netmgr.cc @@ -242,7 +242,7 @@ QNetworkReply * ArticleNetworkAccessManager::getArticleReply( QNetworkRequest co if( url.scheme() == "https") { -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL connect( reply, SIGNAL( sslErrors( QList< QSslError > ) ), reply, SLOT( ignoreSslErrors() ) ); #endif diff --git a/mainwindow.cc b/mainwindow.cc index c6e8a780..80bc3215 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -82,7 +82,7 @@ using std::wstring; using std::map; using std::pair; -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL class InitSSLRunnable : public QRunnable { @@ -157,7 +157,7 @@ MainWindow::MainWindow( Config::Class & cfg_ ): if( QThreadPool::globalInstance()->maxThreadCount() < MIN_THREAD_COUNT ) QThreadPool::globalInstance()->setMaxThreadCount( MIN_THREAD_COUNT ); -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL QThreadPool::globalInstance()->start( new InitSSLRunnable ); #endif diff --git a/mediawiki.cc b/mediawiki.cc index 678db47a..bea445d7 100644 --- a/mediawiki.cc +++ b/mediawiki.cc @@ -135,7 +135,7 @@ MediaWikiWordSearchRequest::MediaWikiWordSearchRequest( wstring const & str, connect( netReply.get(), SIGNAL( finished() ), this, SLOT( downloadFinished() ) ); -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL connect( netReply.get(), SIGNAL( sslErrors( QList< QSslError > ) ), netReply.get(), SLOT( ignoreSslErrors() ) ); @@ -279,7 +279,7 @@ void MediaWikiArticleRequest::addQuery( QNetworkAccessManager & mgr, connect( netReply, &QNetworkReply::errorOccurred, this, [=](QNetworkReply::NetworkError e){ qDebug()<< "error:"< ) ), netReply, SLOT( ignoreSslErrors() ) ); diff --git a/webmultimediadownload.cc b/webmultimediadownload.cc index 715cc5c5..c15784b7 100644 --- a/webmultimediadownload.cc +++ b/webmultimediadownload.cc @@ -15,7 +15,7 @@ redirectCount( 0 ) reply = mgr.get( QNetworkRequest( url ) ); -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL connect( reply, SIGNAL( sslErrors( QList< QSslError > ) ), reply, SLOT( ignoreSslErrors() ) ); #endif @@ -52,7 +52,7 @@ void WebMultimediaDownload::replyFinished( QNetworkReply * r ) } reply = mgr.get( QNetworkRequest( redirectUrl ) ); -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL connect( reply, SIGNAL( sslErrors( QList< QSslError > ) ), reply, SLOT( ignoreSslErrors() ) ); #endif diff --git a/website.cc b/website.cc index e5012498..2c933cae 100644 --- a/website.cc +++ b/website.cc @@ -140,7 +140,7 @@ WebSiteArticleRequest::WebSiteArticleRequest( QString const & url_, request.setAttribute( QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::NoLessSafeRedirectPolicy ); netReply = mgr.get( request ); -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL connect( netReply, SIGNAL( sslErrors( QList< QSslError > ) ), netReply, SLOT( ignoreSslErrors() ) ); #endif @@ -173,7 +173,7 @@ void WebSiteArticleRequest::requestFinished( QNetworkReply * r ) disconnect( netReply, 0, 0, 0 ); netReply->deleteLater(); netReply = mgr.get( QNetworkRequest( redirectUrl ) ); -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL connect( netReply, SIGNAL( sslErrors( QList< QSslError > ) ), netReply, SLOT( ignoreSslErrors() ) ); #endif @@ -449,7 +449,7 @@ WebSiteResourceRequest::WebSiteResourceRequest( QString const & url_, netReply = mgr.get( QNetworkRequest( reqUrl ) ); -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL connect( netReply, SIGNAL( sslErrors( QList< QSslError > ) ), netReply, SLOT( ignoreSslErrors() ) ); #endif @@ -482,7 +482,7 @@ void WebSiteResourceRequest::requestFinished( QNetworkReply * r ) disconnect( netReply, 0, 0, 0 ); netReply->deleteLater(); netReply = mgr.get( QNetworkRequest( redirectUrl ) ); -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL connect( netReply, SIGNAL( sslErrors( QList< QSslError > ) ), netReply, SLOT( ignoreSslErrors() ) ); #endif From e95f69ad551cb692e2a8c460ee342dab7815e0c9 Mon Sep 17 00:00:00 2001 From: Xiao YiFang Date: Fri, 16 Dec 2022 21:00:02 +0800 Subject: [PATCH 11/11] fix: when in darkmode ,dictionary info panel background text is unclear --- dictinfo.ui | 74 ------------------------------------------------ mainwindow.cc | 2 ++ orderandprops.ui | 74 ------------------------------------------------ 3 files changed, 2 insertions(+), 148 deletions(-) diff --git a/dictinfo.ui b/dictinfo.ui index 58f8f80b..8d5de1bb 100644 --- a/dictinfo.ui +++ b/dictinfo.ui @@ -151,43 +151,6 @@ 70 - - - - - - - 224 - 223 - 223 - - - - - - - - - 224 - 223 - 223 - - - - - - - - - 212 - 208 - 200 - - - - - - @@ -214,43 +177,6 @@ - - - - - - - 224 - 223 - 223 - - - - - - - - - 224 - 223 - 223 - - - - - - - - - 212 - 208 - 200 - - - - - - diff --git a/mainwindow.cc b/mainwindow.cc index 80bc3215..b5b0bce2 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -1197,6 +1197,8 @@ void MainWindow::applyQtStyleSheet( QString const & displayStyle, QString const darkPalette.setColor( QPalette::Disabled, QPalette::Text, disabledColor ); darkPalette.setColor( QPalette::Button, darkColor ); darkPalette.setColor( QPalette::ButtonText, Qt::white ); + darkPalette.setColor( QPalette::Dark, QColor( 35, 35, 35 ) ); + darkPalette.setColor( QPalette::Shadow, QColor( 20, 20, 20 ) ); darkPalette.setColor( QPalette::Disabled, QPalette::ButtonText, disabledColor ); darkPalette.setColor( QPalette::BrightText, Qt::red ); darkPalette.setColor( QPalette::Link, QColor( 42, 130, 218 ) ); diff --git a/orderandprops.ui b/orderandprops.ui index 62d48533..8cfdb76f 100644 --- a/orderandprops.ui +++ b/orderandprops.ui @@ -168,43 +168,6 @@ - - - - - - - 224 - 223 - 223 - - - - - - - - - 224 - 223 - 223 - - - - - - - - - 212 - 208 - 200 - - - - - - QFrame::NoFrame @@ -266,43 +229,6 @@ 65 - - - - - - - 224 - 223 - 222 - - - - - - - - - 224 - 223 - 222 - - - - - - - - - 224 - 223 - 222 - - - - - - QFrame::NoFrame