From e99431fa149b9916e58adb47fc6a132773e7748d Mon Sep 17 00:00:00 2001 From: Xiao YiFang Date: Thu, 1 Dec 2022 19:55:00 +0800 Subject: [PATCH] style:fix style warning --- chunkedstorage.hh | 3 +-- delegate.hh | 2 +- dsl_details.hh | 4 ++-- ex.hh | 2 +- favoritespanewidget.hh | 2 +- history.hh | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/chunkedstorage.hh b/chunkedstorage.hh index 4132e30b..22864695 100644 --- a/chunkedstorage.hh +++ b/chunkedstorage.hh @@ -35,8 +35,7 @@ class Writer size_t scratchPadOffset, scratchPadSize; public: - - Writer( File::Class & ); + explicit Writer( File::Class & ); /// Starts new block. Returns its address. uint32_t startNewBlock(); diff --git a/delegate.hh b/delegate.hh index 28331096..080bdfbb 100644 --- a/delegate.hh +++ b/delegate.hh @@ -7,7 +7,7 @@ class WordListItemDelegate : public QStyledItemDelegate { public: - WordListItemDelegate( QAbstractItemDelegate * delegate ); + explicit WordListItemDelegate( QAbstractItemDelegate * delegate ); virtual void paint( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const; private: diff --git a/dsl_details.hh b/dsl_details.hh index 34eea56d..bbd56c1f 100644 --- a/dsl_details.hh +++ b/dsl_details.hh @@ -71,7 +71,7 @@ struct ArticleDom /// Does the parse at construction. Refer to the 'root' member variable /// afterwards. - ArticleDom( wstring const &, string const & dictName = string(), + explicit ArticleDom( wstring const &, string const & dictName = string(), wstring const & headword_ = wstring() ); /// Root of DOM's tree @@ -128,7 +128,7 @@ public: DEF_EX( exUnknownCodePage, "The .dsl file specified an unknown code page", Ex ) DEF_EX( exEncodingError, "Encoding error", Ex ) // Should never happen really - DslScanner( string const & fileName ) ; + explicit DslScanner( string const & fileName ) ; ~DslScanner() noexcept; /// Returns the detected encoding of this file. diff --git a/ex.hh b/ex.hh index 13dd5fff..59e00306 100644 --- a/ex.hh +++ b/ex.hh @@ -30,7 +30,7 @@ virtual ~exName() noexcept {} }; class exName: public exParent { \ std::string value; \ public: \ - exName( std::string const & value_ ): value( std::string( exDescription ) + " " + value_ ) {} \ + explicit exName( std::string const & value_ ): value( std::string( exDescription ) + " " + value_ ) {} \ virtual const char * what() const noexcept { return value.c_str(); } \ virtual ~exName() noexcept {} }; diff --git a/favoritespanewidget.hh b/favoritespanewidget.hh index a0dae00a..d9848767 100644 --- a/favoritespanewidget.hh +++ b/favoritespanewidget.hh @@ -105,7 +105,7 @@ class TreeItem public: enum Type { Word, Folder, Root }; - TreeItem( const QVariant &data, TreeItem *parent = 0, Type type_ = Word ); + explicit TreeItem( const QVariant &data, TreeItem *parent = 0, Type type_ = Word ); ~TreeItem(); void appendChild( TreeItem * child ); diff --git a/history.hh b/history.hh index c81bec66..1fc143c7 100644 --- a/history.hh +++ b/history.hh @@ -47,7 +47,7 @@ public: /// Loads history from its file. If load fails, the result would be an empty /// history. The size parameter is same as in other constructor. - History( Load, unsigned size = 20, unsigned maxItemLength = DEFAULT_MAX_HISTORY_ITEM_LENGTH ); + explicit History( Load, unsigned size = 20, unsigned maxItemLength = DEFAULT_MAX_HISTORY_ITEM_LENGTH ); /// Adds new item. The item is always added at the beginning of the list. /// If there was such an item already somewhere on the list, it gets removed