-rw-r--r-- | korganizer/main.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/korganizer/main.cpp b/korganizer/main.cpp index 6843595..a357988 100644 --- a/korganizer/main.cpp +++ b/korganizer/main.cpp | |||
@@ -28,65 +28,67 @@ int main( int argc, char **argv ) | |||
28 | QApplication::setStyle( new QPlatinumStyle ()); | 28 | QApplication::setStyle( new QPlatinumStyle ()); |
29 | #endif | 29 | #endif |
30 | bool exitHelp = false; | 30 | bool exitHelp = false; |
31 | if ( argc > 1 ) { | 31 | if ( argc > 1 ) { |
32 | QString command = argv[1]; | 32 | QString command = argv[1]; |
33 | if ( command == "-help" ){ | 33 | if ( command == "-help" ){ |
34 | printf("KO/Pi command line commands:\n"); | 34 | printf("KO/Pi command line commands:\n"); |
35 | printf(" no command: Start KO/Pi in usual way\n"); | 35 | printf(" no command: Start KO/Pi in usual way\n"); |
36 | printf(" -help: This output\n"); | 36 | printf(" -help: This output\n"); |
37 | printf("Next Option: Open or Show after start:\n"); | 37 | printf("Next Option: Open or Show after start:\n"); |
38 | printf(" -newTodo: New Todo dialog\n"); | 38 | printf(" -newTodo: New Todo dialog\n"); |
39 | printf(" -newEvent: New Event dialog\n"); | 39 | printf(" -newEvent: New Event dialog\n"); |
40 | printf(" -showList: List view\n"); | 40 | printf(" -showList: List view\n"); |
41 | printf(" -showDay: Day view\n"); | 41 | printf(" -showDay: Day view\n"); |
42 | printf(" -showWWeek: Work Week view\n"); | 42 | printf(" -showWWeek: Work Week view\n"); |
43 | printf(" -showWeek: Week view\n"); | 43 | printf(" -showWeek: Week view\n"); |
44 | printf(" -showTodo: Todo view\n"); | 44 | printf(" -showTodo: Todo view\n"); |
45 | printf(" -showJournal: Journal view\n"); | 45 | printf(" -showJournal: Journal view\n"); |
46 | printf(" -showKO: Next Days view\n"); | 46 | printf(" -showKO: Next Days view\n"); |
47 | printf(" -showWNext: What's Next view\n"); | 47 | printf(" -showWNext: What's Next view\n"); |
48 | printf(" -showNextXView: Next X View\n"); | 48 | printf(" -showNextXView: Next X View\n"); |
49 | printf(" -new[Y] and -show[X] may be used togehther\n"); | 49 | printf(" -new[Y] and -show[X] may be used togehther\n"); |
50 | printf(" KO/Pi is exiting now. Bye!\n"); | 50 | printf(" KO/Pi is exiting now. Bye!\n"); |
51 | exitHelp = true; | 51 | exitHelp = true; |
52 | } | 52 | } |
53 | } | 53 | } |
54 | if ( ! exitHelp ) { | 54 | if ( ! exitHelp ) { |
55 | KGlobal::setAppName( "korganizer" ); | 55 | KGlobal::setAppName( "korganizer" ); |
56 | 56 | ||
57 | 57 | ||
58 | QString fileName ; | 58 | QString fileName ; |
59 | #ifndef DESKTOP_VERSION | 59 | #ifndef DESKTOP_VERSION |
60 | KStandardDirs::setAppDir( Global::applicationFileName( "korganizer", "" ) ); | 60 | QString appdir = QDir::homeDirPath() + "/kdepim/apps/" + KGlobal::getAppName(); |
61 | KStandardDirs::setAppDir( appdir ); | ||
62 | |||
61 | fileName = getenv("QPEDIR"); | 63 | fileName = getenv("QPEDIR"); |
62 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); | 64 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); |
63 | #else | 65 | #else |
64 | 66 | ||
65 | #ifndef _WIN32_ | 67 | #ifndef _WIN32_ |
66 | fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; | 68 | fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; |
67 | #else | 69 | #else |
68 | fileName = qApp->applicationDirPath () + "\\kdepim\\korganizer\\"; | 70 | fileName = qApp->applicationDirPath () + "\\kdepim\\korganizer\\"; |
69 | #endif | 71 | #endif |
70 | 72 | ||
71 | KGlobal::iconLoader()->setIconPath(fileName); | 73 | KGlobal::iconLoader()->setIconPath(fileName); |
72 | 74 | ||
73 | QString appdir = QDir::homeDirPath(); | 75 | QString appdir = QDir::homeDirPath(); |
74 | //appdir = "C:\\"; | 76 | //appdir = "C:\\"; |
75 | if ( appdir.right(1) == "\\" || appdir.right(1) == "/" ) | 77 | if ( appdir.right(1) == "\\" || appdir.right(1) == "/" ) |
76 | appdir += "korganizer"; | 78 | appdir += "korganizer"; |
77 | else | 79 | else |
78 | appdir += "/korganizer"; | 80 | appdir += "/korganizer"; |
79 | KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); | 81 | KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); |
80 | // qDebug(" %s ",KStandardDirs::appDir().latin1() ); | 82 | // qDebug(" %s ",KStandardDirs::appDir().latin1() ); |
81 | #endif | 83 | #endif |
82 | QDir app_dir; | 84 | QDir app_dir; |
83 | if ( !app_dir.exists(KStandardDirs::appDir()) ) | 85 | if ( !app_dir.exists(KStandardDirs::appDir()) ) |
84 | app_dir.mkdir (KStandardDirs::appDir()); | 86 | app_dir.mkdir (KStandardDirs::appDir()); |
85 | MainWindow m; | 87 | MainWindow m; |
86 | #ifndef DESKTOP_VERSION | 88 | #ifndef DESKTOP_VERSION |
87 | QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); | 89 | QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); |
88 | a.showMainWidget(&m ); | 90 | a.showMainWidget(&m ); |
89 | #else | 91 | #else |
90 | a.setMainWidget(&m ); | 92 | a.setMainWidget(&m ); |
91 | m.show(); | 93 | m.show(); |
92 | //m.resize( 800, 600 ); | 94 | //m.resize( 800, 600 ); |