Fix double-clicking behaviour of appletbrowser - don't emit double click event
if clicked on "favicon" or "remove" column reviewed by aseigo svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=785253
This commit is contained in:
parent
eb0bf064ab
commit
a2919ba41f
@ -44,8 +44,9 @@ KCategorizedItemsView::KCategorizedItemsView(QWidget * parent, Qt::WindowFlags f
|
||||
connect(comboFilters, SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(filterChanged(int)));
|
||||
|
||||
// we filter "activated" signals to re-emit them only when wanted
|
||||
connect (itemsView, SIGNAL(activated(const QModelIndex &)),
|
||||
this, SIGNAL(activated(const QModelIndex &)));
|
||||
this, SLOT(itemActivated(const QModelIndex &)));
|
||||
|
||||
connect (itemsView, SIGNAL(clicked(const QModelIndex &)),
|
||||
this, SIGNAL(clicked(const QModelIndex &)));
|
||||
@ -138,6 +139,18 @@ void KCategorizedItemsView::filterChanged(int index)
|
||||
}
|
||||
}
|
||||
|
||||
void KCategorizedItemsView::itemActivated( const QModelIndex& index )
|
||||
{
|
||||
// don't emit activated signal for "favicon" and "remove applet"
|
||||
// columns so double clicking on these columns won't unexpectedly
|
||||
// add an applet to the containment
|
||||
if ( index.column() == 1 || index.column() == 2 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
emit activated(index);
|
||||
}
|
||||
|
||||
void KCategorizedItemsView::updateColumnsWidth(bool force)
|
||||
{
|
||||
m_viewWidth = itemsView->viewport()->width();
|
||||
|
@ -68,6 +68,9 @@ protected slots:
|
||||
void searchTermChanged(const QString &text);
|
||||
void filterChanged(int index);
|
||||
|
||||
private slots:
|
||||
void itemActivated( const QModelIndex& index );
|
||||
|
||||
Q_SIGNALS:
|
||||
void activated ( const QModelIndex & index );
|
||||
void clicked ( const QModelIndex & index );
|
||||
|
Loading…
Reference in New Issue
Block a user