X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fsimplenetworkeditor.cpp;h=cdff48af102b1c382861b839521a8366851c0291;hp=00aef3d443742ef445587bfdcc13ff131b4b5481;hb=HEAD;hpb=b7447afe8e836376776dac26704e227a678d2913 diff --git a/src/qtui/simplenetworkeditor.cpp b/src/qtui/simplenetworkeditor.cpp index 00aef3d4..f0c81746 100644 --- a/src/qtui/simplenetworkeditor.cpp +++ b/src/qtui/simplenetworkeditor.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2022 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -23,7 +23,7 @@ #include "icon.h" #include "networkssettingspage.h" -SimpleNetworkEditor::SimpleNetworkEditor(QWidget *parent) +SimpleNetworkEditor::SimpleNetworkEditor(QWidget* parent) : QWidget(parent) { ui.setupUi(this); @@ -34,11 +34,10 @@ SimpleNetworkEditor::SimpleNetworkEditor(QWidget *parent) ui.upServer->setIcon(icon::get("go-up")); ui.downServer->setIcon(icon::get("go-down")); - connect(ui.networkNameEdit, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged())); - connect(ui.channelList, SIGNAL(textChanged()), this, SIGNAL(widgetHasChanged())); + connect(ui.networkNameEdit, &QLineEdit::textEdited, this, &SimpleNetworkEditor::widgetHasChanged); + connect(ui.channelList, &QTextEdit::textChanged, this, &SimpleNetworkEditor::widgetHasChanged); } - void SimpleNetworkEditor::setWidgetStates() { if (ui.serverList->selectedItems().count()) { @@ -55,14 +54,13 @@ void SimpleNetworkEditor::setWidgetStates() } } - -void SimpleNetworkEditor::displayNetworkInfo(const NetworkInfo &networkInfo) +void SimpleNetworkEditor::displayNetworkInfo(const NetworkInfo& networkInfo) { _networkInfo = networkInfo; ui.serverList->clear(); - foreach(Network::Server server, _networkInfo.serverList) { - QListWidgetItem *item = new QListWidgetItem(QString("%1:%2").arg(server.host).arg(server.port)); + foreach (Network::Server server, _networkInfo.serverList) { + QListWidgetItem* item = new QListWidgetItem(QString("%1:%2").arg(server.host).arg(server.port)); if (server.useSsl) item->setIcon(icon::get("document-encrypt")); ui.serverList->addItem(item); @@ -72,32 +70,27 @@ void SimpleNetworkEditor::displayNetworkInfo(const NetworkInfo &networkInfo) setWidgetStates(); } - -void SimpleNetworkEditor::saveToNetworkInfo(NetworkInfo &networkInfo) +void SimpleNetworkEditor::saveToNetworkInfo(NetworkInfo& networkInfo) { _networkInfo.networkName = ui.networkNameEdit->text(); networkInfo = _networkInfo; } - QStringList SimpleNetworkEditor::defaultChannels() const { - return ui.channelList->toPlainText().split("\n", QString::SkipEmptyParts); + return ui.channelList->toPlainText().split("\n", QString::SkipEmptyParts); } - -void SimpleNetworkEditor::setDefaultChannels(const QStringList &channels) +void SimpleNetworkEditor::setDefaultChannels(const QStringList& channels) { ui.channelList->setPlainText(channels.join("\n")); } - void SimpleNetworkEditor::on_serverList_itemSelectionChanged() { setWidgetStates(); } - void SimpleNetworkEditor::on_addServer_clicked() { ServerEditDlg dlg(Network::Server(), this); @@ -109,7 +102,6 @@ void SimpleNetworkEditor::on_addServer_clicked() } } - void SimpleNetworkEditor::on_editServer_clicked() { int cur = ui.serverList->currentRow(); @@ -122,7 +114,6 @@ void SimpleNetworkEditor::on_editServer_clicked() } } - void SimpleNetworkEditor::on_deleteServer_clicked() { int cur = ui.serverList->currentRow(); @@ -132,7 +123,6 @@ void SimpleNetworkEditor::on_deleteServer_clicked() emit widgetHasChanged(); } - void SimpleNetworkEditor::on_upServer_clicked() { int cur = ui.serverList->currentRow(); @@ -143,7 +133,6 @@ void SimpleNetworkEditor::on_upServer_clicked() emit widgetHasChanged(); } - void SimpleNetworkEditor::on_downServer_clicked() { int cur = ui.serverList->currentRow();