-rw-r--r-- | kmicromail/main.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/kmicromail/main.cpp b/kmicromail/main.cpp new file mode 100644 index 0000000..f2879e8 --- a/dev/null +++ b/kmicromail/main.cpp @@ -0,0 +1,55 @@ + +#ifndef DESKTOP_VERSION +#include <qpe/qpeapplication.h> +#include <stdlib.h> +#else +#include <qapplication.h> +#include <qstring.h> +#include <qwindowsstyle.h> +#include <qplatinumstyle.h> +#include <qsgistyle.h> +#endif +#include "opiemail.h" +#include <qdir.h> +#include <kstandarddirs.h> +#include <kglobal.h> +#include <stdio.h> +#include "mainwindow.h" + +using namespace Opie::Core; +int main( int argc, char **argv ) { + +#ifndef DESKTOP_VERSION + QPEApplication a( argc, argv ); + a.setKeepRunning (); +#else + QApplication a( argc, argv ); + QApplication::setStyle( new QPlatinumStyle ()); +#endif + + KGlobal::setAppName( "kmicromail" ); + QString fileName ; +#ifndef DESKTOP_VERSION + fileName = getenv("QPEDIR"); + KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kmicromail/"); +#else + fileName = qApp->applicationDirPath () + "/kdepim/kmicromail/"; + KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); +#endif + KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kmicromail"))); + OpieMail* mw = new OpieMail(); +#ifndef DESKTOP_VERSION + //qDebug("CONNECT "); + QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),mw, SLOT(message( const QCString&, const QByteArray& ))); + a.showMainWidget(mw ); +#else + a.setMainWidget(mw ); + m.show(); + //m.resize( 800, 600 ); +#endif + QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); + int rv = a.exec(); + delete mw; + return rv; + +} |