summaryrefslogtreecommitdiff
path: root/library/network.cpp
Unidiff
Diffstat (limited to 'library/network.cpp') (more/less context) (show whitespace changes)
-rw-r--r--library/network.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/network.cpp b/library/network.cpp
index f2a673c..0bbbec1 100644
--- a/library/network.cpp
+++ b/library/network.cpp
@@ -374,75 +374,75 @@ bool Network::networkOnline()
374 return ns && ns->networkOnline(); 374 return ns && ns->networkOnline();
375} 375}
376 376
377/*! 377/*!
378 \internal 378 \internal
379*/ 379*/
380void Network::createServer(QObject* parent) 380void Network::createServer(QObject* parent)
381{ 381{
382 ns = new NetworkServer(parent); 382 ns = new NetworkServer(parent);
383} 383}
384 384
385/*! 385/*!
386 \internal 386 \internal
387*/ 387*/
388int Network::addStateWidgets(QWidget* parent) 388int Network::addStateWidgets(QWidget* parent)
389{ 389{
390 int n=0; 390 int n=0;
391 QStringList l = Network::choices(); 391 QStringList l = Network::choices();
392 QVBoxLayout* vb = new QVBoxLayout(parent); 392 QVBoxLayout* vb = new QVBoxLayout(parent);
393 for (QStringList::ConstIterator it=l.begin(); it!=l.end(); ++it) { 393 for (QStringList::ConstIterator it=l.begin(); it!=l.end(); ++it) {
394 Config cfg(*it,Config::File); 394 Config cfg(*it,Config::File);
395 cfg.setGroup("Info"); 395 cfg.setGroup("Info");
396 QString type = cfg.readEntry("Type"); 396 QString type = cfg.readEntry("Type");
397 NetworkInterface* plugin = Network::loadPlugin(type); 397 NetworkInterface* plugin = Network::loadPlugin(type);
398 cfg.setGroup("Properties"); 398 cfg.setGroup("Properties");
399 if ( plugin ) { 399 if ( plugin ) {
400 QWidget* w; 400 QWidget* w;
401 if ( (w=plugin->addStateWidget(parent,cfg)) ) { 401 if ( (w=plugin->addStateWidget(parent,cfg)) ) {
402 n++; 402 n++;
403 vb->addWidget(w); 403 vb->addWidget(w);
404 } 404 }
405 } 405 }
406 } 406 }
407 return n; 407 return n;
408} 408}
409 409
410static QDict<NetworkInterface> *ifaces; 410static QDict<NetworkInterface> *ifaces;
411 411
412/*! 412/*!
413 \internal 413 \internal
414*/ 414*/
415NetworkInterface* Network::loadPlugin(const QString& type) 415NetworkInterface* Network::loadPlugin(const QString& type)
416{ 416{
417#ifndef QT_NO_COMPONENT 417#ifndef QT_NO_COMPONENT
418 if ( !ifaces ) ifaces = new QDict<NetworkInterface>; 418 if ( !ifaces ) ifaces = new QDict<NetworkInterface>;
419 NetworkInterface *iface = ifaces->find(type); 419 NetworkInterface *iface = ifaces->find(type);
420 if ( !iface ) { 420 if ( !iface ) {
421#ifdef Q_OS_MACX 421#ifdef Q_OS_MACX
422 QString libfile = QPEApplication::qpeDir() + "/plugins/network/lib" + type + ".dylib"; 422 QString libfile = QPEApplication::qpeDir() + "plugins/network/lib" + type + ".dylib";
423#else 423#else
424 QString libfile = QPEApplication::qpeDir() + "/plugins/network/lib" + type + ".so"; 424 QString libfile = QPEApplication::qpeDir() + "plugins/network/lib" + type + ".so";
425#endif 425#endif
426 QLibrary lib(libfile); 426 QLibrary lib(libfile);
427 if ( !lib.queryInterface( IID_Network, (QUnknownInterface**)&iface ) == QS_OK ) 427 if ( !lib.queryInterface( IID_Network, (QUnknownInterface**)&iface ) == QS_OK )
428 return 0; 428 return 0;
429 ifaces->insert(type,iface); 429 ifaces->insert(type,iface);
430 QStringList langs = Global::languageList(); 430 QStringList langs = Global::languageList();
431 for (QStringList::ConstIterator it = langs.begin(); it!=langs.end(); ++it) { 431 for (QStringList::ConstIterator it = langs.begin(); it!=langs.end(); ++it) {
432 QString lang = *it; 432 QString lang = *it;
433 QTranslator * trans = new QTranslator(qApp); 433 QTranslator * trans = new QTranslator(qApp);
434 QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/lib"+type+".qm"; 434 QString tfn = QPEApplication::qpeDir()+"i18n/"+lang+"/lib"+type+".qm";
435 if ( trans->load( tfn )) 435 if ( trans->load( tfn ))
436 qApp->installTranslator( trans ); 436 qApp->installTranslator( trans );
437 else 437 else
438 delete trans; 438 delete trans;
439 } 439 }
440 } 440 }
441 return iface; 441 return iface;
442#else 442#else
443 return 0; 443 return 0;
444#endif 444#endif
445} 445}
446 446
447#include "network.moc" 447#include "network.moc"
448 #endif// QT_NO_COP 448 #endif// QT_NO_COP