From dee29a35b7abed7c621e6c4b4c891cab51cc2c22 Mon Sep 17 00:00:00 2001 From: Danny Edel Date: Thu, 27 Apr 2023 20:39:04 +0200 Subject: [PATCH 1/6] drop ubuntu-18.04 from CI --- .github/workflows/ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 4c09cfb..a202eb4 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -11,7 +11,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04 ] + os: [ ubuntu-20.04, ubuntu-22.04 ] buildtype: [ Debug, Release ] steps: - uses: actions/checkout@v3 From 978809207d167dd3b41a32779522b13ad02df0e1 Mon Sep 17 00:00:00 2001 From: Danny Edel Date: Thu, 27 Apr 2023 20:55:48 +0200 Subject: [PATCH 2/6] add archlinux-via-docker --- .github/workflows/arch.yml | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/arch.yml diff --git a/.github/workflows/arch.yml b/.github/workflows/arch.yml new file mode 100644 index 0000000..e17bbe2 --- /dev/null +++ b/.github/workflows/arch.yml @@ -0,0 +1,43 @@ +name: archlinux + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + runs-on: ubuntu-latest + container: + image: archlinux:latest + strategy: + matrix: + buildtype: [Debug, Release] + steps: + - uses: actions/checkout@v3 + - run: > + pacman -Sy --noconfirm + base-devel + git + boost-libs boost + qt5-base qt5-tools + poppler-qt5 + cmake + xorg-server-xvfb + - run: > + cmake -B build/ + -DCMAKE_VERBOSE_MAKEFILE=ON + -DUsePrerenderedPDF=ON + -DCodeCoverage=ON + -DWarningAsError=ON + -DCMAKE_BUILD_TYPE=${{matrix.buildtype}} + . + - run: cmake --build build/ + - name: run tests within xvfb + working-directory: build/ + run: > + xvfb-run -a -s '-screen 0 1920x1080x24 -screen 1 1920x1200x24' + ctest --output-on-failure --timeout 60 + - name: upload coverage + run: bash <(curl -s https://codecov.io/bash) From 7052d78aad28123ea8f36e395fc1b60c27c79ac2 Mon Sep 17 00:00:00 2001 From: Danny Edel Date: Thu, 27 Apr 2023 21:26:58 +0200 Subject: [PATCH 3/6] ci/ubuntu: activate -Werror --- .github/workflows/ubuntu.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index a202eb4..e813a90 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -31,6 +31,7 @@ jobs: -DCMAKE_VERBOSE_MAKEFILE=ON -DUsePrerenderedPDF=ON -DCodeCoverage=ON + -DWarningAsError=ON -DCMAKE_BUILD_TYPE=${{matrix.buildtype}} . - run: cmake --build build/ From 278108ecab1f68619a3732432d8dc20e1fc1dba6 Mon Sep 17 00:00:00 2001 From: Danny Edel Date: Thu, 27 Apr 2023 21:34:58 +0200 Subject: [PATCH 4/6] ci/actions: set fetch-depth to 3 --- .github/workflows/arch.yml | 2 ++ .github/workflows/osx.yml | 2 ++ .github/workflows/ubuntu.yml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/.github/workflows/arch.yml b/.github/workflows/arch.yml index e17bbe2..9e03118 100644 --- a/.github/workflows/arch.yml +++ b/.github/workflows/arch.yml @@ -16,6 +16,8 @@ jobs: buildtype: [Debug, Release] steps: - uses: actions/checkout@v3 + with: + fetch-depth: 3 - run: > pacman -Sy --noconfirm base-devel diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yml index e5cda8a..8b8fc2a 100644 --- a/.github/workflows/osx.yml +++ b/.github/workflows/osx.yml @@ -18,6 +18,8 @@ jobs: PKG_CONFIG_PATH: /usr/local/opt/poppler-qt5/lib/pkgconfig:/usr/local/opt/poppler-qt5/share/pkgconfig steps: - uses: actions/checkout@v3 + with: + fetch-depth: 3 - run: brew install boost - run: brew install poppler-qt5 - name: cmake -B build/ diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index e813a90..0ab9287 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -15,6 +15,8 @@ jobs: buildtype: [ Debug, Release ] steps: - uses: actions/checkout@v3 + with: + fetch-depth: 3 - run: sudo apt-get update - name: Install build deps run: > From d78047a03f04d428f329e4b6215823428ad84050 Mon Sep 17 00:00:00 2001 From: Danny Edel Date: Thu, 27 Apr 2023 21:35:18 +0200 Subject: [PATCH 5/6] activate WarningAsError on clang --- .github/workflows/clang.yml | 1 + .github/workflows/osx.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/clang.yml b/.github/workflows/clang.yml index 22d5903..0864071 100644 --- a/.github/workflows/clang.yml +++ b/.github/workflows/clang.yml @@ -34,6 +34,7 @@ jobs: -DCMAKE_VERBOSE_MAKEFILE=ON -DUsePrerenderedPDF=ON -DCodeCoverage=ON + -DWarningAsError=ON -DCMAKE_BUILD_TYPE=${{matrix.buildtype}} . - run: cmake --build build/ diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yml index 8b8fc2a..a6eb471 100644 --- a/.github/workflows/osx.yml +++ b/.github/workflows/osx.yml @@ -30,6 +30,7 @@ jobs: -DCodeCoverage=ON -DCMAKE_BUILD_TYPE=${{matrix.buildtype}} -DRunDualScreenTests=OFF + -DWarningAsError=ON . - run: cmake --build build/ - run: ctest --output-on-failure --timeout 60 From 2cec553b2b7f61551f07c31cd6837d437f02f44f Mon Sep 17 00:00:00 2001 From: Danny Edel Date: Thu, 27 Apr 2023 21:46:39 +0200 Subject: [PATCH 6/6] fix bugs detected by clang --- dspdfviewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspdfviewer.cpp b/dspdfviewer.cpp index b963bec..85e8279 100644 --- a/dspdfviewer.cpp +++ b/dspdfviewer.cpp @@ -47,7 +47,7 @@ DSPDFViewer::DSPDFViewer(const RuntimeConfiguration& r): renderFactory(r), m_pagenumber(0), audienceWindow(1, r.useFullPage() ? PagePart::FullPage : PagePart::LeftHalf , false, r, WindowRole::AudienceWindow), - secondaryWindow(0, (r.useFullPage() | r.duplicate())? PagePart::FullPage : PagePart::RightHalf, true , r, WindowRole::PresenterWindow, r.useSecondScreen()) + secondaryWindow(0, (r.useFullPage() || r.duplicate())? PagePart::FullPage : PagePart::RightHalf, true , r, WindowRole::PresenterWindow, r.useSecondScreen()) { DEBUGOUT << tr("Starting constructor") ; @@ -307,7 +307,7 @@ RenderingIdentifier DSPDFViewer::toRenderIdent(unsigned int pageNumber, const PD RenderingIdentifier DSPDFViewer::toThumbnailRenderIdent(unsigned int pageNumber, PDFViewerWindow& window) { - QSize newSize = window.getPreviewImageSize();; + QSize newSize = window.getPreviewImageSize(); static QSize thumbnailSize; if ( thumbnailSize != newSize ) { DEBUGOUT << "Thumbnail size changed from" << thumbnailSize << "to" << newSize;