From 51ade1eede326506f4814081ac4141a97082ff53 Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Fri, 25 Aug 2023 14:15:36 +0800
Subject: [PATCH 1/2] feature(network):When the gateway setting item is
 0.0.0.0, the gateway setting item is null
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

- 当网关设置项为“0.0.0.0”时，网关设置项置空

Related #13150
---
 .../network/src/plugin/setting-widget/ipv4-widget.cpp    | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp b/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp
index 63d029c..8c39794 100644
--- a/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp
+++ b/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp
@@ -162,7 +162,14 @@ void Ipv4Widget::showSettings()
 
             ui->ipv4Address->setText(address);
             ui->ipv4Netmask->setText(netmask);
-            ui->ipv4Gateway->setText(gateway);
+            if(gateway != "0.0.0.0")
+            {
+                ui->ipv4Gateway->setText(gateway);
+            }
+            else
+            {
+                ui->ipv4Gateway->clear();
+            }
         }
         QString preferredDNS = "";
         QString alternateDNS = "";
-- 
2.33.0

