diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a526aefeb..8de30a2ea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,4 +33,4 @@ build_clang_tidy: - 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='-*,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,-bugprone-macro-parentheses,-bugprone-narrowing-conversions,-bugprone-branch-clone,-bugprone-incorrect-roundings' -config=\"{WarningsAsErrors: '*'}\"" + - "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,-bugprone-macro-parentheses,-bugprone-narrowing-conversions,-bugprone-branch-clone,-bugprone-incorrect-roundings' -config=\"{WarningsAsErrors: '*'}\"" diff --git a/core/fileprinter.cpp b/core/fileprinter.cpp index 78b3c4ca5..e66288cbe 100644 --- a/core/fileprinter.cpp +++ b/core/fileprinter.cpp @@ -31,7 +31,7 @@ using namespace Okular; -int FilePrinter::printFile(QPrinter &printer, const QString file, +int FilePrinter::printFile(QPrinter &printer, const QString file, // NOLINT(performance-unnecessary-value-param) TODO when BIC changes are allowed QPrinter::Orientation documentOrientation, FileDeletePolicy fileDeletePolicy, PageSelectPolicy pageSelectPolicy, const QString &pageRange ) { @@ -39,7 +39,7 @@ int FilePrinter::printFile(QPrinter &printer, const QString file, pageSelectPolicy, pageRange, ScaleMode::FitToPrintArea ); } -int FilePrinter::printFile(QPrinter &printer, const QString file, +int FilePrinter::printFile(QPrinter &printer, const QString file, // NOLINT(performance-unnecessary-value-param) TODO when BIC changes are allowed QPrinter::Orientation documentOrientation, FileDeletePolicy fileDeletePolicy, PageSelectPolicy pageSelectPolicy, const QString &pageRange, ScaleMode scaleMode ) @@ -49,7 +49,7 @@ int FilePrinter::printFile(QPrinter &printer, const QString file, documentOrientation, scaleMode ); } -int FilePrinter::doPrintFiles(QPrinter &printer, const QStringList fileList, FileDeletePolicy fileDeletePolicy, +int FilePrinter::doPrintFiles(QPrinter &printer, const QStringList fileList, FileDeletePolicy fileDeletePolicy, // NOLINT(performance-unnecessary-value-param) TODO when BIC changes are allowed PageSelectPolicy pageSelectPolicy, const QString &pageRange, QPrinter::Orientation documentOrientation ) { diff --git a/core/fileprinter.h b/core/fileprinter.h index df5a8a831..6ba45aedf 100644 --- a/core/fileprinter.h +++ b/core/fileprinter.h @@ -89,6 +89,7 @@ public: * * @since 1.8 */ + // TODO make file const QString & when a BIC change happens somehwere else static int printFile( QPrinter &printer, const QString file, QPrinter::Orientation documentOrientation, FileDeletePolicy fileDeletePolicy, @@ -182,6 +183,7 @@ protected: bool detectCupsService(); bool detectCupsConfig(); + // TODO make fileList const QStringList & when a BIC change happens somehwere else int doPrintFiles( QPrinter &printer, const QStringList fileList, FileDeletePolicy fileDeletePolicy, PageSelectPolicy pageSelectPolicy, const QString &pageRange, diff --git a/generators/chm/lib/ebook_epub.cpp b/generators/chm/lib/ebook_epub.cpp index b72fc4ec8..1fe48a109 100644 --- a/generators/chm/lib/ebook_epub.cpp +++ b/generators/chm/lib/ebook_epub.cpp @@ -238,7 +238,7 @@ bool EBook_EPUB::parseBookinfo() // Copy the manifest information and fill up the other maps if we have it if ( !toc_parser.entries.isEmpty() ) { - for( EBookTocEntry e : qAsConst(toc_parser.entries) ) + for( const EBookTocEntry &e : qAsConst(toc_parser.entries) ) { // Add into url-title map m_urlTitleMap[ e.url ] = e.name; diff --git a/generators/chm/lib/helper_search_index.cpp b/generators/chm/lib/helper_search_index.cpp index 3366ee169..9c88de867 100644 --- a/generators/chm/lib/helper_search_index.cpp +++ b/generators/chm/lib/helper_search_index.cpp @@ -39,7 +39,7 @@ static const char WORD_CHARACTERS[] = "$_"; struct Term { Term() : frequency(-1) {} - Term( const QString &t, int f, QVector l ) : term( t ), frequency( f ), documents( l ) {} + Term( const QString &t, int f, const QVector &l ) : term( t ), frequency( f ), documents( l ) {} QString term; int frequency; QVectordocuments; diff --git a/generators/chm/lib/helper_search_index.h b/generators/chm/lib/helper_search_index.h index 37af22ffc..932ef1f69 100644 --- a/generators/chm/lib/helper_search_index.h +++ b/generators/chm/lib/helper_search_index.h @@ -89,7 +89,7 @@ class Index : public QObject struct Entry { Entry( int d ) { documents.append( Document( d, 1 ) ); } - Entry( QVector l ) : documents( l ) {} + Entry( const QVector &l ) : documents( l ) {} QVector documents; }; diff --git a/mobile/components/documentitem.cpp b/mobile/components/documentitem.cpp index b3f02d8d2..83a596763 100644 --- a/mobile/components/documentitem.cpp +++ b/mobile/components/documentitem.cpp @@ -64,7 +64,7 @@ void DocumentItem::setUrl(const QUrl & url) //TODO: password QMimeDatabase db; - QUrl realUrl = url; + QUrl realUrl = url; // NOLINT(performance-unnecessary-copy-initialization) because of the ifdef below this can't be const & #ifdef Q_OS_ANDROID realUrl = QUrl(QtAndroid::androidActivity().callObjectMethod("contentUrlToFd",