summaryrefslogtreecommitdiff
path: root/libopie2/opienet/onetwork.cpp
Unidiff
Diffstat (limited to 'libopie2/opienet/onetwork.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index 73b543b..f0094c7 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -87,49 +87,49 @@ void ONetwork::synchronize()
87 QTextStream s( &f ); 87 QTextStream s( &f );
88 s.readLine(); 88 s.readLine();
89 s.readLine(); 89 s.readLine();
90 while ( !s.atEnd() ) 90 while ( !s.atEnd() )
91 { 91 {
92 s >> str; 92 s >> str;
93 str.truncate( str.find( ':' ) ); 93 str.truncate( str.find( ':' ) );
94 qDebug( "ONetwork: found interface '%s'", (const char*) str ); 94 qDebug( "ONetwork: found interface '%s'", (const char*) str );
95 ONetworkInterface* iface; 95 ONetworkInterface* iface;
96 if ( isWirelessInterface( str ) ) 96 if ( isWirelessInterface( str ) )
97 { 97 {
98 iface = new OWirelessNetworkInterface( this, (const char*) str ); 98 iface = new OWirelessNetworkInterface( this, (const char*) str );
99 qDebug( "ONetwork: interface '%s' has Wireless Extensions", (const char*) str ); 99 qDebug( "ONetwork: interface '%s' has Wireless Extensions", (const char*) str );
100 } 100 }
101 else 101 else
102 { 102 {
103 iface = new ONetworkInterface( this, (const char*) str ); 103 iface = new ONetworkInterface( this, (const char*) str );
104 } 104 }
105 _interfaces.insert( str, iface ); 105 _interfaces.insert( str, iface );
106 s.readLine(); 106 s.readLine();
107 } 107 }
108} 108}
109 109
110 110
111ONetworkInterface* ONetwork::interface( QString iface ) const 111ONetworkInterface* ONetwork::interface( const QString& iface ) const
112{ 112{
113 return _interfaces[iface]; 113 return _interfaces[iface];
114} 114}
115 115
116 116
117ONetwork* ONetwork::instance() 117ONetwork* ONetwork::instance()
118{ 118{
119 if ( !_instance ) _instance = new ONetwork(); 119 if ( !_instance ) _instance = new ONetwork();
120 return _instance; 120 return _instance;
121} 121}
122 122
123 123
124ONetwork::InterfaceIterator ONetwork::iterator() const 124ONetwork::InterfaceIterator ONetwork::iterator() const
125{ 125{
126 return ONetwork::InterfaceIterator( _interfaces ); 126 return ONetwork::InterfaceIterator( _interfaces );
127} 127}
128 128
129 129
130bool ONetwork::isWirelessInterface( const char* name ) const 130bool ONetwork::isWirelessInterface( const char* name ) const
131{ 131{
132 int sfd = socket( AF_INET, SOCK_STREAM, 0 ); 132 int sfd = socket( AF_INET, SOCK_STREAM, 0 );
133 struct iwreq iwr; 133 struct iwreq iwr;
134 memset( &iwr, 0, sizeof( struct iwreq ) ); 134 memset( &iwr, 0, sizeof( struct iwreq ) );
135 strcpy( (char*) &iwr.ifr_name, name ); 135 strcpy( (char*) &iwr.ifr_name, name );