author | zecke <zecke> | 2004-10-16 00:01:01 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-10-16 00:01:01 (UTC) |
commit | df14f647ff1a60ca82e0fa9bd91458be146153b8 (patch) (side-by-side diff) | |
tree | 4859961352851a4392e1442f2080c15bff8ad7bc /library/network.cpp | |
parent | 419f9710c488f56a7a117eb1529970d3371e0094 (diff) | |
download | opie-df14f647ff1a60ca82e0fa9bd91458be146153b8.zip opie-df14f647ff1a60ca82e0fa9bd91458be146153b8.tar.gz opie-df14f647ff1a60ca82e0fa9bd91458be146153b8.tar.bz2 |
Replace QPEApplication::qpeDir() + "/ with
QPEApplication::qpeDir() + "
as it is guranteed that qpeDir() will have '/' as the last
charachter
-rw-r--r-- | library/network.cpp | 6 |
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 @@ -230,219 +230,219 @@ private: cfg.setGroup("Properties"); if ( plugin ) { if ( plugin->isActive(cfg) ) { up = TRUE; if ( firstStart ) plugin->start( cfg ); } if ( plugin->isAvailable(cfg) ) available.append(*it); } } // Try to work around unreproducible bug whereby // the netmon applet shows wrong state. bool reannounce = wait<0; if ( available != pavailable || reannounce ) { QCopEnvelope e("QPE/Network", "available(QStringList)"); e << available; } if ( up != wasup || reannounce ) { QCopEnvelope("QPE/Network", up ? "up()" : "down()"); } } void start( const QString& file, const QString& password ) { if ( !current.isEmpty() ) stop(); current = QString::null; Config cfg(file, Config::File); cfg.setGroup("Info"); QString type = cfg.readEntry("Type"); NetworkInterface* plugin = Network::loadPlugin(type); bool started = FALSE; if ( plugin ) { cfg.setGroup("Properties"); if ( plugin->start(cfg,password) ) { Network::writeProxySettings( cfg ); current = file; wait=0; startTimer(400); started = TRUE; } } if ( !started ) { QCopEnvelope("QPE/Network", "failed()"); } } void stop() { bool stopped = FALSE; if ( !current.isEmpty() ) { Config cfg(current, Config::File); cfg.setGroup("Info"); QString type = cfg.readEntry("Type"); NetworkInterface* plugin = Network::loadPlugin(type); if ( plugin ) { cfg.setGroup("Properties"); if ( plugin->stop(cfg) ) { current = QString::null; wait=0; startTimer(400); stopped = TRUE; } } } if ( !stopped ) { QCopEnvelope("QPE/Network", "failed()"); } } void timerEvent(QTimerEvent*) { examineNetworks(); if ( wait >= 0 ) { if ( up == !current.isNull() ) { // done killTimers(); if ( up ) { startTimer(3000); // monitor link wait = -1; } } else { wait++; if ( wait == 600 ) { killTimers(); // forget about it after 240 s QCopEnvelope("QPE/Network", "failed()"); up = !current.isNull(); } } } else if ( !up ) { killTimers(); } } private: QStringList available; QString current; bool up; int wait; }; static NetworkServer* ns=0; /*! \internal */ QString Network::serviceName(const QString& service) { Config cfg(service, Config::File); cfg.setGroup("Info"); return cfg.readEntry("Name"); } /*! \internal */ QString Network::serviceType(const QString& service) { Config cfg(service, Config::File); cfg.setGroup("Info"); return cfg.readEntry("Type"); } /*! \internal */ bool Network::serviceNeedsPassword(const QString& service) { Config cfg(service,Config::File); cfg.setGroup("Info"); QString type = cfg.readEntry("Type"); NetworkInterface* plugin = Network::loadPlugin(type); cfg.setGroup("Properties"); return plugin ? plugin->needPassword(cfg) : FALSE; } /*! \internal */ bool Network::networkOnline() { return ns && ns->networkOnline(); } /*! \internal */ void Network::createServer(QObject* parent) { ns = new NetworkServer(parent); } /*! \internal */ int Network::addStateWidgets(QWidget* parent) { int n=0; QStringList l = Network::choices(); QVBoxLayout* vb = new QVBoxLayout(parent); for (QStringList::ConstIterator it=l.begin(); it!=l.end(); ++it) { Config cfg(*it,Config::File); cfg.setGroup("Info"); QString type = cfg.readEntry("Type"); NetworkInterface* plugin = Network::loadPlugin(type); cfg.setGroup("Properties"); if ( plugin ) { QWidget* w; if ( (w=plugin->addStateWidget(parent,cfg)) ) { n++; vb->addWidget(w); } } } return n; } static QDict<NetworkInterface> *ifaces; /*! \internal */ NetworkInterface* Network::loadPlugin(const QString& type) { #ifndef QT_NO_COMPONENT if ( !ifaces ) ifaces = new QDict<NetworkInterface>; NetworkInterface *iface = ifaces->find(type); if ( !iface ) { #ifdef Q_OS_MACX - QString libfile = QPEApplication::qpeDir() + "/plugins/network/lib" + type + ".dylib"; + QString libfile = QPEApplication::qpeDir() + "plugins/network/lib" + type + ".dylib"; #else - QString libfile = QPEApplication::qpeDir() + "/plugins/network/lib" + type + ".so"; + QString libfile = QPEApplication::qpeDir() + "plugins/network/lib" + type + ".so"; #endif QLibrary lib(libfile); if ( !lib.queryInterface( IID_Network, (QUnknownInterface**)&iface ) == QS_OK ) return 0; ifaces->insert(type,iface); QStringList langs = Global::languageList(); for (QStringList::ConstIterator it = langs.begin(); it!=langs.end(); ++it) { QString lang = *it; QTranslator * trans = new QTranslator(qApp); - QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/lib"+type+".qm"; + QString tfn = QPEApplication::qpeDir()+"i18n/"+lang+"/lib"+type+".qm"; if ( trans->load( tfn )) qApp->installTranslator( trans ); else delete trans; } } return iface; #else return 0; #endif } #include "network.moc" #endif // QT_NO_COP |