From ef57526762b5d01edb65064c14cee105a4c503f7 Mon Sep 17 00:00:00 2001 From: shenleban tongying Date: Sat, 12 Oct 2024 09:41:03 -0400 Subject: [PATCH 1/2] fix: wrong lifetime of the `connection` between searchInPageAction <> openSearch --- .github/workflows/PR-check-cmake.yml | 5 ++--- src/ui/mainwindow.cc | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/PR-check-cmake.yml b/.github/workflows/PR-check-cmake.yml index b42bc794..1cb61ded 100644 --- a/.github/workflows/PR-check-cmake.yml +++ b/.github/workflows/PR-check-cmake.yml @@ -17,6 +17,8 @@ jobs: steps: - name: Install dependencies run: | + sudo apt-get update + sudo apt-get install build-essential ninja-build \ libvorbis-dev zlib1g-dev libhunspell-dev x11proto-record-dev \ libxtst-dev liblzo2-dev libbz2-dev \ @@ -34,7 +36,6 @@ jobs: qt6-webengine-dev - uses: actions/checkout@v4 with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis submodules: false - name: Run build run: | @@ -49,7 +50,6 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis submodules: false - name: Install dependencies run: | @@ -92,7 +92,6 @@ jobs: setup-python: 'false' - uses: actions/checkout@v4 with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis submodules: true - name: Run build run: | diff --git a/src/ui/mainwindow.cc b/src/ui/mainwindow.cc index 35b4f5ce..23483792 100644 --- a/src/ui/mainwindow.cc +++ b/src/ui/mainwindow.cc @@ -1851,7 +1851,7 @@ ArticleView * MainWindow::createNewTab( bool switchToIt, QString const & name ) connect( view, &ArticleView::zoomOut, this, &MainWindow::zoomout ); connect( view, &ArticleView::saveBookmarkSignal, this, &MainWindow::addBookmarkToFavorite ); - connect( ui.searchInPageAction, &QAction::triggered, this, [ this, view ]() { + connect( ui.searchInPageAction, &QAction::triggered, view, [ this, view ]() { #ifdef Q_OS_MACOS //workaround to fix macos popup page search Ctrl + F if ( scanPopup && scanPopup->isActiveWindow() ) { From 40670d819761fbd084b13ad13313175cdce89033 Mon Sep 17 00:00:00 2001 From: shenleban tongying Date: Sat, 12 Oct 2024 22:05:38 -0400 Subject: [PATCH 2/2] feat: decode program dicts as UTF-8 instead of local8bit (#1821) --- src/dict/programs.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dict/programs.cc b/src/dict/programs.cc index 7b8d1f26..ef04f92d 100644 --- a/src/dict/programs.cc +++ b/src/dict/programs.cc @@ -200,7 +200,7 @@ void RunInstance::handleProcessFinished() QByteArray err = process.readAllStandardError(); if ( !err.isEmpty() ) { - error += "\n\n" + QString::fromLocal8Bit( err ); + error += "\n\n" + QString::fromUtf8( err ); } } @@ -252,8 +252,8 @@ void ProgramDataRequest::instanceFinished( QByteArray output, QString error ) prog_output = QString::fromUtf8( output.data() + 3, output.length() - 3 ); } else { - // No BOM, assume local 8-bit encoding - prog_output = QString::fromLocal8Bit( output ); + // No BOM, assume UTF-8 encoding + prog_output = QString::fromUtf8( output ); } } catch ( std::exception & e ) {