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

Qt, selector: activate the SQL ML

So at least, someone can test/fix it...
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 2e4f1776
...@@ -144,9 +144,9 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par ) ...@@ -144,9 +144,9 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
layout->setColumnStretch( 3, 3 ); layout->setColumnStretch( 3, 3 );
/* Connect the activation of the selector to a redefining of the PL */ /* Connect the activation of the selector to a redefining of the PL */
DCONNECT( selector, activated( playlist_item_t * ), DCONNECT( selector, activated( playlist_item_t *, bool ),
mainView, setRoot( playlist_item_t * ) ); mainView, setRoot( playlist_item_t *, bool ) );
mainView->setRoot( p_root ); mainView->setRoot( p_root, false );
/* */ /* */
split = new PlaylistSplitter( this ); split = new PlaylistSplitter( this );
......
...@@ -192,6 +192,9 @@ void PLSelector::createItems() ...@@ -192,6 +192,9 @@ void PLSelector::createItems()
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 ) );
/* SQL ML */
QTreeWidgetItem *sql_ml = addItem( SQL_ML, "SQL Media Library" )->treeItem();
/* SD nodes */ /* SD nodes */
QTreeWidgetItem *mycomp = addItem( CATEGORY_TYPE, N_("My Computer") )->treeItem(); QTreeWidgetItem *mycomp = addItem( CATEGORY_TYPE, N_("My Computer") )->treeItem();
QTreeWidgetItem *devices = addItem( CATEGORY_TYPE, N_("Devices") )->treeItem(); QTreeWidgetItem *devices = addItem( CATEGORY_TYPE, N_("Devices") )->treeItem();
...@@ -271,11 +274,18 @@ void PLSelector::setSource( QTreeWidgetItem *item ) ...@@ -271,11 +274,18 @@ void PLSelector::setSource( QTreeWidgetItem *item )
if( !sd_loaded ) if( !sd_loaded )
playlist_ServicesDiscoveryAdd( THEPL, qtu( qs ) ); playlist_ServicesDiscoveryAdd( THEPL, qtu( qs ) );
} }
else if( i_type == SQL_ML )
{
emit activated( NULL, true );
return;
}
/* */ /* */
playlist_Lock( THEPL ); playlist_Lock( THEPL );
playlist_item_t *pl_item = NULL; playlist_item_t *pl_item = NULL;
/* Special case for podcast */
// FIXME: simplify
if( i_type == SD_TYPE ) if( i_type == SD_TYPE )
{ {
/* Find the right item for the SD */ /* Find the right item for the SD */
...@@ -301,7 +311,7 @@ void PLSelector::setSource( QTreeWidgetItem *item ) ...@@ -301,7 +311,7 @@ void PLSelector::setSource( QTreeWidgetItem *item )
/* */ /* */
if( pl_item ) if( pl_item )
emit activated( pl_item ); emit activated( pl_item, false );
} }
PLSelItem * PLSelector::addItem ( PLSelItem * PLSelector::addItem (
......
...@@ -43,7 +43,8 @@ class QLabel; ...@@ -43,7 +43,8 @@ class QLabel;
enum SelectorItemType { enum SelectorItemType {
CATEGORY_TYPE, CATEGORY_TYPE,
SD_TYPE, SD_TYPE,
PL_ITEM_TYPE PL_ITEM_TYPE,
SQL_ML
}; };
enum SpecialData { enum SpecialData {
...@@ -144,7 +145,7 @@ private slots: ...@@ -144,7 +145,7 @@ private slots:
void podcastRemove( PLSelItem* ); void podcastRemove( PLSelItem* );
signals: signals:
void activated( playlist_item_t * ); void activated( playlist_item_t *, bool );
}; };
#endif #endif
...@@ -86,7 +86,7 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent, ...@@ -86,7 +86,7 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
this, handleExpansion( const QModelIndex& ) ); this, handleExpansion( const QModelIndex& ) );
CONNECT( model, rootChanged(), this, handleRootChange() ); CONNECT( model, rootChanged(), this, handleRootChange() );
setRoot( p_root ); setRoot( p_root, false );
} }
StandardPLPanel::~StandardPLPanel() StandardPLPanel::~StandardPLPanel()
...@@ -189,8 +189,11 @@ void StandardPLPanel::searchDelayed( const QString& searchText ) ...@@ -189,8 +189,11 @@ void StandardPLPanel::searchDelayed( const QString& searchText )
/* Set the root of the new Playlist */ /* Set the root of the new Playlist */
/* This activated by the selector selection */ /* This activated by the selector selection */
void StandardPLPanel::setRoot( playlist_item_t *p_item ) void StandardPLPanel::setRoot( playlist_item_t *p_item, bool b )
{ {
if( b ) //SQLML
return;
model->rebuild( p_item ); model->rebuild( p_item );
} }
......
...@@ -99,7 +99,7 @@ private: ...@@ -99,7 +99,7 @@ private:
bool eventFilter ( QObject * watched, QEvent * event ); bool eventFilter ( QObject * watched, QEvent * event );
public slots: public slots:
void setRoot( playlist_item_t * ); void setRoot( playlist_item_t *, bool );
void browseInto( const QModelIndex& ); void browseInto( const QModelIndex& );
private slots: private slots:
......
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