From 690dd7a33ddc90678367d73adf313533536e10f2 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Fri, 29 Apr 2016 23:57:30 +0100 Subject: Apply clang-format --- src/modules/help/HelpIndex.h | 144 +++++++++++++++++++++++-------------------- 1 file changed, 76 insertions(+), 68 deletions(-) (limited to 'src/modules/help/HelpIndex.h') diff --git a/src/modules/help/HelpIndex.h b/src/modules/help/HelpIndex.h index effe15f8e..0a6b401f8 100644 --- a/src/modules/help/HelpIndex.h +++ b/src/modules/help/HelpIndex.h @@ -50,88 +50,96 @@ class QTimer; QT_BEGIN_NAMESPACE -struct Document { - Document( int d, int f ) : docNumber( d ), frequency( f ) {} - Document() : docNumber( -1 ), frequency( 0 ) {} - bool operator==( const Document &doc ) const { - return docNumber == doc.docNumber; - } - bool operator<( const Document &doc ) const { - return frequency > doc.frequency; - } - bool operator<=( const Document &doc ) const { - return frequency >= doc.frequency; - } - bool operator>( const Document &doc ) const { - return frequency < doc.frequency; - } - qint16 docNumber; - qint16 frequency; +struct Document +{ + Document(int d, int f) : docNumber(d), frequency(f) {} + Document() : docNumber(-1), frequency(0) {} + bool operator==(const Document & doc) const + { + return docNumber == doc.docNumber; + } + bool operator<(const Document & doc) const + { + return frequency > doc.frequency; + } + bool operator<=(const Document & doc) const + { + return frequency >= doc.frequency; + } + bool operator>(const Document & doc) const + { + return frequency < doc.frequency; + } + qint16 docNumber; + qint16 frequency; }; -QDataStream &operator>>( QDataStream &s, Document &l ); -QDataStream &operator<<( QDataStream &s, const Document &l ); +QDataStream & operator>>(QDataStream & s, Document & l); +QDataStream & operator<<(QDataStream & s, const Document & l); class HelpIndex : public QObject { - Q_OBJECT + Q_OBJECT public: - struct Entry { - Entry( int d ) { documents.append( Document( d, 1 ) ); } - Entry( QVector l ) : documents( l ) {} - QVector documents; - }; - struct PosEntry { - PosEntry( int p ) { positions.append( p ); } - QList positions; - }; + struct Entry + { + Entry(int d) { documents.append(Document(d, 1)); } + Entry(QVector l) : documents(l) {} + QVector documents; + }; + struct PosEntry + { + PosEntry(int p) { positions.append(p); } + QList positions; + }; - HelpIndex( const QString &dp, const QString &hp ); - HelpIndex( const QStringList &dl, const QString &hp ); - void writeDict(); - void readDict(); - void makeIndex(); - QStringList query( const QStringList&, const QStringList&, const QStringList& ); - QString getDocumentTitle( const QString& ); - void setDictionaryFile( const QString& ); - void setDocListFile( const QString& ); - void setDocList( const QStringList & ); + HelpIndex(const QString & dp, const QString & hp); + HelpIndex(const QStringList & dl, const QString & hp); + void writeDict(); + void readDict(); + void makeIndex(); + QStringList query(const QStringList &, const QStringList &, const QStringList &); + QString getDocumentTitle(const QString &); + void setDictionaryFile(const QString &); + void setDocListFile(const QString &); + void setDocList(const QStringList &); - const QStringList& documentList() { return docList; }; - const QStringList& titlesList() { return titleList; }; + const QStringList & documentList() { return docList; }; + const QStringList & titlesList() { return titleList; }; signals: - void indexingStart( int ); - void indexingProgress( int ); - void indexingEnd(); + void indexingStart(int); + void indexingProgress(int); + void indexingEnd(); private slots: - void setLastWinClosed(); + void setLastWinClosed(); void filterNext(); + private: - void setupDocumentList(); - void parseDocument( const QString&, int ); - void insertInDict( const QString&, int ); - void writeDocumentList(); - void readDocumentList(); - QStringList getWildcardTerms( const QString& ); - QStringList split( const QString& ); - QVector setupDummyTerm( const QStringList& ); - bool searchForPattern( const QStringList&, const QStringList&, const QString& ); - void buildMiniDict( const QString& ); - QString getCharsetForDocument(QFile *); - QStringList docList; - QStringList titleList; - QHash dict; - QHash miniDict; - uint wordNum; - QString docPath; - QString dictFile, docListFile; - bool alreadyHaveDocList; - bool lastWindowClosed; - QHash documentTitleCache; - QTimer * m_pTimer; - int m_iCurItem; + void setupDocumentList(); + void parseDocument(const QString &, int); + void insertInDict(const QString &, int); + void writeDocumentList(); + void readDocumentList(); + QStringList getWildcardTerms(const QString &); + QStringList split(const QString &); + QVector setupDummyTerm(const QStringList &); + bool searchForPattern(const QStringList &, const QStringList &, const QString &); + void buildMiniDict(const QString &); + QString getCharsetForDocument(QFile *); + QStringList docList; + QStringList titleList; + QHash dict; + QHash miniDict; + uint wordNum; + QString docPath; + QString dictFile, docListFile; + bool alreadyHaveDocList; + bool lastWindowClosed; + QHash documentTitleCache; + QTimer * m_pTimer; + int m_iCurItem; }; #endif -- cgit v1.3.1-10-gc9f91