mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
Don't add the same phrase to history twice in a row
Each of the 3 removed history addition requests follows a call to ArticleView::showDefinition() with the same phrase/word as an argument. Each showDefinition() overload adds its phrase/word argument to history. These duplicate history additions weren't noticeable because History::addItem() searches for and removes its argument from items to avoid duplicate history entries. But the extra function calls, signal emissions, linear searches and QList manipulation wasted processor time.
This commit is contained in:
parent
60bc05218f
commit
99ddb7686e
|
@ -2792,10 +2792,6 @@ void MainWindow::showTranslationFor( Config::InputPhrase const & phrase,
|
|||
updatePronounceAvailability();
|
||||
updateFoundInDictsList();
|
||||
|
||||
// Add to history
|
||||
|
||||
addWordToHistory( phrase.phrase );
|
||||
|
||||
updateBackForwardButtons();
|
||||
|
||||
#if 0
|
||||
|
@ -2908,10 +2904,6 @@ void MainWindow::showTranslationFor( QString const & inWord,
|
|||
updatePronounceAvailability();
|
||||
updateFoundInDictsList();
|
||||
|
||||
// Add to history
|
||||
|
||||
addWordToHistory( inWord );
|
||||
|
||||
updateBackForwardButtons();
|
||||
}
|
||||
|
||||
|
|
|
@ -815,9 +815,6 @@ void ScanPopup::showTranslationFor( Config::InputPhrase const & inputPhrase )
|
|||
unsigned groupId = ui.groupList->getCurrentGroup();
|
||||
definition->showDefinition( inputPhrase, groupId );
|
||||
definition->focus();
|
||||
|
||||
// Add to history
|
||||
emit sendWordToHistory( inputPhrase.phrase.trimmed() );
|
||||
}
|
||||
|
||||
vector< sptr< Dictionary::Class > > const & ScanPopup::getActiveDicts()
|
||||
|
|
Loading…
Reference in a new issue