1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-13 12:31:52 +02:00

fix deleting controls

This commit is contained in:
Leo Franchi 2011-01-11 19:58:04 -05:00
parent ee78eb52dd
commit 5df5938ec1
3 changed files with 11 additions and 1 deletions

View File

@ -157,8 +157,11 @@ void DynamicControlList::removeControl()
DynamicControlWidget* w = qobject_cast<DynamicControlWidget*>( sender() );
m_layout->removeWidget( w );
m_controls.removeAll( w );
m_generator->removeControl( w->control() );
delete w;
m_controls.last()->setShowCollapseButton( true );
m_controls.last()->setShowPlusButton( true );
m_controls.last()->setShowMinusButton( false );

View File

@ -60,6 +60,12 @@ Tomahawk::GeneratorInterface::setControls( const QList< Tomahawk::dyncontrol_ptr
m_controls = controls;
}
void Tomahawk::GeneratorInterface::removeControl(const Tomahawk::dyncontrol_ptr& control)
{
m_controls.removeAll( control );
}
Tomahawk::dyncontrol_ptr
Tomahawk::GeneratorInterface::createControl(const QString& type)
{

View File

@ -75,7 +75,8 @@ public:
void addControl( const dyncontrol_ptr& control );
void clearControls();
void setControls( const QList< dyncontrol_ptr>& controls );
void removeControl( const dyncontrol_ptr& control );
signals:
void generated( const QList< Tomahawk::query_ptr>& queries );