style:fix style warning

This commit is contained in:
Xiao YiFang 2022-12-01 19:55:00 +08:00 committed by xiaoyifang
parent 4e0219adea
commit e99431fa14
6 changed files with 7 additions and 8 deletions

View file

@ -35,8 +35,7 @@ class Writer
size_t scratchPadOffset, scratchPadSize; size_t scratchPadOffset, scratchPadSize;
public: public:
explicit Writer( File::Class & );
Writer( File::Class & );
/// Starts new block. Returns its address. /// Starts new block. Returns its address.
uint32_t startNewBlock(); uint32_t startNewBlock();

View file

@ -7,7 +7,7 @@
class WordListItemDelegate : public QStyledItemDelegate class WordListItemDelegate : public QStyledItemDelegate
{ {
public: public:
WordListItemDelegate( QAbstractItemDelegate * delegate ); explicit WordListItemDelegate( QAbstractItemDelegate * delegate );
virtual void paint( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const; virtual void paint( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const;
private: private:

View file

@ -71,7 +71,7 @@ struct ArticleDom
/// Does the parse at construction. Refer to the 'root' member variable /// Does the parse at construction. Refer to the 'root' member variable
/// afterwards. /// afterwards.
ArticleDom( wstring const &, string const & dictName = string(), explicit ArticleDom( wstring const &, string const & dictName = string(),
wstring const & headword_ = wstring() ); wstring const & headword_ = wstring() );
/// Root of DOM's tree /// Root of DOM's tree
@ -128,7 +128,7 @@ public:
DEF_EX( exUnknownCodePage, "The .dsl file specified an unknown code page", Ex ) DEF_EX( exUnknownCodePage, "The .dsl file specified an unknown code page", Ex )
DEF_EX( exEncodingError, "Encoding error", Ex ) // Should never happen really DEF_EX( exEncodingError, "Encoding error", Ex ) // Should never happen really
DslScanner( string const & fileName ) ; explicit DslScanner( string const & fileName ) ;
~DslScanner() noexcept; ~DslScanner() noexcept;
/// Returns the detected encoding of this file. /// Returns the detected encoding of this file.

2
ex.hh
View file

@ -30,7 +30,7 @@ virtual ~exName() noexcept {} };
class exName: public exParent { \ class exName: public exParent { \
std::string value; \ std::string value; \
public: \ 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 const char * what() const noexcept { return value.c_str(); } \
virtual ~exName() noexcept {} }; virtual ~exName() noexcept {} };

View file

@ -105,7 +105,7 @@ class TreeItem
public: public:
enum Type { Word, Folder, Root }; 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(); ~TreeItem();
void appendChild( TreeItem * child ); void appendChild( TreeItem * child );

View file

@ -47,7 +47,7 @@ public:
/// Loads history from its file. If load fails, the result would be an empty /// 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. 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. /// 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 /// If there was such an item already somewhere on the list, it gets removed