From 91bce4a0a315c69a7693bc5e047676866709c9dd Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 20 Feb 2020 12:41:37 +0100 Subject: [PATCH] Enable clazy const-signal-or-slot --- .gitlab-ci.yml | 2 +- core/generator.h | 13 +++++++------ generators/dvi/dviRenderer.h | 3 +-- generators/poppler/generator_pdf.h | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a0cc71107..b36418cce 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -48,7 +48,7 @@ build_clazy_clang_tidy: script: - srcdir=`pwd` && mkdir -p /tmp/okular_build && cd /tmp/okular_build && CC=clang CXX=clazy CXXFLAGS="-Werror -Wno-deprecated-declarations" cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja $srcdir && cat compile_commands.json | jq '[.[] | select(.file | contains("'"$srcdir"'"))]' > compile_commands.aux.json && cat compile_commands.aux.json | jq '[.[] | select(.file | contains("/synctex/")| not)]' > compile_commands.json - - CLAZY_CHECKS="level0,incorrect-emit,qhash-namespace,detaching-temporary,range-loop,qdeleteall,inefficient-qlist-soft,qstring-left" ninja + - CLAZY_CHECKS="level0,incorrect-emit,qhash-namespace,detaching-temporary,range-loop,qdeleteall,inefficient-qlist-soft,qstring-left,const-signal-or-slot" ninja # Fix the poppler header, remove when debian:unstable ships poppler 0.82 or later - sed -i "N;N;N;N; s#class MediaRendition\;\nclass MovieAnnotation\;\nclass ScreenAnnotation;#class MediaRendition\;#g" /usr/include/poppler/qt5/poppler-link.h - "run-clang-tidy -header-filter='.*/okular/.*' -checks='-*,performance-*,bugprone-*,readability-inconsistent-declaration-parameter-name,readability-string-compare,modernize-redundant-void-arg,modernize-use-bool-literals,modernize-make-unique,modernize-make-shared,modernize-use-override,modernize-use-equals-delete,modernize-use-emplace,modernize-loop-convert,modernize-use-nullptr,-bugprone-macro-parentheses,-bugprone-narrowing-conversions,-bugprone-branch-clone,-bugprone-incorrect-roundings' -config=\"{WarningsAsErrors: '*'}\"" diff --git a/core/generator.h b/core/generator.h index 242481719..94bfa8473 100644 --- a/core/generator.h +++ b/core/generator.h @@ -600,12 +600,6 @@ class OKULARCORE_EXPORT Generator : public QObject */ void requestFontData(const Okular::FontInfo &font, QByteArray *data); - /** - * Returns the last print error in case print() failed - * @since 0.11 (KDE 4.5) - */ - Okular::Generator::PrintError printError() const; - /** * This method can be called to trigger a partial pixmap update for the given request * Make sure you call it in a way it's executed in the main thread. @@ -614,6 +608,13 @@ class OKULARCORE_EXPORT Generator : public QObject void signalPartialPixmapRequest( Okular::PixmapRequest *request, const QImage &image ); protected: + /** + * Returns the last print error in case print() failed + * @since 0.11 (KDE 4.5) + */ + // TODO Make print() return a PrintError instead of bool and remove this function when a BIC change happens somewhere else + Q_INVOKABLE Okular::Generator::PrintError printError() const; + /// @cond PRIVATE Generator(GeneratorPrivate &dd, QObject *parent, const QVariantList &args); Q_DECLARE_PRIVATE( Generator ) diff --git a/generators/dvi/dviRenderer.h b/generators/dvi/dviRenderer.h index f20df44a2..59b80c9f7 100644 --- a/generators/dvi/dviRenderer.h +++ b/generators/dvi/dviRenderer.h @@ -143,6 +143,7 @@ public: void export_finished(const DVIExport*); //void editor_finished(const DVISourceEditor*); + QVector getPrebookmarks() const { return prebookmarks; } Q_SIGNALS: /** @@ -167,8 +168,6 @@ public Q_SLOTS: SimplePageSize sizeOfPage(const PageNumber& page); - QVector getPrebookmarks() const { return prebookmarks; } - const QVector& sourceAnchors() { return sourceHyperLinkAnchors; } private Q_SLOTS: diff --git a/generators/poppler/generator_pdf.h b/generators/poppler/generator_pdf.h index fdcc490ee..2c08adce7 100644 --- a/generators/poppler/generator_pdf.h +++ b/generators/poppler/generator_pdf.h @@ -101,10 +101,10 @@ class PDFGenerator : public Okular::Generator, public Okular::ConfigInterface, p SwapBackingFileResult swapBackingFile( QString const &newFileName, QVector & newPagesVector ) override; bool doCloseDocument() override; Okular::TextPage* textPage( Okular::TextRequest *request ) override; + Q_INVOKABLE Okular::Generator::PrintError printError() const; protected Q_SLOTS: void requestFontData(const Okular::FontInfo &font, QByteArray *data); - Okular::Generator::PrintError printError() const; private: Okular::Document::OpenResult init(QVector & pagesVector, const QString &password);