[vlc-commits] Qt: messages: simplify
Francois Cartegnie
git at videolan.org
Tue Mar 15 21:36:47 CET 2011
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Mar 15 21:17:24 2011 +0100| [b4a5e139307f4739093d200e03da9c7489f2a4f0] | committer: Francois Cartegnie
Qt: messages: simplify
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b4a5e139307f4739093d200e03da9c7489f2a4f0
---
modules/gui/qt4/dialogs/messages.cpp | 19 ++++++++-----------
1 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/modules/gui/qt4/dialogs/messages.cpp b/modules/gui/qt4/dialogs/messages.cpp
index 029cee5..08d9ce6 100644
--- a/modules/gui/qt4/dialogs/messages.cpp
+++ b/modules/gui/qt4/dialogs/messages.cpp
@@ -257,17 +257,14 @@ void MessagesDialog::buildTree( QTreeWidgetItem *parentItem,
item = new QTreeWidgetItem( ui.modulesTree );
char *name = vlc_object_get_name( p_obj );
- if( name != NULL )
- {
- item->setText( 0, qfu( p_obj->psz_object_type ) + " \"" +
- qfu( name ) + "\" (" +
- QString::number((uintptr_t)p_obj) + ")" );
- free( name );
- }
- else
- item->setText( 0, qfu( p_obj->psz_object_type ) + " (" +
- QString::number((uintptr_t)p_obj) + ")" );
-
+ item->setText( 0, QString("%1 \"%2\" (%3)")
+ .arg( qfu( p_obj->psz_object_type ) )
+ .arg( ( name != NULL )
+ ? QString( " \"%1\"" ).arg( qfu( name ) )
+ : "" )
+ .arg( QString::number((uintptr_t)p_obj) )
+ );
+ free( name );
item->setExpanded( true );
vlc_list_t *l = vlc_list_children( p_obj );
More information about the vlc-commits
mailing list