[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/3.5/kdeadmin/knetworkconf/knetworkconf
From: Juan Luis Baptiste <juan.baptiste () kdemail ! net>
Date: 2005-12-26 22:52:35
Message-ID: 1135637555.717413.18700.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 491643 by jbaptiste:
When loading network info, If default gateway is blank and the gateway of the \
interface that is the default gateway isn't, then set the default gateway to that \
value.
M +25 -10 knetworkconf.cpp
--- branches/KDE/3.5/kdeadmin/knetworkconf/knetworkconf/knetworkconf.cpp \
#491642:491643 @@ -406,21 +406,36 @@
/** Loads the info about the default gateway and host and domain names. */
void KNetworkConf::loadRoutingInfo(){
//routingInfo = config->getNetworkInfoSlot();
- if (routingInfo == NULL)
- KMessageBox::error(this,i18n("Could not open file '/etc/sysconfig/network' for \
reading."),
- i18n("Error Loading Config Files"));
+ if (!routingInfo->getGateway().isEmpty())
+ kleDefaultRoute->setText(routingInfo->getGateway());
else
{
- kleDefaultRoute->setText(routingInfo->getGateway());
- kcbGwDevice->clear();
- kcbGwDevice->insertStringList(deviceNamesList);
- if (!routingInfo->getGatewayDevice().isEmpty())
- kcbGwDevice->setCurrentText(routingInfo->getGatewayDevice());
-/* if (routingInfo->isForwardIPv4Enabled().compare("yes") == 0)
+ //Take the default gateway from the gateway field of the default gateway \
interface + //because some platforms (Debian-like ones) seems that don't handle \
the concept of a default + //gateway, instead a gateway per interface.
+ KNetworkInterface *device;
+ QString defaultGwDevice = routingInfo->getGatewayDevice();
+ QPtrList<KNetworkInterface> deviceList = netInfo->getDeviceList();
+ for (device = deviceList.first(); device; device = deviceList.next())
+ {
+ if ( device->getDeviceName() == defaultGwDevice )
+ {
+ if ( !device->getGateway().isEmpty() )
+ {
+ kleDefaultRoute->setText(device->getGateway());
+ }
+ }
+ }
+ }
+
+ kcbGwDevice->clear();
+ kcbGwDevice->insertStringList(deviceNamesList);
+ if (!routingInfo->getGatewayDevice().isEmpty())
+ kcbGwDevice->setCurrentText(routingInfo->getGatewayDevice());
+/* if (routingInfo->isForwardIPv4Enabled().compare("yes") == 0)
cbEnableRouting->setChecked(true);
else
cbEnableRouting->setChecked(false);*/
- }
}
void KNetworkConf::loadDNSInfo(){
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic