Commit 60009ebc authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

qt4: addons tab: Fix leaks

parent 73908fcf
...@@ -351,7 +351,7 @@ AddonsTab::AddonsTab( intf_thread_t *p_intf_ ) : QVLCFrame( p_intf_ ) ...@@ -351,7 +351,7 @@ AddonsTab::AddonsTab( intf_thread_t *p_intf_ ) : QVLCFrame( p_intf_ )
leftPane->layout()->addItem( new QSpacerItem( 0, 10 ) ); leftPane->layout()->addItem( new QSpacerItem( 0, 10 ) );
QToolButton * button; QToolButton * button;
QSignalMapper *mapper = new QSignalMapper(); signalMapper = new QSignalMapper();
QImage icon( ":/addons/default" ); QImage icon( ":/addons/default" );
QColor vlcorange( 0xEC, 0x83, 0x00 ); QColor vlcorange( 0xEC, 0x83, 0x00 );
#define ADD_CATEGORY( label, ltooltip, numb ) \ #define ADD_CATEGORY( label, ltooltip, numb ) \
...@@ -368,8 +368,8 @@ AddonsTab::AddonsTab( intf_thread_t *p_intf_ ) : QVLCFrame( p_intf_ ) ...@@ -368,8 +368,8 @@ AddonsTab::AddonsTab( intf_thread_t *p_intf_ ) : QVLCFrame( p_intf_ )
button->setCheckable( true );\ button->setCheckable( true );\
if ( numb == -1 ) button->setChecked( true );\ if ( numb == -1 ) button->setChecked( true );\
button->setAutoExclusive( true );\ button->setAutoExclusive( true );\
CONNECT( button, clicked(), mapper, map() );\ CONNECT( button, clicked(), signalMapper, map() );\
mapper->setMapping( button, numb );\ signalMapper->setMapping( button, numb );\
leftPane->layout()->addWidget( button ); leftPane->layout()->addWidget( button );
ADD_CATEGORY( qtr("All"), qtr("Interface Settings"), ADD_CATEGORY( qtr("All"), qtr("Interface Settings"),
...@@ -454,7 +454,7 @@ AddonsTab::AddonsTab( intf_thread_t *p_intf_ ) : QVLCFrame( p_intf_ ) ...@@ -454,7 +454,7 @@ AddonsTab::AddonsTab( intf_thread_t *p_intf_ ) : QVLCFrame( p_intf_ )
// Model // Model
AddonsListModel *model = new AddonsListModel( AM, addonsView ); AddonsListModel *model = new AddonsListModel( AM, addonsView );
addonsModel = new AddonsSortFilterProxyModel(); addonsModel = new AddonsSortFilterProxyModel( addonsView );
addonsModel->setDynamicSortFilter( true ); addonsModel->setDynamicSortFilter( true );
addonsModel->setFilterCaseSensitivity( Qt::CaseInsensitive ); addonsModel->setFilterCaseSensitivity( Qt::CaseInsensitive );
addonsModel->setSortRole( Qt::DisplayRole ); addonsModel->setSortRole( Qt::DisplayRole );
...@@ -463,7 +463,7 @@ AddonsTab::AddonsTab( intf_thread_t *p_intf_ ) : QVLCFrame( p_intf_ ) ...@@ -463,7 +463,7 @@ AddonsTab::AddonsTab( intf_thread_t *p_intf_ ) : QVLCFrame( p_intf_ )
addonsModel->setFilterRole( Qt::DisplayRole ); addonsModel->setFilterRole( Qt::DisplayRole );
addonsView->setModel( addonsModel ); addonsView->setModel( addonsModel );
CONNECT( mapper, mapped(int), addonsModel, setTypeFilter(int) ); CONNECT( signalMapper, mapped(int), addonsModel, setTypeFilter(int) );
CONNECT( searchInput, textChanged( const QString &), CONNECT( searchInput, textChanged( const QString &),
addonsModel, setFilterFixedString( QString ) ); addonsModel, setFilterFixedString( QString ) );
...@@ -490,6 +490,7 @@ AddonsTab::AddonsTab( intf_thread_t *p_intf_ ) : QVLCFrame( p_intf_ ) ...@@ -490,6 +490,7 @@ AddonsTab::AddonsTab( intf_thread_t *p_intf_ ) : QVLCFrame( p_intf_ )
AddonsTab::~AddonsTab() AddonsTab::~AddonsTab()
{ {
delete spinnerAnimation; delete spinnerAnimation;
delete signalMapper;
} }
// Do not close on ESC or ENTER // Do not close on ESC or ENTER
......
...@@ -42,6 +42,7 @@ class QTabWidget; ...@@ -42,6 +42,7 @@ class QTabWidget;
class QComboBox; class QComboBox;
class QTreeWidget; class QTreeWidget;
class QLineEdit; class QLineEdit;
class QSignalMapper;
//class QTextBrowser; //class QTextBrowser;
class QListView; class QListView;
class QStyleOptionViewItem; class QStyleOptionViewItem;
...@@ -153,6 +154,7 @@ private: ...@@ -153,6 +154,7 @@ private:
/* Wait spinner */ /* Wait spinner */
PixmapAnimator *spinnerAnimation; PixmapAnimator *spinnerAnimation;
bool b_localdone; bool b_localdone;
QSignalMapper *signalMapper;
}; };
class PluginTreeItem : public QTreeWidgetItem class PluginTreeItem : public 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