modernize: Migrate action-related things to PMF connects
[quassel.git] / src / qtui / chatviewsearchbar.cpp
index a8d4680..d7e0cfc 100644 (file)
@@ -41,15 +41,16 @@ ChatViewSearchBar::ChatViewSearchBar(QWidget *parent)
     ActionCollection *coll = QtUi::actionCollection("General");
 
     QAction *toggleSearchBar = coll->action("ToggleSearchBar");
-    connect(toggleSearchBar, SIGNAL(toggled(bool)), SLOT(setVisible(bool)));
+    connect(toggleSearchBar, &QAction::toggled, this, &QWidget::setVisible);
 
-    auto *hideSearchBar = coll->add<Action>("HideSearchBar", toggleSearchBar, SLOT(setChecked(bool)));
-    hideSearchBar->setShortcutConfigurable(false);
+    auto *hideSearchBar = new Action{{}, this, toggleSearchBar, &QAction::setChecked};
     hideSearchBar->setShortcut(Qt::Key_Escape);
+    hideSearchBar->setShortcutConfigurable(false);
+    coll->addAction("HideSearchBar", hideSearchBar);
 
-    connect(ui.hideButton, SIGNAL(clicked()), toggleSearchBar, SLOT(toggle()));
-    connect(ui.searchEditLine, SIGNAL(textChanged(const QString &)), this, SLOT(delaySearch()));
-    connect(&_searchDelayTimer, SIGNAL(timeout()), this, SLOT(search()));
+    connect(ui.hideButton, &QAbstractButton::clicked, toggleSearchBar, &QAction::toggle);
+    connect(ui.searchEditLine, &QLineEdit::textChanged, this, &ChatViewSearchBar::delaySearch);
+    connect(&_searchDelayTimer, &QTimer::timeout, this, &ChatViewSearchBar::search);
 }