test: Add build system support and a main function for unit tests
[quassel.git] / src / qtui / settingspages / dccsettingspage.cpp
index 70d792e..f84a81a 100644 (file)
 
 #include "client.h"
 #include "clienttransfermanager.h"
+#include "util.h"
 
 DccSettingsPage::DccSettingsPage(QWidget *parent)
     : SettingsPage(tr("IRC"), tr("DCC"), parent)
 {
     ui.setupUi(this);
     initAutoWidgets();
-    connect(ui.ipDetectionMode, SIGNAL(currentIndexChanged(int)), SLOT(updateWidgetStates()));
-    connect(ui.portSelectionMode, SIGNAL(currentIndexChanged(int)), SLOT(updateWidgetStates()));
+    connect(ui.ipDetectionMode, selectOverload<int>(&QComboBox::currentIndexChanged), this, &DccSettingsPage::updateWidgetStates);
+    connect(ui.portSelectionMode, selectOverload<int>(&QComboBox::currentIndexChanged), this, &DccSettingsPage::updateWidgetStates);
     updateWidgetStates();
 
-    connect(Client::instance(), SIGNAL(coreConnectionStateChanged(bool)), SLOT(onClientConfigChanged()));
+    connect(Client::instance(), &Client::coreConnectionStateChanged, this, &DccSettingsPage::onClientConfigChanged);
     setClientConfig(Client::dccConfig());
 }
 
@@ -56,7 +57,7 @@ void DccSettingsPage::setClientConfig(DccConfig *config)
     }
     _clientConfig = config;
     if (_clientConfig) {
-        connect(_clientConfig, SIGNAL(updated()), SLOT(load()));
+        connect(_clientConfig, &DccConfig::updated, this, &DccSettingsPage::load);
         load();
         ui.dccEnabled->setEnabled(true);
     }
@@ -69,7 +70,7 @@ void DccSettingsPage::setClientConfig(DccConfig *config)
 void DccSettingsPage::onClientConfigChanged()
 {
     if (Client::isConnected() && Client::dccConfig() && !Client::dccConfig()->isInitialized()) {
-        connect(Client::dccConfig(), SIGNAL(initDone()), SLOT(onClientConfigChanged()));
+        connect(Client::dccConfig(), &SyncableObject::initDone, this, &DccSettingsPage::onClientConfigChanged);
     }
     else {
         setClientConfig(Client::isConnected() ? Client::dccConfig() : nullptr);