Commit 78cf6bd9 authored by Albert Astals Cid's avatar Albert Astals Cid

CI: enable more modernize checks

Since unfortunately some of the autogenerated includes don't pass the
checks we do a trick of building out of source and then specifying the
.*/okular/.* path as the only includes we care about
parent a2ac42b9
......@@ -29,7 +29,6 @@ build_clang_tidy:
- apt-get install --yes --no-install-recommends ninja-build clang clang-tidy python python-yaml libkf5crash-dev libkf5purpose-dev
script:
- mkdir -p build && cd build
- CC=clang CXX=clang++ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja ..
- srcdir=`pwd` && mkdir -p /tmp/okular_build && cd /tmp/okular_build && CC=clang CXX=clang++ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja $srcdir
- ninja
- "run-clang-tidy -header-filter='.*' -checks='-*,modernize-redundant-void-arg,modernize-use-bool-literals' -config=\"{WarningsAsErrors: '*'}\""
- "run-clang-tidy -header-filter='.*/okular/.*' -checks='-*,modernize-redundant-void-arg,modernize-use-bool-literals,modernize-make-unique,modernize-make-shared,modernize-use-override,modernize-use-equals-delete,modernize-use-emplace' -config=\"{WarningsAsErrors: '*'}\""
......@@ -37,7 +37,7 @@ public:
QTimer::singleShot(0, this, &MessageBoxHelper::closeMessageBox);
}
~MessageBoxHelper()
~MessageBoxHelper() override
{
QVERIFY(m_clicked);
}
......
......@@ -62,7 +62,7 @@ public:
QTimer::singleShot(0, this, &CloseDialogHelper::closeDialog);
}
~CloseDialogHelper()
~CloseDialogHelper() override
{
QVERIFY(m_clicked);
}
......
......@@ -17,7 +17,7 @@ class EditDrawingToolDialogTest : public QObject
Q_OBJECT
public:
explicit EditDrawingToolDialogTest(QObject *parent = nullptr);
~EditDrawingToolDialogTest();
~EditDrawingToolDialogTest() override;
private Q_SLOTS:
void shouldHaveDefaultValues();
......
......@@ -21,7 +21,7 @@ class DlgAccessibility : public QWidget
public:
explicit DlgAccessibility( QWidget * parent = nullptr );
~DlgAccessibility();
~DlgAccessibility() override;
private Q_SLOTS:
void slotColorMode( int mode );
......
......@@ -21,7 +21,7 @@ class DlgEditor : public QWidget
public:
explicit DlgEditor( QWidget * parent = nullptr );
virtual ~DlgEditor();
~DlgEditor() override;
private Q_SLOTS:
void editorChanged( int which );
......
......@@ -22,7 +22,7 @@ class DlgGeneral : public QWidget
public:
explicit DlgGeneral( QWidget * parent, Okular::EmbedMode embedMode );
virtual ~DlgGeneral();
~DlgGeneral() override;
public slots:
void setCustomBackgroundColorButton( bool value );
......
......@@ -20,7 +20,7 @@ class DlgPerformance : public QWidget
public:
explicit DlgPerformance( QWidget * parent = nullptr );
virtual ~DlgPerformance();
~DlgPerformance() override;
protected Q_SLOTS:
void radioGroup_changed( int which );
......
......@@ -20,7 +20,7 @@ class DlgPresentation : public QWidget
public:
explicit DlgPresentation( QWidget * parent = nullptr );
virtual ~DlgPresentation();
~DlgPresentation() override;
protected Q_SLOTS:
void screenComboChanged( int which );
......
......@@ -44,7 +44,7 @@ class EditAnnotToolDialog : public QDialog
};
explicit EditAnnotToolDialog( QWidget *parent = nullptr, const QDomElement &initialState = QDomElement() );
~EditAnnotToolDialog();
~EditAnnotToolDialog() override;
QString name() const;
QDomDocument toolXml() const;
......
......@@ -23,7 +23,7 @@ class EditDrawingToolDialog : public QDialog
Q_OBJECT
public:
explicit EditDrawingToolDialog( const QDomElement &initialState = QDomElement(), QWidget *parent = nullptr );
~EditDrawingToolDialog();
~EditDrawingToolDialog() override;
QDomDocument toolXml() const;
......
......@@ -20,7 +20,7 @@ class WidgetAnnotTools : public WidgetConfigurationToolsBase
Q_OBJECT
public:
explicit WidgetAnnotTools( QWidget * parent = nullptr );
~WidgetAnnotTools();
~WidgetAnnotTools() override;
QStringList tools() const override;
void setTools(const QStringList& items) override;
......
......@@ -22,7 +22,7 @@ class WidgetConfigurationToolsBase : public QWidget
public:
explicit WidgetConfigurationToolsBase( QWidget * parent = nullptr );
~WidgetConfigurationToolsBase();
~WidgetConfigurationToolsBase() override;
virtual QStringList tools() const = 0;
virtual void setTools(const QStringList& items) = 0;
......
......@@ -18,7 +18,7 @@ class WidgetDrawingTools : public WidgetConfigurationToolsBase
Q_OBJECT
public:
explicit WidgetDrawingTools( QWidget * parent = nullptr );
~WidgetDrawingTools();
~WidgetDrawingTools() override;
QStringList tools() const override;
void setTools( const QStringList& items ) override;
......
......@@ -152,7 +152,7 @@ class OKULARCORE_EXPORT GotoAction : public Action
/**
* Destroys the goto action.
*/
virtual ~GotoAction();
~GotoAction() override;
/**
* Returns the action type.
......@@ -208,7 +208,7 @@ class OKULARCORE_EXPORT ExecuteAction : public Action
/**
* Destroys the execute action.
*/
virtual ~ExecuteAction();
~ExecuteAction() override;
/**
* Returns the action type.
......@@ -252,7 +252,7 @@ class OKULARCORE_EXPORT BrowseAction : public Action
/**
* Destroys the browse action.
*/
virtual ~BrowseAction();
~BrowseAction() override;
/**
* Returns the action type.
......@@ -311,7 +311,7 @@ class OKULARCORE_EXPORT DocumentAction : public Action
/**
* Destroys the document action.
*/
virtual ~DocumentAction();
~DocumentAction() override;
/**
* Returns the action type.
......@@ -353,7 +353,7 @@ class OKULARCORE_EXPORT SoundAction : public Action
/**
* Destroys the sound action.
*/
virtual ~SoundAction();
~SoundAction() override;
/**
* Returns the action type.
......@@ -414,7 +414,7 @@ class OKULARCORE_EXPORT ScriptAction : public Action
/**
* Destroys the browse action.
*/
virtual ~ScriptAction();
~ScriptAction() override;
/**
* Returns the action type.
......@@ -467,7 +467,7 @@ class OKULARCORE_EXPORT MovieAction : public Action
/**
* Destroys the movie action.
*/
virtual ~MovieAction();
~MovieAction() override;
/**
* Returns the action type.
......@@ -532,7 +532,7 @@ class OKULARCORE_EXPORT RenditionAction : public Action
/**
* Destroys the rendition action.
*/
virtual ~RenditionAction();
~RenditionAction() override;
/**
* Returns the action type.
......
......@@ -786,7 +786,7 @@ class OKULARCORE_EXPORT TextAnnotation : public Annotation
/**
* Destroys the text annotation.
*/
~TextAnnotation();
~TextAnnotation() override;
/**
* Sets the text @p type of the text annotation.
......@@ -934,7 +934,7 @@ class OKULARCORE_EXPORT LineAnnotation : public Annotation
/**
* Destroys the line annotation.
*/
~LineAnnotation();
~LineAnnotation() override;
/**
* Sets the normalized line @p points of the line annotation.
......@@ -1073,7 +1073,7 @@ class OKULARCORE_EXPORT GeomAnnotation : public Annotation
/**
* Destroys the geometrical annotation.
*/
~GeomAnnotation();
~GeomAnnotation() override;
/**
* Sets the geometrical @p type of the geometrical annotation.
......@@ -1139,7 +1139,7 @@ class OKULARCORE_EXPORT HighlightAnnotation : public Annotation
/**
* Destroys the highlight annotation.
*/
~HighlightAnnotation();
~HighlightAnnotation() override;
/**
* Sets the @p type of the highlight annotation.
......@@ -1284,7 +1284,7 @@ class OKULARCORE_EXPORT StampAnnotation : public Annotation
/**
* Destroys the stamp annotation.
*/
~StampAnnotation();
~StampAnnotation() override;
/**
* Sets the @p name of the icon for the stamp annotation.
......@@ -1328,7 +1328,7 @@ class OKULARCORE_EXPORT InkAnnotation : public Annotation
/**
* Destroys the ink annotation.
*/
~InkAnnotation();
~InkAnnotation() override;
/**
* Sets the @p paths of points for the ink annotation.
......@@ -1387,7 +1387,7 @@ class OKULARCORE_EXPORT CaretAnnotation : public Annotation
/**
* Destroys the caret annotation.
*/
~CaretAnnotation();
~CaretAnnotation() override;
/**
* Sets the @p symbol for the caret annotation.
......@@ -1429,7 +1429,7 @@ class OKULARCORE_EXPORT FileAttachmentAnnotation : public Annotation
/**
* Destroys the file attachment annotation.
*/
virtual ~FileAttachmentAnnotation();
~FileAttachmentAnnotation() override;
/**
* Gets the name of the icon.
......@@ -1489,7 +1489,7 @@ class OKULARCORE_EXPORT SoundAnnotation : public Annotation
/**
* Destroys the sound annotation.
*/
virtual ~SoundAnnotation();
~SoundAnnotation() override;
/**
* Gets the name of the icon.
......@@ -1549,7 +1549,7 @@ class OKULARCORE_EXPORT MovieAnnotation : public Annotation
/**
* Destroys the movie annotation.
*/
virtual ~MovieAnnotation();
~MovieAnnotation() override;
/**
* Gets the movie object.
*/
......@@ -1597,7 +1597,7 @@ class OKULARCORE_EXPORT ScreenAnnotation : public Annotation
/**
* Destroys the screen annotation.
*/
virtual ~ScreenAnnotation();
~ScreenAnnotation() override;
/**
* Returns the sub type of the screen annotation.
......@@ -1666,7 +1666,7 @@ class OKULARCORE_EXPORT WidgetAnnotation : public Annotation
/**
* Destroys the widget annotation.
*/
virtual ~WidgetAnnotation();
~WidgetAnnotation() override;
/**
* Returns the sub type of the widget annotation.
......@@ -1721,7 +1721,7 @@ class OKULARCORE_EXPORT RichMediaAnnotation : public Annotation
/**
* Destroys the rich media annotation.
*/
virtual ~RichMediaAnnotation();
~RichMediaAnnotation() override;
/**
* Returns the sub type of the rich media annotation.
......
......@@ -559,7 +559,7 @@ class OKULARCORE_EXPORT AnnotationObjectRect : public ObjectRect
/**
* Destroys the annotation object rectangle.
*/
virtual ~AnnotationObjectRect();
~AnnotationObjectRect() override;
/**
* Returns the annotation object of the annotation object rectangle.
......@@ -627,7 +627,7 @@ class OKULARCORE_EXPORT NonOwningObjectRect : public ObjectRect
{
public:
NonOwningObjectRect( double left, double top, double right, double bottom, bool ellipse, ObjectType type, void *object );
~NonOwningObjectRect();
~NonOwningObjectRect() override;
};
/// @cond PRIVATE
......
......@@ -49,7 +49,7 @@ class OKULARCORE_EXPORT AudioPlayer : public QObject
StoppedState
};
~AudioPlayer();
~AudioPlayer() override;
/**
* Gets the instance of the audio player.
......
......@@ -35,7 +35,7 @@ class OKULARCORE_EXPORT BookmarkManager : public QObject
Q_OBJECT
public:
virtual ~BookmarkManager();
~BookmarkManager() override;
/**
* Returns the list of documents with bookmarks.
......
......@@ -23,7 +23,7 @@ class ChooseEngineDialog : public QDialog
public:
ChooseEngineDialog( const QStringList &generators, const QMimeType &mime, QWidget * parent = nullptr );
~ChooseEngineDialog();
~ChooseEngineDialog() override;
int selectedGenerator() const;
......
......@@ -202,7 +202,7 @@ class OKULARCORE_EXPORT Document : public QObject
/**
* Destroys the document.
*/
~Document();
~Document() override;
/**
* Describes the result of an open document operation.
......
......@@ -39,7 +39,7 @@ class AddAnnotationCommand : public OkularUndoCommand
public:
AddAnnotationCommand(Okular::DocumentPrivate * docPriv, Okular::Annotation* annotation, int pageNumber);
virtual ~AddAnnotationCommand();
~AddAnnotationCommand() override;
void undo() override;
......@@ -58,7 +58,7 @@ class RemoveAnnotationCommand : public OkularUndoCommand
{
public:
RemoveAnnotationCommand(Okular::DocumentPrivate * doc, Okular::Annotation* annotation, int pageNumber);
virtual ~RemoveAnnotationCommand();
~RemoveAnnotationCommand() override;
void undo() override;
void redo() override;
......
......@@ -199,7 +199,7 @@ class OKULARCORE_EXPORT FormFieldButton : public FormField
Radio ///< A radio button.
};
virtual ~FormFieldButton();
~FormFieldButton() override;
/**
The particular type of the button field.
......@@ -264,7 +264,7 @@ class OKULARCORE_EXPORT FormFieldText : public FormField
FileSelect ///< An input field to select the path of a file on disk.
};
virtual ~FormFieldText();
~FormFieldText() override;
/**
* The particular type of the text field.
......@@ -352,7 +352,7 @@ class OKULARCORE_EXPORT FormFieldChoice : public FormField
ListBox ///< A list box choice field.
};
virtual ~FormFieldChoice();
~FormFieldChoice() override;
/**
* The particular type of the choice field.
......@@ -445,7 +445,7 @@ class OKULARCORE_EXPORT FormFieldSignature : public FormField
UnknownType
};
~FormFieldSignature();
~FormFieldSignature() override;
/**
* The signature type
......
......@@ -224,7 +224,7 @@ class OKULARCORE_EXPORT Generator : public QObject
/**
* Destroys the generator.
*/
virtual ~Generator();
~Generator() override;
/**
* Loads the document with the given @p fileName and fills the
......
......@@ -27,7 +27,7 @@ class PageController : public QObject
public:
PageController();
~PageController();
~PageController() override;
void addRotationJob( RotationJob *job );
......
......@@ -42,7 +42,7 @@ class OKULARCORE_EXPORT TextDocumentConverter : public QObject
/**
* Destroys the generic converter.
*/
~TextDocumentConverter();
~TextDocumentConverter() override;
/**
* Returns the generated QTextDocument object. The caller takes ownership of the QTextDocument
......@@ -174,7 +174,7 @@ class OKULARCORE_EXPORT TextDocumentGenerator : public Generator, public Okular:
*/
TextDocumentGenerator(TextDocumentConverter *converter, const QString& configName, QObject *parent, const QVariantList &args);
virtual ~TextDocumentGenerator();
~TextDocumentGenerator() override;
// [INHERITED] load a document and fill up the pagesVector
Document::OpenResult loadDocumentWithPassword( const QString & fileName, QVector<Okular::Page*> & pagesVector, const QString &password ) override;
......
......@@ -180,7 +180,7 @@ class TextDocumentGeneratorPrivate : public GeneratorPrivate
{
}
virtual ~TextDocumentGeneratorPrivate()
~TextDocumentGeneratorPrivate() override
{
delete mConverter;
delete mDocument;
......
......@@ -85,7 +85,7 @@ class OKULARCORE_EXPORT TextDocumentSettingsWidget : public QWidget
public:
explicit TextDocumentSettingsWidget( QWidget *parent = nullptr );
virtual ~TextDocumentSettingsWidget();
~TextDocumentSettingsWidget() override;
void addRow( const QString& labelText, QWidget *widget );
......
......@@ -34,7 +34,7 @@ class CHMGenerator : public Okular::Generator
Q_INTERFACES( Okular::Generator )
public:
CHMGenerator( QObject *parent, const QVariantList &args );
~CHMGenerator();
~CHMGenerator() override;
bool loadDocument( const QString & fileName, QVector< Okular::Page * > & pagesVector ) override;
Okular::DocumentInfo generateDocumentInfo( const QSet<Okular::DocumentInfo::Key> &keys ) const override;
......
......@@ -35,7 +35,7 @@ class ProtocolMSITS : public KIO::SlaveBase
{
public:
ProtocolMSITS ( const QByteArray&, const QByteArray& );
virtual ~ProtocolMSITS();
~ProtocolMSITS() override;
void get (const QUrl & ) override;
void listDir (const QUrl & url) override;
......
......@@ -36,7 +36,7 @@ class EBook_CHM : public EBook
{
public:
EBook_CHM();
~EBook_CHM();
~EBook_CHM() override;
/*!
* \brief Attempts to load chm file.
......@@ -47,20 +47,20 @@ class EBook_CHM : public EBook
* if files linked to this one are present locally (like MSDN).
* \ingroup init
*/
bool load( const QString& archiveName );
bool load( const QString& archiveName ) override;
/*!
* \brief Closes all the files, and frees the appropriate data.
* \ingroup init
*/
virtual void close();
void close() override;
/*!
* \brief Gets the title name of the opened ebook.
* \return The name of the opened document, or an empty string if no ebook has been loaded.
* \ingroup information
*/
virtual QString title() const;
QString title() const override;
/*!
* \brief Gets the default URL of the e-book which should be opened when the book it first open
......@@ -69,14 +69,14 @@ class EBook_CHM : public EBook
* the root of the archive filesystem. If no book has been opened, returns "/".
* \ingroup information
*/
virtual QUrl homeUrl() const;
QUrl homeUrl() const override;
/*!
* \brief Checks whether the specific feature is present in this file.
* \return true if it is available; false otherwise.
* \ingroup information
*/
virtual bool hasFeature( Feature code ) const;
bool hasFeature( Feature code ) const override;
/*!
* \brief Parses and fills up the Table of Contents (TOC)
......@@ -87,7 +87,7 @@ class EBook_CHM : public EBook
* by really buggy files; please report a bug if the file is opened ok under Windows.
* \ingroup fileparsing
*/
virtual bool getTableOfContents( QList< EBookTocEntry >& toc ) const;
bool getTableOfContents( QList< EBookTocEntry >& toc ) const override;
/*!
* \brief Parses the index table
......@@ -98,7 +98,7 @@ class EBook_CHM : public EBook
* by really buggy chm file; so far it never happened on indexes.
* \ingroup fileparsing
*/
virtual bool getIndex( QList< EBookIndexEntry >& index ) const;
bool getIndex( QList< EBookIndexEntry >& index ) const override;
/*!
* \brief Retrieves the content associated with the url from the current ebook as QString.
......@@ -113,7 +113,7 @@ class EBook_CHM : public EBook
* \sa setCurrentEncoding() currentEncoding() getFileContentAsBinary()
* \ingroup dataretrieve
*/
virtual bool getFileContentAsString( QString& str, const QUrl& url ) const;
bool getFileContentAsString( QString& str, const QUrl& url ) const override;
/*!
* \brief Retrieves the content from url in current chm file to QByteArray.
......@@ -127,7 +127,7 @@ class EBook_CHM : public EBook
* \sa getFileContentAsString()
* \ingroup dataretrieve
*/
virtual bool getFileContentAsBinary( QByteArray& data, const QUrl& url ) const;
bool getFileContentAsBinary( QByteArray& data, const QUrl& url ) const override;
/*!
* \brief Retrieves the content size.
......@@ -146,7 +146,7 @@ class EBook_CHM : public EBook
*
* \ingroup dataretrieve
*/
virtual bool enumerateFiles( QList<QUrl>& files );
bool enumerateFiles( QList<QUrl>& files ) override;
/*!
* \brief Gets the Title of the page referenced by url.
......@@ -155,7 +155,7 @@ class EBook_CHM : public EBook
*
* \ingroup dataretrieve
*/
virtual QString getTopicByUrl ( const QUrl& url );
QString getTopicByUrl ( const QUrl& url ) override;
/*!
* \brief Gets the current ebook encoding (set or autodetected) as qtcodec
......@@ -163,7 +163,7 @@ class EBook_CHM : public EBook
*
* \ingroup encoding
*/
virtual QString currentEncoding() const;
QString currentEncoding() const override;
/*!
* \brief Sets the ebook encoding to use for TOC and content
......@@ -171,19 +171,19 @@ class EBook_CHM : public EBook
*
* \ingroup encoding
*/
virtual bool setCurrentEncoding ( const char * encoding );
bool setCurrentEncoding ( const char * encoding ) override;
/*!
* \brief Checks if this kind of URL is supported by the ebook format (i.e. could be passed to ebook functions)
* \param url The url to check
*/
virtual bool isSupportedUrl( const QUrl& url );
bool isSupportedUrl( const QUrl& url ) override;
// Converts the string to the ebook-specific URL format
QUrl pathToUrl( const QString & link ) const;
QUrl pathToUrl( const QString & link ) const override;
// Extracts the path component from the URL
QString urlToPath( const QUrl& link ) const;
QString urlToPath( const QUrl& link ) const override;
private:
// Used in local parser
......
......@@ -34,7 +34,7 @@ class EBook_EPUB : public EBook
{
public:
EBook_EPUB();
virtual ~EBook_EPUB();
~EBook_EPUB() override;
/*!
* \brief Attempts to load epub file.
......@@ -44,20 +44,20 @@ class EBook_EPUB : public EBook
* Loads a epub file.
* \ingroup init
*/
bool load( const QString& archiveName );
bool load( const QString& archiveName ) override;
/*!
* \brief Closes all the files, and frees the appropriate data.
* \ingroup init
*/
virtual void close();
void close() override;
/*!
* \brief Gets the title name of the opened ebook.
* \return The name of the opened document, or an empty string if no ebook has been loaded.
* \ingroup information
*/
virtual QString title() const;
QString title() const override;
/*!
* \brief Gets the default URL of the e-book which should be opened when the book it first open
......@@ -66,14 +66,14 @@ class EBook_EPUB : public EBook
* the root of the archive filesystem. If no book has been opened, returns "/".
* \ingroup information
*/
virtual QUrl homeUrl() const;
QUrl homeUrl() const override;
/*!
* \brief Checks whether the specific feature is present in this file.
* \return true if it is available; false otherwise.
* \ingroup information
*/
virtual bool hasFeature( Feature code ) const;
bool hasFeature( Feature code ) const override;
/*!
* \brief Parses and fills up the Table of Contents (TOC)
......@@ -84,7 +84,7 @@ class EBook_EPUB : public EBook
* by really buggy files; please report a bug if the file is opened ok under Windows.
* \ingroup fileparsing
*/
virtual bool getTableOfContents( QList< EBookTocEntry >& toc ) const;
bool getTableOfContents( QList< EBookTocEntry >& toc ) const override;
/*!
* \brief Parses the index table
......@@ -95,7 +95,7 @@ class EBook_EPUB : public EBook
* by really buggy chm file; so far it never happened on indexes.
* \ingroup fileparsing
*/
virtual bool getIndex( QList< EBookIndexEntry >& index ) const;
bool getIndex( QList< EBookIndexEntry >& index ) const override;