remove useless code

This commit is contained in:
Xiao YiFang 2022-08-10 22:13:19 +08:00
parent a20406dc39
commit 39a7c85303
2 changed files with 1 additions and 12 deletions

View file

@ -17,7 +17,6 @@ DictionaryBar::DictionaryBar( QWidget * parent,
configEvents( events ), configEvents( events ),
editDictionaryCommand( _editDictionaryCommand ), editDictionaryCommand( _editDictionaryCommand ),
maxDictionaryRefsInContextMenu(maxDictionaryRefsInContextMenu_), maxDictionaryRefsInContextMenu(maxDictionaryRefsInContextMenu_),
use14x21( false ),
timerId( 0 ) timerId( 0 )
{ {
setObjectName( "dictionaryBar" ); setObjectName( "dictionaryBar" );
@ -58,8 +57,6 @@ void DictionaryBar::setDictionaries( vector< sptr< Dictionary::Class > >
clear(); clear();
dictActions.clear(); dictActions.clear();
use14x21 = false;
for( unsigned x = 0; x < dictionaries.size(); ++x ) for( unsigned x = 0; x < dictionaries.size(); ++x )
{ {
QIcon icon = dictionaries[ x ]->getNativeIcon(); QIcon icon = dictionaries[ x ]->getNativeIcon();
@ -79,13 +76,6 @@ void DictionaryBar::setDictionaries( vector< sptr< Dictionary::Class > >
action->setChecked( mutedDictionaries ? !mutedDictionaries->contains( id ) : true ); action->setChecked( mutedDictionaries ? !mutedDictionaries->contains( id ) : true );
QList< QSize > sizes = icon.availableSizes();
// for( QList< QSize >::iterator i = sizes.begin(); i != sizes.end();
// ++i )
// if ( i->width() == 14 && i->height() == 21 )
// use14x21 = true;
dictActions.append( action ); dictActions.append( action );
} }
@ -96,7 +86,7 @@ void DictionaryBar::setDictionaries( vector< sptr< Dictionary::Class > >
void DictionaryBar::setDictionaryIconSize( int extent ) void DictionaryBar::setDictionaryIconSize( int extent )
{ {
setIconSize( QSize( use14x21 ? extent*2/3 : extent, extent ) ); setIconSize( QSize( extent, extent ) );
} }
void DictionaryBar::contextMenuEvent( QContextMenuEvent * event ) void DictionaryBar::contextMenuEvent( QContextMenuEvent * event )

View file

@ -61,7 +61,6 @@ private:
QList< QAction * > dictActions; QList< QAction * > dictActions;
QAction * maxDictionaryRefsAction; QAction * maxDictionaryRefsAction;
bool use14x21;
int timerId; int timerId;
virtual bool eventFilter( QObject *, QEvent * ); virtual bool eventFilter( QObject *, QEvent * );