-rw-r--r-- | korganizer/main.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/korganizer/main.cpp b/korganizer/main.cpp index 211fde6..04fb234 100644 --- a/korganizer/main.cpp +++ b/korganizer/main.cpp @@ -13,32 +13,33 @@ #include <qwindowsstyle.h> #include <stdlib.h> #endif #include <qtextcodec.h> #include <qdir.h> #include <kstandarddirs.h> #include <kglobal.h> #include <stdio.h> #include "mainwindow.h" #include <libkdepim/kpimglobalprefs.h> 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 { @@ -66,32 +67,36 @@ int main( int argc, char **argv ) 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 ); |