From 304f6239177b5b4d005b6bc6e809caffeb7cb905 Mon Sep 17 00:00:00 2001 From: lvhan Date: Wed, 19 May 2021 15:04:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=89=E7=BA=BF=E7=BD=91=E7=BB=9C=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E5=8F=AF=E4=BB=A5=E6=94=AF=E6=8C=81=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/confform.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/confform.cpp b/src/confform.cpp index 9f997021..45702cb7 100644 --- a/src/confform.cpp +++ b/src/confform.cpp @@ -261,7 +261,7 @@ void ConfForm::on_btnCreate_clicked() } } } - QString name = ui->leName->text().trimmed(); + QString name = ui->leName->text(); QString cmdStr; if(ui->cbType->currentIndex() == 0){ cmdStr = "nmcli connection add con-name '" + name + "' ifname '" + mIfname + "' type ethernet"; @@ -350,7 +350,7 @@ void ConfForm::on_btnSave_clicked() } //如果网络的名称已经修改,则删掉当前网络,新建一个网络 - QString name = ui->leName->text().trimmed(); + QString name = ui->leName->text(); if (name != lastConnName) { QString cmd = "nmcli connection delete '" + netUuid + "'"; int status = system(cmd.toUtf8().data()); @@ -428,7 +428,7 @@ void ConfForm::saveNetworkConfiguration() mask = "24"; } - QString name = ui->leName->text().trimmed(); + QString name = ui->leName->text(); QString dnss = ui->leDns->text(); if (ui->leDns2->text() != "") { dnss.append(","); @@ -717,7 +717,7 @@ void ConfForm::setEnableOfBtn() // this->setBtnEnableFalse(); // return; // } - if (ui->leName->text().trimmed().size() == 0 ) { + if (ui->leName->text().size() == 0 ) { this->setBtnEnableFalse(); return; }