Commit 2e46cf22 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

CI: enable clang tidy performance checks

parent 00ac89d7
Pipeline #12791 passed with stage
in 16 minutes and 50 seconds
......@@ -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: '*'}\""
......@@ -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 )
{
......
......@@ -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,
......
......@@ -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;
......
......@@ -39,7 +39,7 @@ static const char WORD_CHARACTERS[] = "$_";
struct Term
{
Term() : frequency(-1) {}
Term( const QString &t, int f, QVector<Document> l ) : term( t ), frequency( f ), documents( l ) {}
Term( const QString &t, int f, const QVector<Document> &l ) : term( t ), frequency( f ), documents( l ) {}
QString term;
int frequency;
QVector<Document>documents;
......
......@@ -89,7 +89,7 @@ class Index : public QObject
struct Entry
{
Entry( int d ) { documents.append( Document( d, 1 ) ); }
Entry( QVector<Document> l ) : documents( l ) {}
Entry( const QVector<Document> &l ) : documents( l ) {}
QVector<Document> documents;
};
......
......@@ -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",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment