Commit df4889d9 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: reindent

parent 3834b98e
...@@ -454,45 +454,45 @@ void StandardPLPanel::browseInto( input_item_t *p_input ) ...@@ -454,45 +454,45 @@ void StandardPLPanel::browseInto( input_item_t *p_input )
LocationBar::LocationBar( PLModel *m ) LocationBar::LocationBar( PLModel *m )
{ {
model = m; model = m;
mapper = new QSignalMapper( this ); mapper = new QSignalMapper( this );
CONNECT( mapper, mapped( int ), this, invoke( int ) ); CONNECT( mapper, mapped( int ), this, invoke( int ) );
} }
void LocationBar::setIndex( const QModelIndex &index ) void LocationBar::setIndex( const QModelIndex &index )
{ {
clear(); clear();
QAction *prev = NULL; QAction *prev = NULL;
QModelIndex i = index; QModelIndex i = index;
QFont font; QFont font;
QFontMetrics metrics( font ); QFontMetrics metrics( font );
font.setBold( true ); font.setBold( true );
while( true ) while( true )
{ {
PLItem *item = model->getItem( i ); PLItem *item = model->getItem( i );
QToolButton *btn = new QToolButton; QToolButton *btn = new QToolButton;
char *fb_name = input_item_GetTitleFbName( item->inputItem() ); char *fb_name = input_item_GetTitleFbName( item->inputItem() );
QString text = qfu(fb_name); QString text = qfu(fb_name);
free(fb_name); free(fb_name);
text = QString("/ ") + metrics.elidedText( text, Qt::ElideRight, 150 ); text = QString("/ ") + metrics.elidedText( text, Qt::ElideRight, 150 );
btn->setText( text ); btn->setText( text );
btn->setFont( font ); btn->setFont( font );
prev = insertWidget( prev, btn ); prev = insertWidget( prev, btn );
mapper->setMapping( btn, item->id() ); mapper->setMapping( btn, item->id() );
CONNECT( btn, clicked( ), mapper, map( ) ); CONNECT( btn, clicked( ), mapper, map( ) );
font = QFont(); font = QFont();
if( i.isValid() ) i = i.parent(); if( i.isValid() ) i = i.parent();
else break; else break;
} }
} }
void LocationBar::invoke( int i_id ) void LocationBar::invoke( int i_id )
{ {
QModelIndex index = model->index( i_id, 0 ); QModelIndex index = model->index( i_id, 0 );
setIndex( index ); setIndex( index );
emit invoked ( index ); emit invoked ( index );
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment