#ifndef DESKTOP_VERSION #include #include #include //Added by qt3to4: #include #include #else #include #include #include #include #endif #include #include #include #include #include #include "mainwindow.h" #include void dumpMissing(); int main( int argc, char **argv ) { if(!getenv("KDEPIMPIDIR")) putenv("KDEPIMPIDIR=/usr/lib/kdepimpi"); if(!getenv("QPEDIR")) putenv("QPEDIR=/usr/lib/kdepimpi"); #ifndef DESKTOP_VERSION QPEApplication a( argc, argv ); a.setKeepRunning (); #else QApplication a( argc, argv ); #ifdef _WIN32_ QString hdir ( getenv( "HOME") ); if ( hdir.isEmpty() ) { QString hd ("C:/" ); //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); if ( QDir::homeDirPath().lower() == hd.lower() ) { _putenv( "HOME=C:"); //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) ); } } else { QDir app_dir; if ( !app_dir.exists(hdir) ) app_dir.mkdir (hdir); } #endif #endif bool exitHelp = false; if ( argc > 1 ) { QString command = argv[1]; if ( command == "-help" ){ printf("KO/Pi command line commands:\n"); printf(" no command: Start KO/Pi in usual way\n"); printf(" -help: This output\n"); printf("Next Option: Open or Show after start:\n"); printf(" -newTodo: New Todo dialog\n"); printf(" -newEvent: New Event dialog\n"); printf(" -showList: List view\n"); printf(" -showDay: Day view\n"); printf(" -showWWeek: Work Week view\n"); printf(" -showWeek: Week view\n"); printf(" -showTodo: Todo view\n"); printf(" -showJournal: Journal view\n"); printf(" -showKO: Next Days view\n"); printf(" -showWNext: What's Next view\n"); printf(" -showNextXView: Next X View\n"); printf(" -new[Y] and -show[X] may be used togehther\n"); printf(" KO/Pi is exiting now. Bye!\n"); exitHelp = true; } } if ( ! exitHelp ) { KGlobal::setAppName( "korganizer" ); QString fileName ; #ifndef DESKTOP_VERSION fileName = getenv("QPEDIR"); KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); #else const char *kpd = ::getenv("KDEPIMPIDIR"); if(kpd) fileName = QString(kpd) + "/korganizer/"; else fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); #endif KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); KPimGlobalPrefs::instance()->setGlobalConfig(); MainWindow m; #ifndef DESKTOP_VERSION QObject::connect( &a, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )),&m, SLOT(receiveStart( const Q3CString&, const QByteArray& ))); a.showMainWidget(&m ); #else a.setMainWidget(&m ); m.show(); //m.resize( 800, 600 ); //QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); #endif if ( argc > 1 ) { Q3CString command = argv[1]; if ( argc > 2 ) command += argv[2]; m.recieve(command, QByteArray() ); } #ifndef DESKTOP_VERSION // QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable ); #endif a.exec(); dumpMissing(); KPimGlobalPrefs::instance()->writeConfig(); } qDebug("KO: Bye! "); }