From 5d5432dbad4437fa6d07f83527475d5b398a2ec4 Mon Sep 17 00:00:00 2001 From: Boyuan Yang <073plan@gmail.com> Date: Sat, 7 Jul 2018 17:33:15 +0800 Subject: [PATCH] Fix typos found by codespell --- article-style.css | 4 ++-- article_maker.cc | 2 +- articleview.cc | 2 +- articlewebview.hh | 2 +- bgl.cc | 2 +- btreeidx.cc | 2 +- btreeidx.hh | 2 +- dictionary.hh | 6 +++--- dsl_details.hh | 2 +- folding.hh | 2 +- history.hh | 2 +- iconv.hh | 2 +- loaddictionaries.cc | 6 +++--- loaddictionaries.hh | 2 +- mainwindow.cc | 2 +- mouseover.cc | 2 +- nsis/GoldenDict-EnRuEn.nsi | 2 +- nsis/GoldenDict.nsi | 2 +- sources.cc | 2 +- sphelper.hh | 2 +- stardict.cc | 2 +- wordfinder.hh | 2 +- wstring.hh | 2 +- xdxf2html.cc | 2 +- zim.cc | 2 +- 25 files changed, 30 insertions(+), 30 deletions(-) diff --git a/article-style.css b/article-style.css index 3c8e4612..82e84460 100644 --- a/article-style.css +++ b/article-style.css @@ -409,7 +409,7 @@ div.xdxf padding-left: 81px; } -.dsl_p, .dsl_p :not(a) /* DSL Feature: Enforce the style even if the childen tags say otherwise, except links */ +.dsl_p, .dsl_p :not(a) /* DSL Feature: Enforce the style even if the children tags say otherwise, except links */ { color: green !important; /* DSL label color must have highest priority */ font-style: italic; @@ -453,7 +453,7 @@ div.xdxf .dsl_opt, .dsl_opt .dsl_ex, .dsl_opt .dsl_ex :not(a), -.dsl_opt .dsl_ex font[color] /* DSL Feature: Enforce the optional zone color even if the childen tags say otherwise */ +.dsl_opt .dsl_ex font[color] /* DSL Feature: Enforce the optional zone color even if the children tags say otherwise */ { color: gray; } diff --git a/article_maker.cc b/article_maker.cc index ddadffea..30b7b84c 100644 --- a/article_maker.cc +++ b/article_maker.cc @@ -771,7 +771,7 @@ void ArticleRequest::bodyFinished() { // No definitions were ever found, say so to the user. - // Larger words are usually whole sentences - don't clutter the ouput + // Larger words are usually whole sentences - don't clutter the output // with their full bodies. footer += ArticleMaker::makeNotFoundBody( word.size() < 40 ? word : "", group ); diff --git a/articleview.cc b/articleview.cc index 61a7782c..5cc29326 100644 --- a/articleview.cc +++ b/articleview.cc @@ -1822,7 +1822,7 @@ void ArticleView::contextMenuRequested( QPoint const & pos ) allDictionaries[ x ]->getIcon(), QString::fromUtf8( allDictionaries[ x ]->getName().c_str() ), &menu ); - // Force icons in menu on all platfroms, + // Force icons in menu on all platforms, // since without them it will be much harder // to find things. action->setIconVisibleInMenu( true ); diff --git a/articlewebview.hh b/articlewebview.hh index 9fa0a7e1..1c3c832b 100644 --- a/articlewebview.hh +++ b/articlewebview.hh @@ -13,7 +13,7 @@ class ArticleInspector; /// Currently the only added features: /// 1. Ability to know if the middle mouse button is pressed or not according /// to the view's current state. This is used to open links in new tabs when -/// they are clicked with middle button. There's also an added posibility to +/// they are clicked with middle button. There's also an added possibility to /// get double-click events after the fact with the doubleClicked() signal. /// 2. Manage our own QWebInspector instance. In order to show inspector correctly, /// use triggerPageAction( QWebPage::InspectElement ) instead. diff --git a/bgl.cc b/bgl.cc index cc7036e1..decda949 100644 --- a/bgl.cc +++ b/bgl.cc @@ -1098,7 +1098,7 @@ sptr< Dictionary::DataRequest > BglDictionary::getResource( string const & name idxHeader.resourcesCount, name ); } - /// Replaces 1234; occurences with ሴ + /// Replaces 1234; occurrences with ሴ void BglDictionary::replaceCharsetEntities( string & text ) { QString str = QString::fromUtf8( text.c_str() ); diff --git a/btreeidx.cc b/btreeidx.cc index 966de899..0ad8da39 100644 --- a/btreeidx.cc +++ b/btreeidx.cc @@ -797,7 +797,7 @@ char const * BtreeIndex::findChainOffsetExactOrPrefix( wstring const & target, if ( wcharBuffer.size() <= wordSize ) wcharBuffer.resize( wordSize + 1 ); - //DPRINTF( "checking agaist word %s, left = %u\n", ptr, leafEntries ); + //DPRINTF( "checking against word %s, left = %u\n", ptr, leafEntries ); long result = Utf8::decode( ptr, wordSize, &wcharBuffer.front() ); diff --git a/btreeidx.hh b/btreeidx.hh index ce56c655..fc123e32 100644 --- a/btreeidx.hh +++ b/btreeidx.hh @@ -99,7 +99,7 @@ public: QSet< QString > * headwords, QAtomicInt * isCancelled = 0 ); - /// Retrieve headwords for presented article adresses + /// Retrieve headwords for presented article addresses void getHeadwordsFromOffsets( QList< uint32_t > & offsets, QVector< QString > & headwords, QAtomicInt * isCancelled = 0 ); diff --git a/dictionary.hh b/dictionary.hh index 3cf81ab4..93f99258 100644 --- a/dictionary.hh +++ b/dictionary.hh @@ -206,7 +206,7 @@ protected: vector< char > data; }; -/// A helper class for syncronous word search implementations. +/// A helper class for synchronous word search implementations. class WordSearchRequestInstant: public WordSearchRequest { public: @@ -224,7 +224,7 @@ public: { uncertain = value; } }; -/// A helper class for syncronous data read implementations. +/// A helper class for synchronous data read implementations. class DataRequestInstant: public DataRequest { public: @@ -370,7 +370,7 @@ public: /// up alongside with it. Transliteration dictionaries implement this. The /// default implementation returns an empty list. Note that this function is /// supposed to be very fast and simple, and the results are thus returned - /// syncronously. + /// synchronously. virtual vector< wstring > getAlternateWritings( wstring const & ) throw(); diff --git a/dsl_details.hh b/dsl_details.hh index 7a3bc649..8a632c8d 100644 --- a/dsl_details.hh +++ b/dsl_details.hh @@ -96,7 +96,7 @@ private: void nextChar() THROW_SPEC( eot ); - /// Infomation for diagnostic purposes + /// Information for diagnostic purposes string dictionaryName; wstring headword; }; diff --git a/folding.hh b/folding.hh index 889858b8..381573f6 100644 --- a/folding.hh +++ b/folding.hh @@ -73,7 +73,7 @@ void normalizeWhitespace( wstring & ); /// Same as apply( wstring ), but without any heap operations, therefore /// preferable when there're many strings to process. Returns -1 if the -/// operation succeded, or otherwise the minimum value of outSize required +/// operation succeeded, or otherwise the minimum value of outSize required /// to succeed. /// Currently commented out, consider implementing it in case indices' /// generation would be too slow. diff --git a/history.hh b/history.hh index 564a620f..c81bec66 100644 --- a/history.hh +++ b/history.hh @@ -20,7 +20,7 @@ public: /// An item in history struct Item { - /// Group the search was perfomed in + /// Group the search was performed in unsigned groupId; /// The word that was searched QString word; diff --git a/iconv.hh b/iconv.hh index 02e3fb70..4edad0fd 100644 --- a/iconv.hh +++ b/iconv.hh @@ -20,7 +20,7 @@ public: DEF_EX_STR( exCantInit, "Can't initialize iconv conversion:", Ex ) DEF_EX( exIncorrectSeq, "Invalid character sequence encountered during character conversion", Ex ) DEF_EX( exPrematureEnd, "Character sequence ended prematurely during character conversion", Ex ) - DEF_EX_STR( exOther, "An error has occured during character conversion:", Ex ) + DEF_EX_STR( exOther, "An error has occurred during character conversion:", Ex ) // Some predefined character sets' names diff --git a/loaddictionaries.cc b/loaddictionaries.cc index 51c3398d..b37491ee 100644 --- a/loaddictionaries.cc +++ b/loaddictionaries.cc @@ -284,7 +284,7 @@ void loadDictionaries( QWidget * parent, bool showInitially, dictionaries = loadDicts.getDictionaries(); - ///// We create transliterations syncronously since they are very simple + ///// We create transliterations synchronously since they are very simple #ifdef MAKE_CHINESE_CONVERSION_SUPPORT // Make Chinese conversion @@ -325,7 +325,7 @@ void loadDictionaries( QWidget * parent, bool showInitially, dictionaries.insert( dictionaries.end(), dicts.begin(), dicts.end() ); } - ///// We create MediaWiki dicts syncronously, since they use netmgr + ///// We create MediaWiki dicts synchronously, since they use netmgr { vector< sptr< Dictionary::Class > > dicts = @@ -334,7 +334,7 @@ void loadDictionaries( QWidget * parent, bool showInitially, dictionaries.insert( dictionaries.end(), dicts.begin(), dicts.end() ); } - ///// WebSites are very simple, no need to create them asyncronously + ///// WebSites are very simple, no need to create them asynchronously { vector< sptr< Dictionary::Class > > dicts = WebSite::makeDictionaries( cfg.webSites, dictNetMgr ); diff --git a/loaddictionaries.hh b/loaddictionaries.hh index 1b332a5a..2c31f509 100644 --- a/loaddictionaries.hh +++ b/loaddictionaries.hh @@ -36,7 +36,7 @@ public: std::vector< sptr< Dictionary::Class > > const & getDictionaries() const { return dictionaries; } - /// Empty string means to exception occured + /// Empty string means to exception occurred std::string const & getExceptionText() const { return exceptionText; } diff --git a/mainwindow.cc b/mainwindow.cc index 849b0f50..da2370e4 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -3357,7 +3357,7 @@ static void filterAndCollectResources( QString & html, QRegExp & rx, const QStri if ( resourceIncluded.insert( hash.result() ).second ) { - // Gather resouce information (url, filename) to be download later + // Gather resource information (url, filename) to be download later downloadResources.push_back( pair( url, folder + host + resourcePath ) ); } diff --git a/mouseover.cc b/mouseover.cc index 83ff9b59..53c20f7d 100644 --- a/mouseover.cc +++ b/mouseover.cc @@ -113,7 +113,7 @@ ChangeWindowMessageFilterExFunc changeWindowMessageFilterExFunc = NULL; QDir::toNativeSeparators( QDir( QCoreApplication::applicationDirPath() ).filePath( "GdTextOutHook.dll" ) ).toWCharArray( GlobalData->LibName ); #endif - // Create the window to recive spying results to + // Create the window to receive spying results to WNDCLASSEX wcex; diff --git a/nsis/GoldenDict-EnRuEn.nsi b/nsis/GoldenDict-EnRuEn.nsi index 07875943..194a84fc 100644 --- a/nsis/GoldenDict-EnRuEn.nsi +++ b/nsis/GoldenDict-EnRuEn.nsi @@ -400,7 +400,7 @@ Section "Uninstall" StrCmp $2 "1" skip_cfg - MessageBox MB_YESNO "Delete all configuration data and index? This will save a lot of space, but at the expense of reconfiguring and reindexing everyting if GoldenDict is ever installed again." IDNO skip_cfg + MessageBox MB_YESNO "Delete all configuration data and index? This will save a lot of space, but at the expense of reconfiguring and reindexing everything if GoldenDict is ever installed again." IDNO skip_cfg RMDir /r $APPDATA\GoldenDict diff --git a/nsis/GoldenDict.nsi b/nsis/GoldenDict.nsi index 6afb1795..e19f211d 100644 --- a/nsis/GoldenDict.nsi +++ b/nsis/GoldenDict.nsi @@ -403,7 +403,7 @@ Section "Uninstall" StrCmp $2 "1" skip_cfg - MessageBox MB_YESNO "Delete all configuration data and index? This will save a lot of space, but at the expense of reconfiguring and reindexing everyting if GoldenDict is ever installed again." IDNO skip_cfg + MessageBox MB_YESNO "Delete all configuration data and index? This will save a lot of space, but at the expense of reconfiguring and reindexing everything if GoldenDict is ever installed again." IDNO skip_cfg RMDir /r $APPDATA\GoldenDict diff --git a/sources.cc b/sources.cc index e2422f9e..08b05b7f 100644 --- a/sources.cc +++ b/sources.cc @@ -36,7 +36,7 @@ Sources::Sources( QWidget * parent, Config::Class const & cfg): Config::Transliteration const & trs = cfg.transliteration; Config::Forvo const & forvo = cfg.forvo; - // TODO: will programTypeEditorCreator and itemEditorFactory be destoryed by + // TODO: will programTypeEditorCreator and itemEditorFactory be destroyed by // anyone? QItemEditorCreatorBase * programTypeEditorCreator = new QStandardItemEditorCreator< ProgramTypeEditor >(); diff --git a/sphelper.hh b/sphelper.hh index 75029d02..6543efb7 100644 --- a/sphelper.hh +++ b/sphelper.hh @@ -162,7 +162,7 @@ inline HRESULT SpGetDescription(ISpObjectToken * pObjToken, WCHAR ** ppszDescrip { LONG lErrorCode = ERROR_SUCCESS; - pRegKeyPath = wcschr(pszTemp, L'\\'); // Find the first occurance of '\\' in the absolute registry key path + pRegKeyPath = wcschr(pszTemp, L'\\'); // Find the first occurrence of '\\' in the absolute registry key path if(pRegKeyPath) { *pRegKeyPath = L'\0'; diff --git a/stardict.cc b/stardict.cc index 3e923cef..18632375 100644 --- a/stardict.cc +++ b/stardict.cc @@ -209,7 +209,7 @@ protected: private: - /// Retrives the article's offset/size in .dict file, and its headword. + /// Retrieves the article's offset/size in .dict file, and its headword. void getArticleProps( uint32_t articleAddress, string & headword, uint32_t & offset, uint32_t & size ); diff --git a/wordfinder.hh b/wordfinder.hh index 581dedb7..280a66ae 100644 --- a/wordfinder.hh +++ b/wordfinder.hh @@ -13,7 +13,7 @@ #include #include "dictionary.hh" -/// This component takes care of finding words. The search is asyncronous. +/// This component takes care of finding words. The search is asynchronous. /// This means the GUI doesn't get blocked during the sometimes lenghtly /// process of finding words. class WordFinder: public QObject diff --git a/wstring.hh b/wstring.hh index 3abfd22a..63492e2a 100644 --- a/wstring.hh +++ b/wstring.hh @@ -29,7 +29,7 @@ /// compatibility instead. It's stuck in the middle of nowhere, really. /// /// The question is, what are we going to do with all this? When we do Unicode -/// processing in GoldenDict, we want to use real Unicode charaters, not some +/// processing in GoldenDict, we want to use real Unicode characters, not some /// UTF-16 encoded ones. To that end, we have two options under Windows: first, /// use QString, and second, use basic_string< unsigned int >. /// While we use QStrings for the GUI and other non-critical code, there is a diff --git a/xdxf2html.cc b/xdxf2html.cc index e131730c..0ef58950 100644 --- a/xdxf2html.cc +++ b/xdxf2html.cc @@ -157,7 +157,7 @@ string convert( string const & in, DICT_TYPE type, map < string, string > const el.setAttribute( "class", "xdxf_ex_old" ); } - nodes = dd.elementsByTagName( "mrkd" ); // marked out words in tranlations/examples of usage + nodes = dd.elementsByTagName( "mrkd" ); // marked out words in translations/examples of usage while( nodes.size() ) { diff --git a/zim.cc b/zim.cc index a44a6aeb..c1e2a98a 100644 --- a/zim.cc +++ b/zim.cc @@ -831,7 +831,7 @@ string ZimDictionary::convert( const string & in ) } #endif - // Occassionally words needs to be displayed in vertical, but
were changed to somewhere + // Occasionally words needs to be displayed in vertical, but
were changed to somewhere // proper style: N
e
o
p
t
e
r
a
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) QRegularExpression rxBR( "(]*>)\\s*((\\w\\s*<br(\\\\|/|)>\\s*)+\\w)\\s*",