summaryrefslogtreecommitdiffabout
path: root/kmicromail/main.cpp
blob: a4f6a06a114e933360de2ce3e3ece08bdb898995 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

#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");
    if ( QApplication::desktop()->width() > 320 )
        KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kmicromail/icons22/");
    else
        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; 
   
}