author | drw <drw> | 2004-02-23 23:12:27 (UTC) |
---|---|---|
committer | drw <drw> | 2004-02-23 23:12:27 (UTC) |
commit | bff739b1760881bb326ec38ebe62a52195b8c032 (patch) (unidiff) | |
tree | af346d65cb9ce04c9264b518938d2b8a384e0c27 /core/apps/taboapp/main.cpp | |
parent | 728207110007fd6ab6ca945905e7236326a797d7 (diff) | |
download | opie-bff739b1760881bb326ec38ebe62a52195b8c032.zip opie-bff739b1760881bb326ec38ebe62a52195b8c032.tar.gz opie-bff739b1760881bb326ec38ebe62a52195b8c032.tar.bz2 |
Tab OApp: libopie->libopie2
-rw-r--r-- | core/apps/taboapp/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/apps/taboapp/main.cpp b/core/apps/taboapp/main.cpp index 5f7f86c..4b9451e 100644 --- a/core/apps/taboapp/main.cpp +++ b/core/apps/taboapp/main.cpp | |||
@@ -1,54 +1,54 @@ | |||
1 | #include <qdir.h> | 1 | #include <qdir.h> |
2 | 2 | ||
3 | #include <qpe/global.h> | 3 | #include <qpe/global.h> |
4 | #include <qpe/qpeapplication.h> | 4 | #include <qpe/qpeapplication.h> |
5 | #include <qpe/qlibrary.h> | 5 | #include <qpe/qlibrary.h> |
6 | #include <oappinterface.h> | 6 | #include <oappinterface.h> |
7 | #include <oappplugin.h> | 7 | #include <oappplugin.h> |
8 | 8 | ||
9 | #include <opie/otabwidget.h> | 9 | #include <opie2/otabwidget.h> |
10 | 10 | ||
11 | int main( int argc, char **argv ) | 11 | int main( int argc, char **argv ) |
12 | { | 12 | { |
13 | QPEApplication a( argc, argv ); | 13 | QPEApplication a( argc, argv ); |
14 | 14 | ||
15 | OTabWidget *tabwidget = new OTabWidget(0, "tab widget"); | 15 | OTabWidget *tabwidget = new OTabWidget(0, "tab widget"); |
16 | 16 | ||
17 | QString path = QPEApplication::qpeDir() + "/plugins/app"; | 17 | QString path = QPEApplication::qpeDir() + "/plugins/app"; |
18 | QDir dir( path, "lib*.so" ); | 18 | QDir dir( path, "lib*.so" ); |
19 | 19 | ||
20 | QStringList list = dir.entryList(); | 20 | QStringList list = dir.entryList(); |
21 | QStringList::Iterator it; | 21 | QStringList::Iterator it; |
22 | 22 | ||
23 | QInterfacePtr<OAppInterface> iface; | 23 | QInterfacePtr<OAppInterface> iface; |
24 | for ( it = list.begin(); it != list.end(); ++it ) { | 24 | for ( it = list.begin(); it != list.end(); ++it ) { |
25 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 25 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
26 | 26 | ||
27 | qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); | 27 | qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); |
28 | if ( lib->queryInterface( IID_OAppInterface, (QUnknownInterface**)&iface ) == QS_OK ) { | 28 | if ( lib->queryInterface( IID_OAppInterface, (QUnknownInterface**)&iface ) == QS_OK ) { |
29 | qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); | 29 | qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); |
30 | 30 | ||
31 | QList<QWidget> list = iface->widgets(); | 31 | QList<QWidget> list = iface->widgets(); |
32 | QWidget *widget; | 32 | QWidget *widget; |
33 | for ( widget = list.first(); widget != 0; widget = list.next() ) | 33 | for ( widget = list.first(); widget != 0; widget = list.next() ) |
34 | tabwidget->addTab(widget, QString(*it), QString(*it)); | 34 | tabwidget->addTab(widget, QString(*it), QString(*it)); |
35 | 35 | ||
36 | QString lang = getenv( "LANG" ); | 36 | QString lang = getenv( "LANG" ); |
37 | if (lang.isNull()) | 37 | if (lang.isNull()) |
38 | lang = "en"; | 38 | lang = "en"; |
39 | QTranslator *trans = new QTranslator(qApp); | 39 | QTranslator *trans = new QTranslator(qApp); |
40 | QString type = (*it).left( (*it).find(".") ); | 40 | QString type = (*it).left( (*it).find(".") ); |
41 | if (type.left(3) == "lib") | 41 | if (type.left(3) == "lib") |
42 | type = type.mid(3); | 42 | type = type.mid(3); |
43 | type = type.right( type.find("lib") ); | 43 | type = type.right( type.find("lib") ); |
44 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; | 44 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; |
45 | if ( trans->load( tfn )) | 45 | if ( trans->load( tfn )) |
46 | qApp->installTranslator( trans ); | 46 | qApp->installTranslator( trans ); |
47 | else | 47 | else |
48 | delete trans; | 48 | delete trans; |
49 | } | 49 | } |
50 | } | 50 | } |
51 | 51 | ||
52 | a.showMainDocumentWidget(tabwidget); | 52 | a.showMainDocumentWidget(tabwidget); |
53 | return a.exec(); | 53 | return a.exec(); |
54 | } | 54 | } |