Commit c26046b0 authored by Christophe Mutricy's avatar Christophe Mutricy

i18n: Factorise qtr() and fix nodes i18n

(cherry picked from commit b5617204caa9c886924025f5467e25798d432393)
Signed-off-by: default avatarChristophe Mutricy <xtophe@videolan.org>
parent 80cce507
...@@ -211,12 +211,12 @@ void PLSelector::setSource( QTreeWidgetItem *item ) ...@@ -211,12 +211,12 @@ void PLSelector::setSource( QTreeWidgetItem *item )
} }
PLSelItem * PLSelector::addItem ( PLSelItem * PLSelector::addItem (
SelectorItemType type, const QString& str, bool drop, SelectorItemType type, const char* str, bool drop,
QTreeWidgetItem* parentItem ) QTreeWidgetItem* parentItem )
{ {
QTreeWidgetItem *item = parentItem ? QTreeWidgetItem *item = parentItem ?
new QTreeWidgetItem( parentItem ) : new QTreeWidgetItem( this ); new QTreeWidgetItem( parentItem ) : new QTreeWidgetItem( this );
PLSelItem *selItem = new PLSelItem( item, str ); PLSelItem *selItem = new PLSelItem( item, qtr( str ) );
setItemWidget( item, 0, selItem ); setItemWidget( item, 0, selItem );
item->setData( 0, TYPE_ROLE, (int)type ); item->setData( 0, TYPE_ROLE, (int)type );
if( !drop ) item->setFlags( item->flags() & ~Qt::ItemIsDropEnabled ); if( !drop ) item->setFlags( item->flags() & ~Qt::ItemIsDropEnabled );
...@@ -244,7 +244,7 @@ PLSelItem *PLSelector::addPodcastItem( playlist_item_t *p_item ) ...@@ -244,7 +244,7 @@ PLSelItem *PLSelector::addPodcastItem( playlist_item_t *p_item )
vlc_gc_incref( p_item->p_input ); vlc_gc_incref( p_item->p_input );
char *psz_name = input_item_GetName( p_item->p_input ); char *psz_name = input_item_GetName( p_item->p_input );
PLSelItem *item = addItem( PLSelItem *item = addItem(
PL_ITEM_TYPE, qfu( psz_name ), false, podcastsParent ); PL_ITEM_TYPE, psz_name, false, podcastsParent );
item->addAction( RM_ACTION, qtr( "Remove this podcast subscription" ) ); item->addAction( RM_ACTION, qtr( "Remove this podcast subscription" ) );
item->treeItem()->setData( 0, PL_ITEM_ROLE, QVariant::fromValue( p_item ) ); item->treeItem()->setData( 0, PL_ITEM_ROLE, QVariant::fromValue( p_item ) );
item->treeItem()->setData( 0, PL_ITEM_ID_ROLE, QVariant(p_item->i_id) ); item->treeItem()->setData( 0, PL_ITEM_ID_ROLE, QVariant(p_item->i_id) );
...@@ -256,21 +256,21 @@ PLSelItem *PLSelector::addPodcastItem( playlist_item_t *p_item ) ...@@ -256,21 +256,21 @@ PLSelItem *PLSelector::addPodcastItem( playlist_item_t *p_item )
void PLSelector::createItems() void PLSelector::createItems()
{ {
PLSelItem *pl = putPLData( addItem( PL_ITEM_TYPE, qtr( "Playlist" ), true ), PLSelItem *pl = putPLData( addItem( PL_ITEM_TYPE, "Playlist", true ),
THEPL->p_playing ); THEPL->p_playing );
pl->treeItem()->setData( 0, SPECIAL_ROLE, QVariant( IS_PL ) ); pl->treeItem()->setData( 0, SPECIAL_ROLE, QVariant( IS_PL ) );
PLSelItem *ml = putPLData( addItem( PL_ITEM_TYPE, qtr( "Media Library" ), true ), PLSelItem *ml = putPLData( addItem( PL_ITEM_TYPE, "Media Library", true ),
THEPL->p_media_library ); THEPL->p_media_library );
ml->treeItem()->setData( 0, SPECIAL_ROLE, QVariant( IS_ML ) ); ml->treeItem()->setData( 0, SPECIAL_ROLE, QVariant( IS_ML ) );
QTreeWidgetItem *mycomp = addItem( CATEGORY_TYPE, qtr( "My Computer" ), QTreeWidgetItem *mycomp = addItem( CATEGORY_TYPE, "My Computer",
false )->treeItem(); false )->treeItem();
QTreeWidgetItem *devices = addItem( CATEGORY_TYPE, qtr( "Devices" ), QTreeWidgetItem *devices = addItem( CATEGORY_TYPE, "Devices",
false )->treeItem(); false )->treeItem();
QTreeWidgetItem *lan = addItem( CATEGORY_TYPE, qtr( "Local Network" ), QTreeWidgetItem *lan = addItem( CATEGORY_TYPE, "Local Network",
false )->treeItem(); false )->treeItem();
QTreeWidgetItem *internet = addItem( CATEGORY_TYPE, qtr( "Internet" ), QTreeWidgetItem *internet = addItem( CATEGORY_TYPE, "Internet",
false )->treeItem();; false )->treeItem();;
char **ppsz_longnames; char **ppsz_longnames;
...@@ -314,7 +314,7 @@ void PLSelector::createItems() ...@@ -314,7 +314,7 @@ void PLSelector::createItems()
} }
else else
{ {
putSDData( addItem( SD_TYPE, qtr( *ppsz_longname ), false ), putSDData( addItem( SD_TYPE, *ppsz_longname, false ),
*ppsz_name, *ppsz_longname ); *ppsz_name, *ppsz_longname );
} }
......
...@@ -123,7 +123,7 @@ private: ...@@ -123,7 +123,7 @@ private:
void createItems(); void createItems();
void drawBranches ( QPainter *, const QRect &, const QModelIndex & ) const; void drawBranches ( QPainter *, const QRect &, const QModelIndex & ) const;
PLSelItem * addItem ( PLSelItem * addItem (
SelectorItemType type, const QString& str, bool drop, SelectorItemType type, const char* str, bool drop,
QTreeWidgetItem* parentItem = 0 ); QTreeWidgetItem* parentItem = 0 );
PLSelItem * addPodcastItem( playlist_item_t *p_item ); PLSelItem * addPodcastItem( playlist_item_t *p_item );
inline PLSelItem * itemWidget( QTreeWidgetItem * ); inline PLSelItem * itemWidget( QTreeWidgetItem * );
......
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