fix 43050 本地连接名称不可输入空格
This commit is contained in:
parent
fd17607484
commit
0351e91d9e
|
@ -79,6 +79,9 @@ ConfForm::ConfForm(QWidget *parent) :
|
|||
ui->leGateway->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
ui->leAddr_ipv6->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
|
||||
//设置网络名称的正则表达式
|
||||
ui->leName->setValidator(new QRegExpValidator(QRegExp("[^ \s]*"), ui->leName));
|
||||
|
||||
ui->lineUp->setStyleSheet(lineQss);
|
||||
ui->lineDown->setStyleSheet(lineQss);
|
||||
ui->lineUp->hide();
|
||||
|
|
|
@ -778,7 +778,7 @@ void KylinDBus::toCreateNewLan()
|
|||
int i = 1;
|
||||
if (multiWiredIfName.size() != 0) {
|
||||
foreach (QString strIfName, multiWiredIfName) {
|
||||
QString cmdStr = "nmcli connection add con-name '有线连接 " + QString::number(i,10) + "' ifname '" + strIfName + "' type ethernet";
|
||||
QString cmdStr = "nmcli connection add con-name '有线连接" + QString::number(i,10) + "' ifname '" + strIfName + "' type ethernet";
|
||||
Utils::m_system(cmdStr.toUtf8().data());
|
||||
i += 1;
|
||||
}
|
||||
|
|
|
@ -335,7 +335,7 @@ void kylin_network_create_new_ethernet(char *con_name,char *if_name)
|
|||
{
|
||||
char str[256];
|
||||
char *net_type="ethernet";
|
||||
sprintf(str,"nmcli connection add con-name %s ifname %s type %s",con_name,if_name,net_type);
|
||||
sprintf(str,"nmcli connection add con-name '%s' ifname '%s' type %s",con_name,if_name,net_type);
|
||||
int status = system(str);
|
||||
if (status != 0){ syslog(LOG_ERR, "execute 'nmcli connection add con-name' in function 'kylin_network_create_new_ethernet' failed");}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue