Don't attempt to translate the same word in scanpopup that is shown there already.

This fixes repeated scanpopup triggerings under Windows.
This commit is contained in:
Konstantin Isakov 2010-12-03 23:10:18 +03:00
parent 21850685e1
commit 414e0336e6

View file

@ -235,7 +235,16 @@ void ScanPopup::mouseHovered( QString const & str )
void ScanPopup::handleInputWord( QString const & str )
{
pendingInputWord = gd::toQString( Folding::trimWhitespaceOrPunct( gd::toWString( str ) ) );
QString sanitizedStr = gd::toQString( Folding::trimWhitespaceOrPunct( gd::toWString( str ) ) );
if ( isVisible() && sanitizedStr == inputWord )
{
// Attempt to translate the same word we already have shown in scan popup.
// Ignore it, as it is probably a spurious mouseover event.
return;
}
pendingInputWord = sanitizedStr;
if ( !pendingInputWord.size() )
{