-rw-r--r-- | library/network.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/library/network.cpp b/library/network.cpp index 7d51016..e6d2781 100644 --- a/library/network.cpp +++ b/library/network.cpp | |||
@@ -9,24 +9,25 @@ | |||
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 |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #define QTOPIA_INTERNAL_LANGLIST | ||
21 | #include "qpe/network.h" | 22 | #include "qpe/network.h" |
22 | #include "qpe/networkinterface.h" | 23 | #include "qpe/networkinterface.h" |
23 | #include "qpe/global.h" | 24 | #include "qpe/global.h" |
24 | #include "qpe/config.h" | 25 | #include "qpe/config.h" |
25 | #include "qpe/resource.h" | 26 | #include "qpe/resource.h" |
26 | #include "qpe/qpeapplication.h" | 27 | #include "qpe/qpeapplication.h" |
27 | #include <qpe/qcopenvelope_qws.h> | 28 | #include <qpe/qcopenvelope_qws.h> |
28 | #include <qpe/qlibrary.h> | 29 | #include <qpe/qlibrary.h> |
29 | 30 | ||
30 | #include <qlistbox.h> | 31 | #include <qlistbox.h> |
31 | #include <qdir.h> | 32 | #include <qdir.h> |
32 | #include <qlayout.h> | 33 | #include <qlayout.h> |
@@ -409,28 +410,30 @@ static QDict<NetworkInterface> *ifaces; | |||
409 | */ | 410 | */ |
410 | NetworkInterface* Network::loadPlugin(const QString& type) | 411 | NetworkInterface* Network::loadPlugin(const QString& type) |
411 | { | 412 | { |
412 | #ifndef QT_NO_COMPONENT | 413 | #ifndef QT_NO_COMPONENT |
413 | if ( !ifaces ) ifaces = new QDict<NetworkInterface>; | 414 | if ( !ifaces ) ifaces = new QDict<NetworkInterface>; |
414 | NetworkInterface *iface = ifaces->find(type); | 415 | NetworkInterface *iface = ifaces->find(type); |
415 | if ( !iface ) { | 416 | if ( !iface ) { |
416 | QString libfile = QPEApplication::qpeDir() + "/plugins/network/lib" + type + ".so"; | 417 | QString libfile = QPEApplication::qpeDir() + "/plugins/network/lib" + type + ".so"; |
417 | QLibrary lib(libfile); | 418 | QLibrary lib(libfile); |
418 | if ( !lib.queryInterface( IID_Network, (QUnknownInterface**)&iface ) == QS_OK ) | 419 | if ( !lib.queryInterface( IID_Network, (QUnknownInterface**)&iface ) == QS_OK ) |
419 | return 0; | 420 | return 0; |
420 | ifaces->insert(type,iface); | 421 | ifaces->insert(type,iface); |
421 | QString lang = getenv( "LANG" ); | 422 | QStringList langs = Global::languageList(); |
423 | for (QStringList::ConstIterator it = langs.begin(); it!=langs.end(); ++it) { | ||
424 | QString lang = *it; | ||
422 | QTranslator * trans = new QTranslator(qApp); | 425 | QTranslator * trans = new QTranslator(qApp); |
423 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/lib"+type+".qm"; | 426 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/lib"+type+".qm"; |
424 | if ( trans->load( tfn )) | 427 | if ( trans->load( tfn )) |
425 | qApp->installTranslator( trans ); | 428 | qApp->installTranslator( trans ); |
426 | else | 429 | else |
427 | delete trans; | 430 | delete trans; |
428 | 431 | } | |
429 | } | 432 | } |
430 | return iface; | 433 | return iface; |
431 | #else | 434 | #else |
432 | return 0; | 435 | return 0; |
433 | #endif | 436 | #endif |
434 | } | 437 | } |
435 | 438 | ||
436 | #include "network.moc" | 439 | #include "network.moc" |