mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-02 20:28:14 +02:00
fix deleting controls
This commit is contained in:
@@ -157,8 +157,11 @@ void DynamicControlList::removeControl()
|
|||||||
DynamicControlWidget* w = qobject_cast<DynamicControlWidget*>( sender() );
|
DynamicControlWidget* w = qobject_cast<DynamicControlWidget*>( sender() );
|
||||||
m_layout->removeWidget( w );
|
m_layout->removeWidget( w );
|
||||||
m_controls.removeAll( w );
|
m_controls.removeAll( w );
|
||||||
|
|
||||||
|
m_generator->removeControl( w->control() );
|
||||||
delete w;
|
delete w;
|
||||||
|
|
||||||
|
|
||||||
m_controls.last()->setShowCollapseButton( true );
|
m_controls.last()->setShowCollapseButton( true );
|
||||||
m_controls.last()->setShowPlusButton( true );
|
m_controls.last()->setShowPlusButton( true );
|
||||||
m_controls.last()->setShowMinusButton( false );
|
m_controls.last()->setShowMinusButton( false );
|
||||||
|
@@ -60,6 +60,12 @@ Tomahawk::GeneratorInterface::setControls( const QList< Tomahawk::dyncontrol_ptr
|
|||||||
m_controls = controls;
|
m_controls = controls;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Tomahawk::GeneratorInterface::removeControl(const Tomahawk::dyncontrol_ptr& control)
|
||||||
|
{
|
||||||
|
m_controls.removeAll( control );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Tomahawk::dyncontrol_ptr
|
Tomahawk::dyncontrol_ptr
|
||||||
Tomahawk::GeneratorInterface::createControl(const QString& type)
|
Tomahawk::GeneratorInterface::createControl(const QString& type)
|
||||||
{
|
{
|
||||||
|
@@ -75,6 +75,7 @@ public:
|
|||||||
void addControl( const dyncontrol_ptr& control );
|
void addControl( const dyncontrol_ptr& control );
|
||||||
void clearControls();
|
void clearControls();
|
||||||
void setControls( const QList< dyncontrol_ptr>& controls );
|
void setControls( const QList< dyncontrol_ptr>& controls );
|
||||||
|
void removeControl( const dyncontrol_ptr& control );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void generated( const QList< Tomahawk::query_ptr>& queries );
|
void generated( const QList< Tomahawk::query_ptr>& queries );
|
||||||
|
Reference in New Issue
Block a user