Commit 0c659a54 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

clang-tidy: Enable google-explicit-constructor

parent a225fb6d
Pipeline #77136 passed with stage
in 11 minutes and 18 seconds
---
Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,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,-bugprone-suspicious-include,-bugprone-reserved-identifier,-performance-no-automatic-move,-bugprone-suspicious-enum-usage'
Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,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,google-explicit-constructor,-bugprone-macro-parentheses,-bugprone-narrowing-conversions,-bugprone-branch-clone,-bugprone-incorrect-roundings,-bugprone-suspicious-include,-bugprone-reserved-identifier,-performance-no-automatic-move,-bugprone-suspicious-enum-usage'
WarningsAsErrors: '*'
HeaderFilterRegex: '.*/okular/.*'
AnalyzeTemporaryDtors: false
......
......@@ -21,7 +21,7 @@ public:
CloseDialogHelper(QWidget *w, QDialogButtonBox::StandardButton b);
// Close a modal dialog, which may not be associated to any other widget
CloseDialogHelper(QDialogButtonBox::StandardButton b);
explicit CloseDialogHelper(QDialogButtonBox::StandardButton b);
~CloseDialogHelper() override;
......
......@@ -59,7 +59,7 @@ class ClosePrintDialogHelper : public QObject
Q_OBJECT
public:
ClosePrintDialogHelper(int expectedTab)
explicit ClosePrintDialogHelper(int expectedTab)
: foundDialog(false)
, m_expectedTab(expectedTab)
{
......
......@@ -1888,12 +1888,12 @@ void PartTest::testForwardBackwardNavigation()
const int targetPageA = 15;
part.m_document->setViewportPage(targetPageA);
QVERIFY(part.m_document->viewport() == targetPageA);
QVERIFY(part.m_document->viewport() == DocumentViewport(targetPageA));
// Go to some other page
const int targetPageB = 25;
part.m_document->setViewportPage(targetPageB);
QVERIFY(part.m_document->viewport() == targetPageB);
QVERIFY(part.m_document->viewport() == DocumentViewport(targetPageB));
// Go back to page A
QVERIFY(QMetaObject::invokeMethod(&part, "slotHistoryBack"));
......
......@@ -202,7 +202,7 @@ QString ExecuteAction::parameters() const
class Okular::BrowseActionPrivate : public Okular::ActionPrivate
{
public:
BrowseActionPrivate(const QUrl &url)
explicit BrowseActionPrivate(const QUrl &url)
: ActionPrivate()
, m_url(url)
{
......@@ -247,7 +247,7 @@ QUrl BrowseAction::url() const
class Okular::DocumentActionPrivate : public Okular::ActionPrivate
{
public:
DocumentActionPrivate(enum DocumentAction::DocumentActionType documentActionType)
explicit DocumentActionPrivate(enum DocumentAction::DocumentActionType documentActionType)
: ActionPrivate()
, m_type(documentActionType)
{
......@@ -443,7 +443,7 @@ QString ScriptAction::script() const
class Okular::MovieActionPrivate : public Okular::ActionPrivate
{
public:
MovieActionPrivate(MovieAction::OperationType operation)
explicit MovieActionPrivate(MovieAction::OperationType operation)
: ActionPrivate()
, m_operation(operation)
, m_annotation(nullptr)
......
......@@ -111,7 +111,7 @@ public:
protected:
/// @cond PRIVATE
Action(ActionPrivate &dd);
explicit Action(ActionPrivate &dd);
Q_DECLARE_PRIVATE(Action)
ActionPrivate *d_ptr;
/// @endcond
......
......@@ -675,7 +675,7 @@ public:
protected:
/// @cond PRIVATE
Annotation(AnnotationPrivate &dd);
explicit Annotation(AnnotationPrivate &dd);
Annotation(AnnotationPrivate &dd, const QDomNode &description);
Q_DECLARE_PRIVATE(Annotation)
AnnotationPrivate *d_ptr;
......
......@@ -108,7 +108,7 @@ static QUrl mostCanonicalUrl(const QUrl &url)
class BookmarkManager::Private : public KBookmarkOwner
{
public:
Private(BookmarkManager *qq)
explicit Private(BookmarkManager *qq)
: KBookmarkOwner()
, q(qq)
, document(nullptr)
......
......@@ -194,7 +194,7 @@ private:
friend class Document;
friend class DocumentPrivate;
BookmarkManager(DocumentPrivate *document);
explicit BookmarkManager(DocumentPrivate *document);
void setUrl(const QUrl &url);
bool setPageBookmark(int page);
......
......@@ -1304,12 +1304,12 @@ public:
/**
* Creates a new viewport for the given page @p number.
*/
DocumentViewport(int number = -1);
explicit DocumentViewport(int number = -1);
/**
* Creates a new viewport from the given @p xmlDesc.
*/
DocumentViewport(const QString &xmlDesc);
explicit DocumentViewport(const QString &xmlDesc);
/**
* Returns the viewport as xml description.
......@@ -1391,7 +1391,7 @@ public:
* Creates a new document synopsis object with the given
* @p document as parent node.
*/
DocumentSynopsis(const QDomDocument &document);
explicit DocumentSynopsis(const QDomDocument &document);
};
/**
......
......@@ -159,7 +159,7 @@ public:
protected:
/// @cond PRIVATE
FormField(FormFieldPrivate &dd);
explicit FormField(FormFieldPrivate &dd);
Q_DECLARE_PRIVATE(FormField)
FormFieldPrivate *d_ptr;
/// @endcond
......
......@@ -22,7 +22,7 @@ using namespace Okular;
class Movie::Private
{
public:
Private(const QString &url)
explicit Private(const QString &url)
: m_url(url)
, m_rotation(Rotation0)
, m_playMode(PlayLimited)
......
......@@ -14,7 +14,7 @@ using namespace Okular;
class PageTransition::Private
{
public:
Private(Type type)
explicit Private(Type type)
: m_type(type)
, m_duration(1)
, m_alignment(Horizontal)
......
......@@ -43,7 +43,7 @@ public:
*
* If no type is given, the normal @ref Replace transition is used.
*/
PageTransition(Type type = Replace);
explicit PageTransition(Type type = Replace);
/**
* Creates a new page transition from an @p other.
......
......@@ -14,7 +14,7 @@ using namespace Okular;
class Event::Private
{
public:
Private(EventType eventType)
explicit Private(EventType eventType)
: m_target(nullptr)
, m_targetPage(nullptr)
, m_source(nullptr)
......
......@@ -37,7 +37,7 @@ using namespace Okular;
class Okular::ExecutorKJSPrivate
{
public:
ExecutorKJSPrivate(DocumentPrivate *doc)
explicit ExecutorKJSPrivate(DocumentPrivate *doc)
: m_doc(doc)
{
initTypes();
......
......@@ -17,7 +17,7 @@ using namespace Okular;
class Okular::ScripterPrivate
{
public:
ScripterPrivate(DocumentPrivate *doc)
explicit ScripterPrivate(DocumentPrivate *doc)
: m_doc(doc)
#ifdef WITH_KJS
, m_kjs(nullptr)
......
......@@ -13,14 +13,14 @@ using namespace Okular;
class Sound::Private
{
public:
Private(const QByteArray &data)
explicit Private(const QByteArray &data)
: m_data(QVariant(data))
, m_type(Sound::Embedded)
{
init();
}
Private(const QString &url)
explicit Private(const QString &url)
: m_data(QVariant(url))
, m_type(Sound::External)
{
......
......@@ -93,7 +93,7 @@ protected:
/**
* Construct a new view with the specified @p name.
*/
View(const QString &name);
explicit View(const QString &name);
/// @cond PRIVATE
Q_DECLARE_PRIVATE(View)
......
......@@ -37,7 +37,6 @@ EBook_CHM::EBook_CHM()
m_textCodecForSpecialFiles = nullptr;
m_detectedLCID = 0;
m_currentEncoding = QStringLiteral("UTF-8");
m_htmlEntityDecoder = nullptr;
}
EBook_CHM::~EBook_CHM()
......
Supports Markdown
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