Commit f2338f40 authored by Simone Gaiarin's avatar Simone Gaiarin Committed by Albert Astals Cid
Browse files

Make connection unique for annotation visibility actions

This event is sent three times at startup and two times per tab at tab
change, so let's make sure we setup the connections only once.
parent 1a581c41
......@@ -715,8 +715,8 @@ void AnnotationActionHandler::setupAnnotationToolBarVisibilityAction()
Q_ASSERT(itToolBar != toolbars.end());
KToolBar *annotationToolBar = mw->toolBar(QStringLiteral("annotationToolBar"));
d->aShowToolBar->setChecked(annotationToolBar->isVisible());
connect(annotationToolBar, &QToolBar::visibilityChanged, d->aShowToolBar, &QAction::setChecked);
connect(d->aShowToolBar, &QAction::toggled, annotationToolBar, &KToolBar::setVisible);
connect(annotationToolBar, &QToolBar::visibilityChanged, d->aShowToolBar, &QAction::setChecked, Qt::UniqueConnection);
connect(d->aShowToolBar, &QAction::toggled, annotationToolBar, &KToolBar::setVisible, Qt::UniqueConnection);
connect(d->aShowToolBar, &QAction::toggled, this, [this](bool checked) { d->slotToolBarVisibilityChanged(checked); });
}
......
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