Commit 00d28ccb authored by Laurent Montel's avatar Laurent Montel
Browse files

Fix update preview when we change selected item

parent a260926b
Pipeline #218934 canceled with stage
in 13 minutes and 34 seconds
......@@ -15,7 +15,7 @@ ResultDuplicateTreeWidget::ResultDuplicateTreeWidget(QWidget *parent)
: QTreeWidget(parent)
{
setHeaderLabel(i18n("Contacts"));
connect(this, &QTreeWidget::itemActivated, this, &ResultDuplicateTreeWidget::slotItemActivated);
connect(this, &QTreeWidget::itemSelectionChanged, this, &ResultDuplicateTreeWidget::slotItemSelectionChanged);
connect(this, &ResultDuplicateTreeWidget::itemChanged, this, &ResultDuplicateTreeWidget::slotItemChanged);
}
......@@ -60,10 +60,9 @@ void ResultDuplicateTreeWidget::changeState(QTreeWidgetItem *item, bool b)
blockSignals(false);
}
void ResultDuplicateTreeWidget::slotItemActivated(QTreeWidgetItem *item, int column)
void ResultDuplicateTreeWidget::slotItemSelectionChanged()
{
Q_UNUSED(column)
auto resultItem = dynamic_cast<ResultDuplicateTreeWidgetItem *>(item);
auto resultItem = dynamic_cast<ResultDuplicateTreeWidgetItem *>(currentItem());
if (resultItem) {
Q_EMIT showContactPreview(resultItem->item());
}
......
......@@ -44,7 +44,7 @@ Q_SIGNALS:
void showContactPreview(const Akonadi::Item &item);
private:
void slotItemActivated(QTreeWidgetItem *item, int column);
void slotItemSelectionChanged();
void slotItemChanged(QTreeWidgetItem *item, int column);
void changeState(QTreeWidgetItem *item, bool b);
};
......
Supports Markdown
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