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

Qt, selector: activate the SQL ML



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