summaryrefslogtreecommitdiff
path: root/library/networkinterface.cpp
Unidiff
Diffstat (limited to 'library/networkinterface.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/networkinterface.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/library/networkinterface.cpp b/library/networkinterface.cpp
index 56a0e5b..2b5c77e 100644
--- a/library/networkinterface.cpp
+++ b/library/networkinterface.cpp
@@ -1,16 +1,16 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
@@ -36,25 +36,27 @@ bool NetworkInterface::isActive( Config& cfg ) const
36 QString dev0 = dev+'0'; 36 QString dev0 = dev+'0';
37 37
38 FILE* f; 38 FILE* f;
39 f = fopen("/proc/net/dev", "r"); 39 f = fopen("/proc/net/dev", "r");
40 if ( f ) { 40 if ( f ) {
41 char line[1024]; 41 char line[1024];
42 char devname[80]; 42 char devname[80];
43 while ( fgets( line, 1024, f ) ) { 43 while ( fgets( line, 1024, f ) ) {
44 if ( sscanf(line," %[^:]:", devname)==1 ) 44 if ( sscanf(line," %[^:]:", devname)==1 )
45 { 45 {
46 if ( devname == dev || devname == dev0 ) { 46 if ( devname == dev || devname == dev0 ) {
47 fclose(f); 47 fclose(f);
48#ifdef QWS
48 Network::writeProxySettings( cfg ); 49 Network::writeProxySettings( cfg );
50#endif
49 return TRUE; 51 return TRUE;
50 } 52 }
51 } 53 }
52 } 54 }
53 fclose(f); 55 fclose(f);
54 } 56 }
55 return FALSE; 57 return FALSE;
56} 58}
57 59
58QString NetworkInterface::cardType( Config& cfg ) const 60QString NetworkInterface::cardType( Config& cfg ) const
59{ 61{
60 return cfg.readEntry("CardType"); 62 return cfg.readEntry("CardType");