Diffstat (limited to 'noncore/settings/networksettings/ppp/pppmodule.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/pppmodule.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp index a7caffe..2291e8a 100644 --- a/noncore/settings/networksettings/ppp/pppmodule.cpp +++ b/noncore/settings/networksettings/ppp/pppmodule.cpp | |||
@@ -57,24 +57,24 @@ PPPModule::PPPModule() : Module() | |||
57 | QMap<QString,Connection> running = inFace.interfaces(); | 57 | QMap<QString,Connection> running = inFace.interfaces(); |
58 | QStringList handledInterfaceNames; | 58 | QStringList handledInterfaceNames; |
59 | 59 | ||
60 | QMap<QString,QString> ifaces = PPPData::getConfiguredInterfaces(); | 60 | QMap<QString,QString> ifaces = PPPData::getConfiguredInterfaces(); |
61 | QMap<QString,QString>::Iterator it; | 61 | QMap<QString,QString>::Iterator it; |
62 | InterfacePPP *iface; | 62 | InterfacePPP *iface; |
63 | qDebug("getting interfaces"); | 63 | odebug << "getting interfaces" << oendl; |
64 | for( it = ifaces.begin(); it != ifaces.end(); ++it ) | 64 | for( it = ifaces.begin(); it != ifaces.end(); ++it ) |
65 | { | 65 | { |
66 | qDebug("ifaces %s %s", it.key().latin1(), it.data().latin1() ); | 66 | odebug << "ifaces " << it.key().latin1() << " " << it.data().latin1() << "" << oendl; |
67 | iface = new InterfacePPP( 0, it.key() ); | 67 | iface = new InterfacePPP( 0, it.key() ); |
68 | iface->setHardwareName( it.data() ); | 68 | iface->setHardwareName( it.data() ); |
69 | list.append( (Interface*)iface ); | 69 | list.append( (Interface*)iface ); |
70 | 70 | ||
71 | // check if (*it) is one of the running ifaces | 71 | // check if (*it) is one of the running ifaces |
72 | if ( running.contains( it.data() ) ) | 72 | if ( running.contains( it.data() ) ) |
73 | { | 73 | { |
74 | qDebug("iface is running %s", it.key().latin1() ); | 74 | odebug << "iface is running " << it.key().latin1() << "" << oendl; |
75 | handledInterfaceNames << running[it.data()].device; | 75 | handledInterfaceNames << running[it.data()].device; |
76 | iface->setStatus( true ); | 76 | iface->setStatus( true ); |
77 | iface->setPPPDpid( running[it.data()].pid ); | 77 | iface->setPPPDpid( running[it.data()].pid ); |
78 | iface->modem()->setPPPDevice( running[it.data()].device ); | 78 | iface->modem()->setPPPDevice( running[it.data()].device ); |
79 | iface->refresh(); | 79 | iface->refresh(); |
80 | } | 80 | } |
@@ -85,22 +85,22 @@ PPPModule::PPPModule() : Module() | |||
85 | 85 | ||
86 | /** | 86 | /** |
87 | * Delete any interfaces that we own. | 87 | * Delete any interfaces that we own. |
88 | */ | 88 | */ |
89 | PPPModule::~PPPModule() | 89 | PPPModule::~PPPModule() |
90 | { | 90 | { |
91 | qDebug("PPPModule::~PPPModule() " ); | 91 | odebug << "PPPModule::~PPPModule() " << oendl; |
92 | QMap<QString,QString> ifaces; | 92 | QMap<QString,QString> ifaces; |
93 | InterfaceKeeper keeper; | 93 | InterfaceKeeper keeper; |
94 | Interface *i; | 94 | Interface *i; |
95 | for ( i=list.first(); i != 0; i=list.next() ) | 95 | for ( i=list.first(); i != 0; i=list.next() ) |
96 | { | 96 | { |
97 | /* if online save the state */ | 97 | /* if online save the state */ |
98 | if ( i->getStatus() ) | 98 | if ( i->getStatus() ) |
99 | { | 99 | { |
100 | qDebug("Iface %s is still up", i->getHardwareName().latin1() ); | 100 | odebug << "Iface " << i->getHardwareName().latin1() << " is still up" << oendl; |
101 | InterfacePPP* ppp = static_cast<InterfacePPP*>(i); | 101 | InterfacePPP* ppp = static_cast<InterfacePPP*>(i); |
102 | keeper.addInterface( ppp->pppPID(), ppp->pppDev(), ppp->getHardwareName() ); | 102 | keeper.addInterface( ppp->pppPID(), ppp->pppDev(), ppp->getHardwareName() ); |
103 | } | 103 | } |
104 | ifaces.insert( i->getInterfaceName(), i->getHardwareName() ); | 104 | ifaces.insert( i->getInterfaceName(), i->getHardwareName() ); |
105 | delete i; | 105 | delete i; |
106 | } | 106 | } |
@@ -138,13 +138,13 @@ bool PPPModule::isOwner(Interface *i) | |||
138 | /** | 138 | /** |
139 | * Create, and return the WLANConfigure Module | 139 | * Create, and return the WLANConfigure Module |
140 | * @return QWidget* pointer to this modules configure. | 140 | * @return QWidget* pointer to this modules configure. |
141 | */ | 141 | */ |
142 | QWidget *PPPModule::configure(Interface *i) | 142 | QWidget *PPPModule::configure(Interface *i) |
143 | { | 143 | { |
144 | qDebug("return ModemWidget"); | 144 | odebug << "return ModemWidget" << oendl; |
145 | PPPConfigWidget *pppconfig = new PPPConfigWidget( (InterfacePPP*)i, | 145 | PPPConfigWidget *pppconfig = new PPPConfigWidget( (InterfacePPP*)i, |
146 | 0, "PPPConfig", false, | 146 | 0, "PPPConfig", false, |
147 | (Qt::WDestructiveClose | Qt::WStyle_ContextHelp)); | 147 | (Qt::WDestructiveClose | Qt::WStyle_ContextHelp)); |
148 | return pppconfig; | 148 | return pppconfig; |
149 | } | 149 | } |
150 | 150 | ||
@@ -165,13 +165,13 @@ QWidget *PPPModule::information(Interface *i) | |||
165 | * @return QList<Interface> A list of interfaces that exsist that havn't | 165 | * @return QList<Interface> A list of interfaces that exsist that havn't |
166 | * been called by isOwner() | 166 | * been called by isOwner() |
167 | */ | 167 | */ |
168 | QList<Interface> PPPModule::getInterfaces() | 168 | QList<Interface> PPPModule::getInterfaces() |
169 | { | 169 | { |
170 | // List all of the files in the peer directory | 170 | // List all of the files in the peer directory |
171 | qDebug("PPPModule::getInterfaces"); | 171 | odebug << "PPPModule::getInterfaces" << oendl; |
172 | return list; | 172 | return list; |
173 | } | 173 | } |
174 | 174 | ||
175 | /** | 175 | /** |
176 | * Attempt to add a new interface as defined by name | 176 | * Attempt to add a new interface as defined by name |
177 | * @param name the name of the type of interface that should be created given | 177 | * @param name the name of the type of interface that should be created given |
@@ -258,26 +258,26 @@ namespace | |||
258 | { | 258 | { |
259 | Connection con; | 259 | Connection con; |
260 | cfg.setGroup( (*it) ); | 260 | cfg.setGroup( (*it) ); |
261 | con.name = (*it); | 261 | con.name = (*it); |
262 | con.pid = cfg.readNumEntry("pid"); | 262 | con.pid = cfg.readNumEntry("pid"); |
263 | con.device = cfg.readEntry("device"); | 263 | con.device = cfg.readEntry("device"); |
264 | qDebug(" %s %s %d", con.name.latin1(), con.device.latin1(), con.pid ); | 264 | odebug << " " << con.name.latin1() << " " << con.device.latin1() << " " << con.pid << "" << oendl; |
265 | 265 | ||
266 | if ( con.pid != -1 && isAvailable( con.pid ) ) | 266 | if ( con.pid != -1 && isAvailable( con.pid ) ) |
267 | ifaces.insert( con.name, con ); | 267 | ifaces.insert( con.name, con ); |
268 | } | 268 | } |
269 | return ifaces; | 269 | return ifaces; |
270 | } | 270 | } |
271 | bool InterfaceKeeper::isAvailable( pid_t p)const | 271 | bool InterfaceKeeper::isAvailable( pid_t p)const |
272 | { | 272 | { |
273 | if (::kill(p, 0 ) == 0 || errno != ESRCH ) | 273 | if (::kill(p, 0 ) == 0 || errno != ESRCH ) |
274 | { | 274 | { |
275 | qDebug("isAvailable %d", p); | 275 | odebug << "isAvailable " << p << "" << oendl; |
276 | return true; | 276 | return true; |
277 | } | 277 | } |
278 | 278 | ||
279 | qDebug("notAvailable %d", p); | 279 | odebug << "notAvailable " << p << "" << oendl; |
280 | return false; | 280 | return false; |
281 | } | 281 | } |
282 | 282 | ||
283 | } | 283 | } |