author | zecke <zecke> | 2003-10-08 08:01:46 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-10-08 08:01:46 (UTC) |
commit | 5517443d9ebe96ff9c30d91b2254418964d5c410 (patch) (side-by-side diff) | |
tree | df0b7d5ca0bade7efba6182224402a30ffceec4b | |
parent | b941b5b3e805e9d57cda58be73a6d4255fcb9e8b (diff) | |
download | opie-5517443d9ebe96ff9c30d91b2254418964d5c410.zip opie-5517443d9ebe96ff9c30d91b2254418964d5c410.tar.gz opie-5517443d9ebe96ff9c30d91b2254418964d5c410.tar.bz2 |
include QPEApplication if you need it
-rw-r--r-- | libopie/oapplicationfactory.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libopie/oapplicationfactory.h b/libopie/oapplicationfactory.h index 418a82e..ab88d80 100644 --- a/libopie/oapplicationfactory.h +++ b/libopie/oapplicationfactory.h @@ -201,62 +201,64 @@ struct OPrivate< Opie::Typelist<Product, ProductListTail> > { template<class Product, class ProductListTail> struct OApplicationFactory< Opie::Typelist<Product, ProductListTail > > : ApplicationInterface { QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { *iface = 0; if ( uuid == IID_QUnknown ) *iface = this; else if ( uuid ==IID_QtopiaApplication ) *iface = this; else return QS_FALSE; (*iface)->addRef(); return QS_OK; } QWidget* createMainWindow ( const QString& appName, QWidget* parent, const char* name, Qt::WFlags fl ) { qWarning("StringList is %s", applications().join(":").latin1() ); return OPrivate< Opie::Typelist<Product, ProductListTail > >::multiFactory( appName, parent, name, fl ); } QStringList applications()const { QStringList _list; return OPrivate< Opie::Typelist<Product, ProductListTail> >::multiString( _list ); } Q_REFCOUNT }; /* If the library version should be build */ #ifdef OPIE_APP_INTERFACE #define OPIE_EXPORT_APP( factory ) Q_EXPORT_INTERFACE() { Q_CREATE_INSTANCE( factory ) } #else +#include <qpe/qpeapplication.h> + #define OPIE_EXPORT_APP( Factory ) \ int main( int argc, char **argv ) { \ QPEApplication a(argc, argv ); \ QWidget *mw = 0;\ \ /* method from TT */ \ QString executableName = QString::fromLatin1( argv[0] ); \ executableName = executableName.right(executableName.length() \ - executableName.findRev('/') - 1); \ \ Factory f; \ QStringList list = f.applications(); \ if (list.contains(executableName) ) \ mw = f.createMainWindow(executableName, 0, 0, 0 ); \ else \ mw = f.createMainWindow( list[0], 0, 0, 0 ); \ \ if( mw ) { \ if ( mw->metaObject()->slotNames().contains("setDocument(const QString&)" ) ) \ a.showMainDocumentWidget( mw ); \ else \ a.showMainWidget( mw ); \ \ int rv = a.exec(); \ delete mw; \ return rv; \ }else \ return -1; \ } #endif |