modernize: Use auto where the type is clear from context
[quassel.git] / src / qtui / settingspages / networkssettingspage.cpp
index 478acd1..b8b8474 100644 (file)
@@ -21,6 +21,7 @@
 #include <QHeaderView>
 #include <QMessageBox>
 #include <QTextCodec>
+#include <utility>
 
 #include "networkssettingspage.h"
 
@@ -39,9 +40,6 @@
 
 NetworksSettingsPage::NetworksSettingsPage(QWidget *parent)
     : SettingsPage(tr("IRC"), tr("Networks"), parent)
-#ifdef HAVE_SSL
-      , _cid(nullptr)
-#endif
 {
     ui.setupUi(this);
 
@@ -434,7 +432,7 @@ void NetworksSettingsPage::clientIdentityAdded(IdentityId id)
 
 void NetworksSettingsPage::clientIdentityUpdated()
 {
-    const Identity *identity = qobject_cast<const Identity *>(sender());
+    const auto *identity = qobject_cast<const Identity *>(sender());
     if (!identity) {
         qWarning() << "NetworksSettingsPage: Invalid identity to update!";
         return;
@@ -495,7 +493,7 @@ void NetworksSettingsPage::clientNetworkAdded(NetworkId id)
 
 void NetworksSettingsPage::clientNetworkUpdated()
 {
-    const Network *net = qobject_cast<const Network *>(sender());
+    const auto *net = qobject_cast<const Network *>(sender());
     if (!net) {
         qWarning() << "Update request for unknown network received!";
         return;
@@ -526,7 +524,7 @@ void NetworksSettingsPage::clientNetworkRemoved(NetworkId id)
 void NetworksSettingsPage::networkConnectionStateChanged(Network::ConnectionState state)
 {
     Q_UNUSED(state);
-    const Network *net = qobject_cast<const Network *>(sender());
+    const auto *net = qobject_cast<const Network *>(sender());
     if (!net) return;
     /*
     if(net->networkId() == currentId) {
@@ -709,7 +707,7 @@ void NetworksSettingsPage::saveToNetworkInfo(NetworkInfo &info)
 void NetworksSettingsPage::clientNetworkCapsUpdated()
 {
     // Grab the updated network
-    const Network *net = qobject_cast<const Network *>(sender());
+    const auto *net = qobject_cast<const Network *>(sender());
     if (!net) {
         qWarning() << "Update request for unknown network received!";
         return;
@@ -1029,7 +1027,7 @@ IdentityId NetworksSettingsPage::defaultIdentity() const
 * NetworkAddDlg
 *************************************************************************/
 
-NetworkAddDlg::NetworkAddDlg(const QStringList &exist, QWidget *parent) : QDialog(parent), existing(exist)
+NetworkAddDlg::NetworkAddDlg(QStringList exist, QWidget *parent) : QDialog(parent), existing(std::move(exist))
 {
     ui.setupUi(this);
     ui.useSSL->setIcon(icon::get("document-encrypt"));
@@ -1121,7 +1119,7 @@ void NetworkAddDlg::updateSslPort(bool isChecked)
  * NetworkEditDlg
  *************************************************************************/
 
-NetworkEditDlg::NetworkEditDlg(const QString &old, const QStringList &exist, QWidget *parent) : QDialog(parent), existing(exist)
+NetworkEditDlg::NetworkEditDlg(const QString &old, QStringList exist, QWidget *parent) : QDialog(parent), existing(std::move(exist))
 {
     ui.setupUi(this);