author | zautrix <zautrix> | 2004-10-23 14:56:10 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-23 14:56:10 (UTC) |
commit | a682b1d39c63cff8d709c67460569c70b661d889 (patch) (unidiff) | |
tree | dd5cb4052b07927b63bafa68b2fd6d40bce6a6dc | |
parent | 73c0cb5307a8276f628765c651ef0284b85d64de (diff) | |
download | kdepimpi-a682b1d39c63cff8d709c67460569c70b661d889.zip kdepimpi-a682b1d39c63cff8d709c67460569c70b661d889.tar.gz kdepimpi-a682b1d39c63cff8d709c67460569c70b661d889.tar.bz2 |
fixed several memory leaks
-rw-r--r-- | kaddressbook/mainembedded.cpp | 7 | ||||
-rw-r--r-- | kmicromail/main.cpp | 3 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 1 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 10 | ||||
-rw-r--r-- | korganizer/main.cpp | 3 | ||||
-rw-r--r-- | libkdepim/externalapphandler.cpp | 12 | ||||
-rw-r--r-- | libkdepim/externalapphandler.h | 2 | ||||
-rw-r--r-- | libkdepim/kpimglobalprefs.cpp | 3 | ||||
-rw-r--r-- | microkde/kdeui/klistview.cpp | 5 | ||||
-rw-r--r-- | pwmanager/pwmanager/main.cpp | 2 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwm.cpp | 2 |
11 files changed, 28 insertions, 22 deletions
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index a8816f9..547d208 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp | |||
@@ -49,51 +49,52 @@ int main( int argc, char **argv ) | |||
49 | if ( argc > 1 ) { | 49 | if ( argc > 1 ) { |
50 | QString command = argv[1]; | 50 | QString command = argv[1]; |
51 | if ( command == "-help" ){ | 51 | if ( command == "-help" ){ |
52 | printf("KA/E command line commands:\n"); | 52 | printf("KA/E command line commands:\n"); |
53 | printf(" no command: Start KA/E in usual way\n"); | 53 | printf(" no command: Start KA/E in usual way\n"); |
54 | printf(" -help: This output\n"); | 54 | printf(" -help: This output\n"); |
55 | printf(" KA/E is exiting now. Bye!\n"); | 55 | printf(" KA/E is exiting now. Bye!\n"); |
56 | exitHelp = true; | 56 | exitHelp = true; |
57 | } | 57 | } |
58 | } | 58 | } |
59 | if ( ! exitHelp ) { | 59 | if ( ! exitHelp ) { |
60 | 60 | ||
61 | KGlobal::setAppName( "kaddressbook" ); | 61 | KGlobal::setAppName( "kaddressbook" ); |
62 | #ifndef DESKTOP_VERSION | 62 | #ifndef DESKTOP_VERSION |
63 | if ( QApplication::desktop()->width() > 320 ) | 63 | if ( QApplication::desktop()->width() > 320 ) |
64 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); | 64 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); |
65 | else | 65 | else |
66 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); | 66 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); |
67 | #else | 67 | #else |
68 | QString fileName ; | 68 | QString fileName ; |
69 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; | 69 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; |
70 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); | 70 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); |
71 | QApplication::addLibraryPath ( qApp->applicationDirPath () ); | 71 | QApplication::addLibraryPath ( qApp->applicationDirPath () ); |
72 | 72 | ||
73 | #endif | 73 | #endif |
74 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); | 74 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); |
75 | // init language | 75 | // init language |
76 | KABPrefs::instance(); | 76 | KABPrefs::instance(); |
77 | KAddressBookMain m ; | 77 | KAddressBookMain m ; |
78 | //US MainWindow m; | 78 | //US MainWindow m; |
79 | QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 79 | QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
80 | 80 | ||
81 | { | 81 | |
82 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 82 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
83 | } | 83 | |
84 | #ifndef DESKTOP_VERSION | 84 | #ifndef DESKTOP_VERSION |
85 | a.showMainWidget( &m ); | 85 | a.showMainWidget( &m ); |
86 | 86 | ||
87 | #else | 87 | #else |
88 | a.setMainWidget( &m ); | 88 | a.setMainWidget( &m ); |
89 | m.resize (640, 480 ); | 89 | m.resize (640, 480 ); |
90 | m.show(); | 90 | m.show(); |
91 | #endif | 91 | #endif |
92 | a.exec(); | 92 | a.exec(); |
93 | 93 | ||
94 | dumpMissing(); | 94 | dumpMissing(); |
95 | 95 | ||
96 | KPimGlobalPrefs::instance()->writeConfig(); | ||
96 | } | 97 | } |
97 | qDebug("KA: Bye! "); | 98 | qDebug("KA: Bye! "); |
98 | } | 99 | } |
99 | 100 | ||
diff --git a/kmicromail/main.cpp b/kmicromail/main.cpp index 8947ff8..8341c5a 100644 --- a/kmicromail/main.cpp +++ b/kmicromail/main.cpp | |||
@@ -1,63 +1,66 @@ | |||
1 | // CHANGED 2004-08-06 Lutz Rogowski | 1 | // CHANGED 2004-08-06 Lutz Rogowski |
2 | 2 | ||
3 | 3 | ||
4 | #ifndef DESKTOP_VERSION | 4 | #ifndef DESKTOP_VERSION |
5 | #include <qpe/qpeapplication.h> | 5 | #include <qpe/qpeapplication.h> |
6 | #include <libkdepim/externalapphandler.h> | 6 | #include <libkdepim/externalapphandler.h> |
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | #else | 8 | #else |
9 | #include <qapplication.h> | 9 | #include <qapplication.h> |
10 | #include <qstring.h> | 10 | #include <qstring.h> |
11 | #include <qwindowsstyle.h> | 11 | #include <qwindowsstyle.h> |
12 | #include <qplatinumstyle.h> | 12 | #include <qplatinumstyle.h> |
13 | #include <qsgistyle.h> | 13 | #include <qsgistyle.h> |
14 | #endif | 14 | #endif |
15 | #include "opiemail.h" | 15 | #include "opiemail.h" |
16 | #include <qdir.h> | 16 | #include <qdir.h> |
17 | #include <kstandarddirs.h> | 17 | #include <kstandarddirs.h> |
18 | #include <kglobal.h> | 18 | #include <kglobal.h> |
19 | #include <stdio.h> | 19 | #include <stdio.h> |
20 | #include "mainwindow.h" | 20 | #include "mainwindow.h" |
21 | #include "koprefs.h" | 21 | #include "koprefs.h" |
22 | #include <libkdepim/kpimglobalprefs.h> | ||
22 | void dumpMissing(); | 23 | void dumpMissing(); |
23 | //using namespace Opie::Core; | 24 | //using namespace Opie::Core; |
24 | int main( int argc, char **argv ) { | 25 | int main( int argc, char **argv ) { |
25 | 26 | ||
26 | #ifndef DESKTOP_VERSION | 27 | #ifndef DESKTOP_VERSION |
27 | QPEApplication a( argc, argv ); | 28 | QPEApplication a( argc, argv ); |
28 | a.setKeepRunning (); | 29 | a.setKeepRunning (); |
29 | #else | 30 | #else |
30 | QApplication a( argc, argv ); | 31 | QApplication a( argc, argv ); |
31 | QApplication::setStyle( new QPlatinumStyle ()); | 32 | QApplication::setStyle( new QPlatinumStyle ()); |
32 | #endif | 33 | #endif |
33 | a.setFont( KOPrefs::instance()->mAppFont ); | 34 | a.setFont( KOPrefs::instance()->mAppFont ); |
34 | KGlobal::setAppName( "kopiemail" ); | 35 | KGlobal::setAppName( "kopiemail" ); |
35 | QString fileName ; | 36 | QString fileName ; |
36 | #ifndef DESKTOP_VERSION | 37 | #ifndef DESKTOP_VERSION |
37 | fileName = getenv("QPEDIR"); | 38 | fileName = getenv("QPEDIR"); |
38 | if ( QApplication::desktop()->width() > 320 ) | 39 | if ( QApplication::desktop()->width() > 320 ) |
39 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kopiemail/icons22/"); | 40 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kopiemail/icons22/"); |
40 | else | 41 | else |
41 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kopiemail/"); | 42 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kopiemail/"); |
42 | #else | 43 | #else |
43 | fileName = qApp->applicationDirPath () + "/kdepim/kopiemail/"; | 44 | fileName = qApp->applicationDirPath () + "/kdepim/kopiemail/"; |
44 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); | 45 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); |
45 | #endif | 46 | #endif |
46 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kopiemail"))); | 47 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kopiemail"))); |
47 | OpieMail mw; | 48 | OpieMail mw; |
48 | #ifndef DESKTOP_VERSION | 49 | #ifndef DESKTOP_VERSION |
49 | //qDebug("CONNECT "); | 50 | //qDebug("CONNECT "); |
50 | QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&mw, SLOT(message( const QCString&, const QByteArray& ))); | 51 | QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&mw, SLOT(message( const QCString&, const QByteArray& ))); |
51 | // QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 52 | // QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
52 | a.showMainWidget(&mw ); | 53 | a.showMainWidget(&mw ); |
53 | #else | 54 | #else |
54 | a.setMainWidget(&mw ); | 55 | a.setMainWidget(&mw ); |
55 | mw.show(); | 56 | mw.show(); |
56 | //m.resize( 800, 600 ); | 57 | //m.resize( 800, 600 ); |
57 | QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); | 58 | QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); |
58 | #endif | 59 | #endif |
59 | int rv = a.exec(); | 60 | int rv = a.exec(); |
60 | dumpMissing(); | 61 | dumpMissing(); |
62 | |||
63 | KPimGlobalPrefs::instance()->writeConfig(); | ||
61 | return rv; | 64 | return rv; |
62 | 65 | ||
63 | } | 66 | } |
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index d3aa650..3d4acb7 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -977,64 +977,65 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) | |||
977 | case Qt::Key_Return: | 977 | case Qt::Key_Return: |
978 | case Qt::Key_Enter: | 978 | case Qt::Key_Enter: |
979 | { | 979 | { |
980 | QListViewItem* cn; | 980 | QListViewItem* cn; |
981 | cn = currentItem(); | 981 | cn = currentItem(); |
982 | if ( cn ) { | 982 | if ( cn ) { |
983 | KOListViewItem* ci = (KOListViewItem*)( cn ); | 983 | KOListViewItem* ci = (KOListViewItem*)( cn ); |
984 | if ( ci ){ | 984 | if ( ci ){ |
985 | if ( e->state() == ShiftButton ) | 985 | if ( e->state() == ShiftButton ) |
986 | ci->setSelected( false ); | 986 | ci->setSelected( false ); |
987 | else | 987 | else |
988 | ci->setSelected( true ); | 988 | ci->setSelected( true ); |
989 | cn = cn->nextSibling(); | 989 | cn = cn->nextSibling(); |
990 | if ( cn ) { | 990 | if ( cn ) { |
991 | setCurrentItem ( cn ); | 991 | setCurrentItem ( cn ); |
992 | ensureItemVisible ( cn ); | 992 | ensureItemVisible ( cn ); |
993 | } | 993 | } |
994 | } | 994 | } |
995 | } | 995 | } |
996 | e->accept(); | 996 | e->accept(); |
997 | } | 997 | } |
998 | break; | 998 | break; |
999 | default: | 999 | default: |
1000 | e->ignore(); | 1000 | e->ignore(); |
1001 | } | 1001 | } |
1002 | } | 1002 | } |
1003 | KOListViewListView::KOListViewListView(KOListView * lv ) | 1003 | KOListViewListView::KOListViewListView(KOListView * lv ) |
1004 | : KListView( lv ) | 1004 | : KListView( lv ) |
1005 | { | 1005 | { |
1006 | #ifndef DESKTOP_VERSION | 1006 | #ifndef DESKTOP_VERSION |
1007 | QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); | 1007 | QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); |
1008 | #endif | 1008 | #endif |
1009 | mYMousePos = -1000; | ||
1009 | setSelectionMode( QListView::Multi ); | 1010 | setSelectionMode( QListView::Multi ); |
1010 | setMultiSelection( true); | 1011 | setMultiSelection( true); |
1011 | mAllowPopupMenu = true; | 1012 | mAllowPopupMenu = true; |
1012 | mMouseDown = false; | 1013 | mMouseDown = false; |
1013 | 1014 | ||
1014 | } | 1015 | } |
1015 | void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) | 1016 | void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) |
1016 | { | 1017 | { |
1017 | if (!e) return; | 1018 | if (!e) return; |
1018 | QPoint vp = contentsToViewport(e->pos()); | 1019 | QPoint vp = contentsToViewport(e->pos()); |
1019 | QListViewItem *item = itemAt(vp); | 1020 | QListViewItem *item = itemAt(vp); |
1020 | if (!item) { | 1021 | if (!item) { |
1021 | emit newEvent(); | 1022 | emit newEvent(); |
1022 | return; | 1023 | return; |
1023 | } | 1024 | } |
1024 | KListView::contentsMouseDoubleClickEvent(e); | 1025 | KListView::contentsMouseDoubleClickEvent(e); |
1025 | } | 1026 | } |
1026 | 1027 | ||
1027 | 1028 | ||
1028 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) | 1029 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) |
1029 | { | 1030 | { |
1030 | //qDebug("contentsMousePressEvent++++ "); | 1031 | //qDebug("contentsMousePressEvent++++ "); |
1031 | if (! mMouseDown ) { | 1032 | if (! mMouseDown ) { |
1032 | mAllowPopupMenu = true; | 1033 | mAllowPopupMenu = true; |
1033 | mYMousePos = mapToGlobal( (e->pos())).y(); | 1034 | mYMousePos = mapToGlobal( (e->pos())).y(); |
1034 | } | 1035 | } |
1035 | if ( e->button() == RightButton && mMouseDown ) | 1036 | if ( e->button() == RightButton && mMouseDown ) |
1036 | return; | 1037 | return; |
1037 | if ( e->button() == LeftButton ) | 1038 | if ( e->button() == LeftButton ) |
1038 | mMouseDown = true; | 1039 | mMouseDown = true; |
1039 | KListView::contentsMousePressEvent( e ); | 1040 | KListView::contentsMousePressEvent( e ); |
1040 | } | 1041 | } |
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index f44debc..8dca3ae 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -138,75 +138,65 @@ KOPrefs::KOPrefs() : | |||
138 | KPrefs::setCurrentGroup("Time & Date"); | 138 | KPrefs::setCurrentGroup("Time & Date"); |
139 | 139 | ||
140 | 140 | ||
141 | addItemInt("Default Start Time",&mStartTime,10); | 141 | addItemInt("Default Start Time",&mStartTime,10); |
142 | addItemInt("Default Duration",&mDefaultDuration,2); | 142 | addItemInt("Default Duration",&mDefaultDuration,2); |
143 | addItemInt("Default Alarm Time",&mAlarmTime,3); | 143 | addItemInt("Default Alarm Time",&mAlarmTime,3); |
144 | KPrefs::setCurrentGroup("AlarmSettings"); | 144 | KPrefs::setCurrentGroup("AlarmSettings"); |
145 | addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); | 145 | addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); |
146 | addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); | 146 | addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); |
147 | addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); | 147 | addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); |
148 | addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); | 148 | addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); |
149 | 149 | ||
150 | 150 | ||
151 | KPrefs::setCurrentGroup("Calendar"); | 151 | KPrefs::setCurrentGroup("Calendar"); |
152 | 152 | ||
153 | addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); | 153 | addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); |
154 | 154 | ||
155 | KPrefs::setCurrentGroup("Fonts"); | 155 | KPrefs::setCurrentGroup("Fonts"); |
156 | // qDebug(" KPrefs::setCurrentGroup(Fonts); "); | 156 | // qDebug(" KPrefs::setCurrentGroup(Fonts); "); |
157 | addItemFont("TimeBar Font",&mTimeBarFont); | 157 | addItemFont("TimeBar Font",&mTimeBarFont); |
158 | addItemFont("MonthView Font",&mMonthViewFont); | 158 | addItemFont("MonthView Font",&mMonthViewFont); |
159 | addItemFont("AgendaView Font",&mAgendaViewFont); | 159 | addItemFont("AgendaView Font",&mAgendaViewFont); |
160 | addItemFont("MarcusBains Font",&mMarcusBainsFont); | 160 | addItemFont("MarcusBains Font",&mMarcusBainsFont); |
161 | addItemFont("TimeLabels Font",&mTimeLabelsFont); | 161 | addItemFont("TimeLabels Font",&mTimeLabelsFont); |
162 | addItemFont("TodoView Font",&mTodoViewFont); | 162 | addItemFont("TodoView Font",&mTodoViewFont); |
163 | addItemFont("ListView Font",&mListViewFont); | 163 | addItemFont("ListView Font",&mListViewFont); |
164 | addItemFont("DateNavigator Font",&mDateNavigatorFont); | 164 | addItemFont("DateNavigator Font",&mDateNavigatorFont); |
165 | addItemFont("EditBox Font",&mEditBoxFont); | 165 | addItemFont("EditBox Font",&mEditBoxFont); |
166 | addItemFont("JournalView Font",&mJornalViewFont); | 166 | addItemFont("JournalView Font",&mJornalViewFont); |
167 | addItemFont("WhatsNextView Font",&mWhatsNextFont); | 167 | addItemFont("WhatsNextView Font",&mWhatsNextFont); |
168 | addItemFont("EventView Font",&mEventViewFont); | 168 | addItemFont("EventView Font",&mEventViewFont); |
169 | 169 | ||
170 | // KPrefs::setCurrentGroup("SyncProfiles"); | ||
171 | // addItemString("LocalMachineName",&mLocalMachineName, "undefined"); | ||
172 | // addItemStringList("SyncProfileNames",&mSyncProfileNames); | ||
173 | // addItemStringList("ExternSyncProfiles",&mExternSyncProfileNames); | ||
174 | |||
175 | KPrefs::setCurrentGroup("RemoteSyncing"); | 170 | KPrefs::setCurrentGroup("RemoteSyncing"); |
176 | // addItemBool("UsePasswd",&mUsePassWd,false); | ||
177 | // addItemBool("WriteBackFile",&mWriteBackFile,true); | ||
178 | // addItemBool("WriteBackExistingOnly",&mWriteBackExistingOnly,false); | ||
179 | // addItemBool("AskForPreferences",&mAskForPreferences,true); | ||
180 | // addItemBool("ShowSyncSummary",&mShowSyncSummary,true); | ||
181 | addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); | 171 | addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); |
182 | addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); | 172 | addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); |
183 | addItemBool("ShowSyncEvents",&mShowSyncEvents,false); | 173 | addItemBool("ShowSyncEvents",&mShowSyncEvents,false); |
184 | addItemInt("LastSyncTime",&mLastSyncTime,0); | 174 | addItemInt("LastSyncTime",&mLastSyncTime,0); |
185 | 175 | ||
186 | #ifdef _WIN32_ | 176 | #ifdef _WIN32_ |
187 | QString hdp= locateLocal("data","korganizer")+"\\\\"; | 177 | QString hdp= locateLocal("data","korganizer")+"\\\\"; |
188 | #else | 178 | #else |
189 | QString hdp= locateLocal("data","korganizer")+"/"; | 179 | QString hdp= locateLocal("data","korganizer")+"/"; |
190 | #endif | 180 | #endif |
191 | 181 | ||
192 | KPrefs::setCurrentGroup("LoadSaveFileNames"); | 182 | KPrefs::setCurrentGroup("LoadSaveFileNames"); |
193 | 183 | ||
194 | addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); | 184 | addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); |
195 | addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); | 185 | addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); |
196 | addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); | 186 | addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); |
197 | addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); | 187 | addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); |
198 | 188 | ||
199 | 189 | ||
200 | KPrefs::setCurrentGroup("Locale"); | 190 | KPrefs::setCurrentGroup("Locale"); |
201 | addItemBool("ShortDateInViewer",&mShortDateInViewer,false); | 191 | addItemBool("ShortDateInViewer",&mShortDateInViewer,false); |
202 | 192 | ||
203 | 193 | ||
204 | KPrefs::setCurrentGroup("Colors"); | 194 | KPrefs::setCurrentGroup("Colors"); |
205 | addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); | 195 | addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); |
206 | addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); | 196 | addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); |
207 | addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); | 197 | addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); |
208 | addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); | 198 | addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); |
209 | addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); | 199 | addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); |
210 | addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); | 200 | addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); |
211 | addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); | 201 | addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); |
212 | addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); | 202 | addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); |
diff --git a/korganizer/main.cpp b/korganizer/main.cpp index 4194d12..2481ca4 100644 --- a/korganizer/main.cpp +++ b/korganizer/main.cpp | |||
@@ -1,53 +1,54 @@ | |||
1 | 1 | ||
2 | 2 | ||
3 | #ifndef DESKTOP_VERSION | 3 | #ifndef DESKTOP_VERSION |
4 | #include <qpe/qpeapplication.h> | 4 | #include <qpe/qpeapplication.h> |
5 | #include <qcopchannel_qws.h> | 5 | #include <qcopchannel_qws.h> |
6 | #include <qpe/global.h> | 6 | #include <qpe/global.h> |
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | #else | 8 | #else |
9 | #include <qapplication.h> | 9 | #include <qapplication.h> |
10 | #include <qstring.h> | 10 | #include <qstring.h> |
11 | #include <qwindowsstyle.h> | 11 | #include <qwindowsstyle.h> |
12 | #include <qplatinumstyle.h> | 12 | #include <qplatinumstyle.h> |
13 | #include <qsgistyle.h> | 13 | #include <qsgistyle.h> |
14 | #endif | 14 | #endif |
15 | #include <qtextcodec.h> | 15 | #include <qtextcodec.h> |
16 | 16 | ||
17 | #include <qdir.h> | 17 | #include <qdir.h> |
18 | #include <kstandarddirs.h> | 18 | #include <kstandarddirs.h> |
19 | #include <kglobal.h> | 19 | #include <kglobal.h> |
20 | #include <stdio.h> | 20 | #include <stdio.h> |
21 | #include "mainwindow.h" | 21 | #include "mainwindow.h" |
22 | #include <libkdepim/kpimglobalprefs.h> | ||
22 | void dumpMissing(); | 23 | void dumpMissing(); |
23 | int main( int argc, char **argv ) | 24 | int main( int argc, char **argv ) |
24 | { | 25 | { |
25 | #ifndef DESKTOP_VERSION | 26 | #ifndef DESKTOP_VERSION |
26 | QPEApplication a( argc, argv ); | 27 | QPEApplication a( argc, argv ); |
27 | a.setKeepRunning (); | 28 | a.setKeepRunning (); |
28 | #else | 29 | #else |
29 | QApplication a( argc, argv ); | 30 | QApplication a( argc, argv ); |
30 | QApplication::setStyle( new QPlatinumStyle ()); | 31 | QApplication::setStyle( new QPlatinumStyle ()); |
31 | QString hdir = QDir::homeDirPath(); | 32 | QString hdir = QDir::homeDirPath(); |
32 | // there is a bug when creating dirs for WIN 98 | 33 | // there is a bug when creating dirs for WIN 98 |
33 | // it is difficult to fix, because we have no WIN 98 runnung | 34 | // it is difficult to fix, because we have no WIN 98 runnung |
34 | // such that we try it to create the dirs at startup here | 35 | // such that we try it to create the dirs at startup here |
35 | if ( hdir == "C:\\" ) { // win 98 or ME | 36 | if ( hdir == "C:\\" ) { // win 98 or ME |
36 | QDir app_dir; | 37 | QDir app_dir; |
37 | if ( !app_dir.exists("C:\\kdepim") ) | 38 | if ( !app_dir.exists("C:\\kdepim") ) |
38 | app_dir.mkdir ("C:\\kdepim"); | 39 | app_dir.mkdir ("C:\\kdepim"); |
39 | if ( !app_dir.exists("C:\\kdepim\\apps") ) | 40 | if ( !app_dir.exists("C:\\kdepim\\apps") ) |
40 | app_dir.mkdir ("C:\\kdepim\\apps"); | 41 | app_dir.mkdir ("C:\\kdepim\\apps"); |
41 | if ( !app_dir.exists("C:\\kdepim\\config") ) | 42 | if ( !app_dir.exists("C:\\kdepim\\config") ) |
42 | app_dir.mkdir ("C:\\kdepim\\config"); | 43 | app_dir.mkdir ("C:\\kdepim\\config"); |
43 | if ( !app_dir.exists("C:\\kdepim\\apps\\korganizer") ) | 44 | if ( !app_dir.exists("C:\\kdepim\\apps\\korganizer") ) |
44 | app_dir.mkdir ("C:\\kdepim\\apps\\korganizer"); | 45 | app_dir.mkdir ("C:\\kdepim\\apps\\korganizer"); |
45 | } | 46 | } |
46 | #endif | 47 | #endif |
47 | bool exitHelp = false; | 48 | bool exitHelp = false; |
48 | if ( argc > 1 ) { | 49 | if ( argc > 1 ) { |
49 | QString command = argv[1]; | 50 | QString command = argv[1]; |
50 | if ( command == "-help" ){ | 51 | if ( command == "-help" ){ |
51 | printf("KO/Pi command line commands:\n"); | 52 | printf("KO/Pi command line commands:\n"); |
52 | printf(" no command: Start KO/Pi in usual way\n"); | 53 | printf(" no command: Start KO/Pi in usual way\n"); |
53 | printf(" -help: This output\n"); | 54 | printf(" -help: This output\n"); |
@@ -72,35 +73,37 @@ int main( int argc, char **argv ) | |||
72 | KGlobal::setAppName( "korganizer" ); | 73 | KGlobal::setAppName( "korganizer" ); |
73 | QString fileName ; | 74 | QString fileName ; |
74 | #ifndef DESKTOP_VERSION | 75 | #ifndef DESKTOP_VERSION |
75 | fileName = getenv("QPEDIR"); | 76 | fileName = getenv("QPEDIR"); |
76 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); | 77 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); |
77 | #else | 78 | #else |
78 | fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; | 79 | fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; |
79 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); | 80 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); |
80 | #endif | 81 | #endif |
81 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); | 82 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); |
82 | MainWindow m; | 83 | MainWindow m; |
83 | #ifndef DESKTOP_VERSION | 84 | #ifndef DESKTOP_VERSION |
84 | 85 | ||
85 | QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); | 86 | QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); |
86 | a.showMainWidget(&m ); | 87 | a.showMainWidget(&m ); |
87 | #else | 88 | #else |
88 | a.setMainWidget(&m ); | 89 | a.setMainWidget(&m ); |
89 | m.show(); | 90 | m.show(); |
90 | //m.resize( 800, 600 ); | 91 | //m.resize( 800, 600 ); |
91 | QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); | 92 | QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); |
92 | #endif | 93 | #endif |
93 | if ( argc > 1 ) { | 94 | if ( argc > 1 ) { |
94 | QCString command = argv[1]; | 95 | QCString command = argv[1]; |
95 | if ( argc > 2 ) | 96 | if ( argc > 2 ) |
96 | command += argv[2]; | 97 | command += argv[2]; |
97 | qApp->processEvents(); | 98 | qApp->processEvents(); |
98 | m.recieve(command, QByteArray() ); | 99 | m.recieve(command, QByteArray() ); |
99 | 100 | ||
100 | } | 101 | } |
101 | 102 | ||
102 | a.exec(); | 103 | a.exec(); |
103 | dumpMissing(); | 104 | dumpMissing(); |
105 | |||
106 | KPimGlobalPrefs::instance()->writeConfig(); | ||
104 | } | 107 | } |
105 | qDebug("KO: Bye! "); | 108 | qDebug("KO: Bye! "); |
106 | } | 109 | } |
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp index 779b20e..9085673 100644 --- a/libkdepim/externalapphandler.cpp +++ b/libkdepim/externalapphandler.cpp | |||
@@ -32,65 +32,65 @@ $Id$ | |||
32 | #include <qfile.h> | 32 | #include <qfile.h> |
33 | #include <qmap.h> | 33 | #include <qmap.h> |
34 | #include <qregexp.h> | 34 | #include <qregexp.h> |
35 | 35 | ||
36 | #ifndef DESKTOP_VERSION | 36 | #ifndef DESKTOP_VERSION |
37 | #include <qpe/qpeapplication.h> | 37 | #include <qpe/qpeapplication.h> |
38 | #include <qtopia/qcopenvelope_qws.h> | 38 | #include <qtopia/qcopenvelope_qws.h> |
39 | #else | 39 | #else |
40 | #include <qapplication.h> | 40 | #include <qapplication.h> |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | #include <kstaticdeleter.h> | 43 | #include <kstaticdeleter.h> |
44 | #include <kmessagebox.h> | 44 | #include <kmessagebox.h> |
45 | 45 | ||
46 | 46 | ||
47 | #include "externalapphandler.h" | 47 | #include "externalapphandler.h" |
48 | 48 | ||
49 | #include "kpimglobalprefs.h" | 49 | #include "kpimglobalprefs.h" |
50 | 50 | ||
51 | //uncomment line to get debug output | 51 | //uncomment line to get debug output |
52 | //#define DEBUG_EXT_APP_HANDLER | 52 | //#define DEBUG_EXT_APP_HANDLER |
53 | 53 | ||
54 | /********************************************************************************* | 54 | /********************************************************************************* |
55 | * | 55 | * |
56 | ********************************************************************************/ | 56 | ********************************************************************************/ |
57 | 57 | ||
58 | 58 | ||
59 | QCopTransferItem::QCopTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) | 59 | QCopTransferItem::QCopTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) |
60 | : _usedSourceParameters(usedSourceParameters), _sourceMessage(sourceMessage), _targetChannel(targetChannel), _targetMessage(targetMessage) | 60 | : _usedSourceParameters(usedSourceParameters), _sourceMessage(sourceMessage), _targetChannel(targetChannel), _targetMessage(targetMessage) |
61 | { | 61 | { |
62 | //sourceMessage passes later three parameters: sourceChannel, uid, param1 | 62 | //sourceMessage passes later three parameters: sourceChannel, uid, param1 |
63 | if (_usedSourceParameters == 0) | 63 | if (_usedSourceParameters == 0) |
64 | _sourceMessageParameters = "(QString,QString)"; | 64 | _sourceMessageParameters = "QString,QString)"; |
65 | else if (_usedSourceParameters == 1) | 65 | else if (_usedSourceParameters == 1) |
66 | _sourceMessageParameters = "(QString,QString,QString)"; | 66 | _sourceMessageParameters = "(QString,QString,QString)"; |
67 | else if (_usedSourceParameters == 2) | 67 | else if (_usedSourceParameters == 2) |
68 | _sourceMessageParameters = "(QString,QString,QString,QString)"; | 68 | _sourceMessageParameters = "(QString,QString,QString,QString)"; |
69 | else if (_usedSourceParameters == 3) | 69 | else if (_usedSourceParameters == 3) |
70 | _sourceMessageParameters = "(QString,QString,QString,QString,QString)"; | 70 | _sourceMessageParameters = "(QString,QString,QString,QString,QString)"; |
71 | } | 71 | } |
72 | 72 | ||
73 | /*********************************************************************************/ | 73 | /*********************************************************************************/ |
74 | 74 | ||
75 | QCopTransferItem::QCopTransferItem() | 75 | QCopTransferItem::QCopTransferItem() |
76 | { | 76 | { |
77 | } | 77 | } |
78 | 78 | ||
79 | /*********************************************************************************/ | 79 | /*********************************************************************************/ |
80 | bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& param1, const QString& param2, const QString& param3) | 80 | bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& param1, const QString& param2, const QString& param3) |
81 | { | 81 | { |
82 | 82 | ||
83 | #ifndef DESKTOP_VERSION | 83 | #ifndef DESKTOP_VERSION |
84 | //sourceMessage passes two parameters: sourceChannel, uid | 84 | //sourceMessage passes two parameters: sourceChannel, uid |
85 | QString sourceMessage = _sourceMessage + _sourceMessageParameters; | 85 | QString sourceMessage = _sourceMessage + _sourceMessageParameters; |
86 | #ifdef DEBUG_EXT_APP_HANDLER | 86 | #ifdef DEBUG_EXT_APP_HANDLER |
87 | qDebug("1Using QCopEnvelope e(\"%s\",\"%s\")", _targetChannel.latin1(), sourceMessage.latin1()); | 87 | qDebug("1Using QCopEnvelope e(\"%s\",\"%s\")", _targetChannel.latin1(), sourceMessage.latin1()); |
88 | qDebug("passing sourcechannel(%s), uid(%s), param1(%s), param2(%s), param3(%s) as parameter to QCopEnvelope", _sourceChannel.latin1(), uid.latin1(), param1.latin1(), param2.latin1(), param3.latin1()); | 88 | qDebug("passing sourcechannel(%s), uid(%s), param1(%s), param2(%s), param3(%s) as parameter to QCopEnvelope", _sourceChannel.latin1(), uid.latin1(), param1.latin1(), param2.latin1(), param3.latin1()); |
89 | #endif | 89 | #endif |
90 | 90 | ||
91 | QCopEnvelope e(_targetChannel.latin1(), sourceMessage.latin1()); | 91 | QCopEnvelope e(_targetChannel.latin1(), sourceMessage.latin1()); |
92 | 92 | ||
93 | e << _sourceChannel << uid; | 93 | e << _sourceChannel << uid; |
94 | 94 | ||
95 | if (_usedSourceParameters == 1) | 95 | if (_usedSourceParameters == 1) |
96 | e << param1; | 96 | e << param1; |
@@ -228,64 +228,68 @@ bool QCopMapTransferItem::appMessage( const QCString& cmsg, const QByteArray& da | |||
228 | { | 228 | { |
229 | bool res = QCopTransferItem::appMessage( cmsg, data ); | 229 | bool res = QCopTransferItem::appMessage( cmsg, data ); |
230 | 230 | ||
231 | if (res == false) | 231 | if (res == false) |
232 | { | 232 | { |
233 | QDataStream stream( data, IO_ReadOnly ); | 233 | QDataStream stream( data, IO_ReadOnly ); |
234 | 234 | ||
235 | // qDebug("QCopMapTransferItem- QCOP message received: %s ", cmsg.data() ); | 235 | // qDebug("QCopMapTransferItem- QCOP message received: %s ", cmsg.data() ); |
236 | 236 | ||
237 | //we are in the source and get an answer from the target | 237 | //we are in the source and get an answer from the target |
238 | if ((_targetMessage + _targetMessageParameters) == cmsg.data()) | 238 | if ((_targetMessage + _targetMessageParameters) == cmsg.data()) |
239 | { | 239 | { |
240 | QMap<QString,QString> adrMap; | 240 | QMap<QString,QString> adrMap; |
241 | QString uid; | 241 | QString uid; |
242 | 242 | ||
243 | stream >> uid >> adrMap; | 243 | stream >> uid >> adrMap; |
244 | 244 | ||
245 | emit receivedMessageFromTarget(uid, adrMap); | 245 | emit receivedMessageFromTarget(uid, adrMap); |
246 | 246 | ||
247 | 247 | ||
248 | return true; | 248 | return true; |
249 | } | 249 | } |
250 | } | 250 | } |
251 | 251 | ||
252 | return false; | 252 | return false; |
253 | } | 253 | } |
254 | 254 | ||
255 | 255 | ||
256 | /********************************************************************************* | 256 | /********************************************************************************* |
257 | * | 257 | * |
258 | ********************************************************************************/ | 258 | ********************************************************************************/ |
259 | 259 | ||
260 | QCopListTransferItem::~QCopListTransferItem() | ||
261 | { | ||
262 | |||
263 | } | ||
260 | 264 | ||
261 | QCopListTransferItem::QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) | 265 | QCopListTransferItem::QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage) |
262 | : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage) | 266 | : QCopTransferItem(usedSourceParameters, sourceMessage, targetChannel,targetMessage) |
263 | { | 267 | { |
264 | //targetMessage returns later two parameters: uid, and three lists | 268 | //targetMessage returns later two parameters: uid, and three lists |
265 | _targetMessageParameters = "(QString,QStringList,QStringList,QStringList,QStringList,QStringList,QStringList)"; | 269 | _targetMessageParameters = "(QString,QStringList,QStringList,QStringList,QStringList,QStringList,QStringList)"; |
266 | } | 270 | } |
267 | 271 | ||
268 | /*********************************************************************************/ | 272 | /*********************************************************************************/ |
269 | bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6) | 273 | bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6) |
270 | { | 274 | { |
271 | #ifndef DESKTOP_VERSION | 275 | #ifndef DESKTOP_VERSION |
272 | //targetMessage passes two parameters: uid, map | 276 | //targetMessage passes two parameters: uid, map |
273 | QString targetMessage = _targetMessage + _targetMessageParameters; | 277 | QString targetMessage = _targetMessage + _targetMessageParameters; |
274 | 278 | ||
275 | #ifdef DEBUG_EXT_APP_HANDLER | 279 | #ifdef DEBUG_EXT_APP_HANDLER |
276 | qDebug("3Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1()); | 280 | qDebug("3Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1()); |
277 | qDebug("passing uid(%s) and list1, list2, list3, list4, list5, list6 as parameter to QCopEnvelope", uid.latin1()); | 281 | qDebug("passing uid(%s) and list1, list2, list3, list4, list5, list6 as parameter to QCopEnvelope", uid.latin1()); |
278 | 282 | ||
279 | 283 | ||
280 | for ( int i = 0; i < list3.count(); i++) | 284 | for ( int i = 0; i < list3.count(); i++) |
281 | qDebug("listentry list3: %s",list3[i].latin1()); | 285 | qDebug("listentry list3: %s",list3[i].latin1()); |
282 | #endif | 286 | #endif |
283 | 287 | ||
284 | QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1()); | 288 | QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1()); |
285 | //US we need no names in the To field. The emailadresses are enough | 289 | //US we need no names in the To field. The emailadresses are enough |
286 | 290 | ||
287 | e << uid << list1 << list2 << list3 << list4 << list5 << list6; | 291 | e << uid << list1 << list2 << list3 << list4 << list5 << list6; |
288 | 292 | ||
289 | qApp->processEvents(); | 293 | qApp->processEvents(); |
290 | 294 | ||
291 | return true; | 295 | return true; |
@@ -346,65 +350,69 @@ bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& d | |||
346 | * | 350 | * |
347 | ********************************************************************************/ | 351 | ********************************************************************************/ |
348 | 352 | ||
349 | 353 | ||
350 | ExternalAppHandler *ExternalAppHandler::sInstance = 0; | 354 | ExternalAppHandler *ExternalAppHandler::sInstance = 0; |
351 | static KStaticDeleter<ExternalAppHandler> staticDeleter; | 355 | static KStaticDeleter<ExternalAppHandler> staticDeleter; |
352 | 356 | ||
353 | ExternalAppHandler::ExternalAppHandler() | 357 | ExternalAppHandler::ExternalAppHandler() |
354 | { | 358 | { |
355 | mDefaultItems.setAutoDelete(true); | 359 | mDefaultItems.setAutoDelete(true); |
356 | 360 | ||
357 | mNameEmailUidListFromKAPITransfer = new QCopListTransferItem(0, "requestNameEmailUIDListFromKAPI", "QPE/Application/kapi", "receiveNameEmailUIDList"); | 361 | mNameEmailUidListFromKAPITransfer = new QCopListTransferItem(0, "requestNameEmailUIDListFromKAPI", "QPE/Application/kapi", "receiveNameEmailUIDList"); |
358 | connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForNameEmailUidList(const QString&, const QString&))); | 362 | connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForNameEmailUidList(const QString&, const QString&))); |
359 | connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), this, SLOT (receivedNameEmailUidList_Slot(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); | 363 | connect(mNameEmailUidListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), this, SLOT (receivedNameEmailUidList_Slot(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); |
360 | 364 | ||
361 | //US mFindByEmailFromKAPITransfer = new QCopListTransferItem(1, "requestFindByEmailFromKAPI", "QPE/Application/kapi", "receiveFindByEmailNameEmailUIDList"); | 365 | //US mFindByEmailFromKAPITransfer = new QCopListTransferItem(1, "requestFindByEmailFromKAPI", "QPE/Application/kapi", "receiveFindByEmailNameEmailUIDList"); |
362 | //US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&)), this, SIGNAL (requestForFindByEmail(const QString&, const QString&, const QString&))); | 366 | //US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&)), this, SIGNAL (requestForFindByEmail(const QString&, const QString&, const QString&))); |
363 | //US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedFindByEmailEvent(const QString&, const QStringList&, const QStringList&, const QStringList&))); | 367 | //US connect(mFindByEmailFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedFindByEmailEvent(const QString&, const QStringList&, const QStringList&, const QStringList&))); |
364 | 368 | ||
365 | mDisplayDetails = new QCopListTransferItem(3, "requestDisplayDetailsFromKAPI", "QPE/Application/kapi", ""); | 369 | mDisplayDetails = new QCopListTransferItem(3, "requestDisplayDetailsFromKAPI", "QPE/Application/kapi", ""); |
366 | connect(mDisplayDetails, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&, const QString&, const QString&)), this, SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); | 370 | connect(mDisplayDetails, SIGNAL (receivedMessageFromSource(const QString&, const QString&, const QString&, const QString&, const QString&)), this, SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); |
367 | 371 | ||
368 | 372 | ||
369 | 373 | ||
370 | mBirthdayListFromKAPITransfer = new QCopListTransferItem(0, "requestBirthdayListFromKAPI", "QPE/Application/kapi", "receiveBirthdayList"); | 374 | mBirthdayListFromKAPITransfer = new QCopListTransferItem(0, "requestBirthdayListFromKAPI", "QPE/Application/kapi", "receiveBirthdayList"); |
371 | connect(mBirthdayListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForBirthdayList(const QString&, const QString&))); | 375 | connect(mBirthdayListFromKAPITransfer, SIGNAL (receivedMessageFromSource(const QString&, const QString&)), this, SIGNAL (requestForBirthdayList(const QString&, const QString&))); |
372 | connect(mBirthdayListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); | 376 | connect(mBirthdayListFromKAPITransfer, SIGNAL (receivedMessageFromTarget(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), this, SIGNAL (receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); |
373 | 377 | ||
374 | 378 | ||
375 | } | 379 | } |
376 | 380 | ||
377 | ExternalAppHandler::~ExternalAppHandler() | 381 | ExternalAppHandler::~ExternalAppHandler() |
378 | { | 382 | { |
383 | delete mNameEmailUidListFromKAPITransfer; | ||
384 | //delete mFindByEmailFromKAPITransfer; | ||
385 | delete mDisplayDetails; | ||
386 | delete mBirthdayListFromKAPITransfer; | ||
379 | } | 387 | } |
380 | 388 | ||
381 | void ExternalAppHandler::receivedNameEmailUidList_Slot(const QString& uid, | 389 | void ExternalAppHandler::receivedNameEmailUidList_Slot(const QString& uid, |
382 | const QStringList& nameList, | 390 | const QStringList& nameList, |
383 | const QStringList& emailList, | 391 | const QStringList& emailList, |
384 | const QStringList& uidList, | 392 | const QStringList& uidList, |
385 | const QStringList&, | 393 | const QStringList&, |
386 | const QStringList&, | 394 | const QStringList&, |
387 | const QStringList& ) | 395 | const QStringList& ) |
388 | { | 396 | { |
389 | // this method is a conevnient way to reduce the number of parameters I have to pass | 397 | // this method is a conevnient way to reduce the number of parameters I have to pass |
390 | emit receivedNameEmailUidListEvent(uid, nameList, emailList, uidList); | 398 | emit receivedNameEmailUidListEvent(uid, nameList, emailList, uidList); |
391 | } | 399 | } |
392 | 400 | ||
393 | 401 | ||
394 | void ExternalAppHandler::loadConfig() | 402 | void ExternalAppHandler::loadConfig() |
395 | { | 403 | { |
396 | 404 | ||
397 | mDefaultItems.clear(); | 405 | mDefaultItems.clear(); |
398 | mEmailAppAvailable = UNDEFINED; | 406 | mEmailAppAvailable = UNDEFINED; |
399 | mPhoneAppAvailable = UNDEFINED; | 407 | mPhoneAppAvailable = UNDEFINED; |
400 | mFaxAppAvailable = UNDEFINED; | 408 | mFaxAppAvailable = UNDEFINED; |
401 | mSMSAppAvailable = UNDEFINED; | 409 | mSMSAppAvailable = UNDEFINED; |
402 | mPagerAppAvailable = UNDEFINED; | 410 | mPagerAppAvailable = UNDEFINED; |
403 | mSIPAppAvailable = UNDEFINED; | 411 | mSIPAppAvailable = UNDEFINED; |
404 | 412 | ||
405 | QString opiepath = QString::fromLatin1( getenv("OPIEDIR") ); | 413 | QString opiepath = QString::fromLatin1( getenv("OPIEDIR") ); |
406 | QString qtopiapath = QString::fromLatin1( getenv("QPEDIR") ); | 414 | QString qtopiapath = QString::fromLatin1( getenv("QPEDIR") ); |
407 | 415 | ||
408 | if (opiepath.isEmpty()) | 416 | if (opiepath.isEmpty()) |
409 | opiepath = qtopiapath; | 417 | opiepath = qtopiapath; |
410 | 418 | ||
diff --git a/libkdepim/externalapphandler.h b/libkdepim/externalapphandler.h index 4c6f1ea..6f5d345 100644 --- a/libkdepim/externalapphandler.h +++ b/libkdepim/externalapphandler.h | |||
@@ -71,65 +71,65 @@ class QCopTransferItem : public QObject | |||
71 | }; | 71 | }; |
72 | 72 | ||
73 | /********************************************************************************* | 73 | /********************************************************************************* |
74 | * | 74 | * |
75 | ********************************************************************************/ | 75 | ********************************************************************************/ |
76 | 76 | ||
77 | class QCopMapTransferItem : public QCopTransferItem | 77 | class QCopMapTransferItem : public QCopTransferItem |
78 | { | 78 | { |
79 | Q_OBJECT | 79 | Q_OBJECT |
80 | public: | 80 | public: |
81 | QCopMapTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); | 81 | QCopMapTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); |
82 | 82 | ||
83 | bool sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap); | 83 | bool sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap); |
84 | 84 | ||
85 | 85 | ||
86 | virtual bool appMessage( const QCString& msg, const QByteArray& data ); | 86 | virtual bool appMessage( const QCString& msg, const QByteArray& data ); |
87 | 87 | ||
88 | 88 | ||
89 | signals: | 89 | signals: |
90 | void receivedMessageFromTarget(const QString& uid, const QMap<QString,QString>& nameEmailMap); | 90 | void receivedMessageFromTarget(const QString& uid, const QMap<QString,QString>& nameEmailMap); |
91 | 91 | ||
92 | }; | 92 | }; |
93 | 93 | ||
94 | /********************************************************************************* | 94 | /********************************************************************************* |
95 | * | 95 | * |
96 | ********************************************************************************/ | 96 | ********************************************************************************/ |
97 | 97 | ||
98 | class QCopListTransferItem : public QCopTransferItem | 98 | class QCopListTransferItem : public QCopTransferItem |
99 | { | 99 | { |
100 | Q_OBJECT | 100 | Q_OBJECT |
101 | public: | 101 | public: |
102 | QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); | 102 | QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); |
103 | 103 | ~QCopListTransferItem(); | |
104 | bool sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6); | 104 | bool sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6); |
105 | 105 | ||
106 | 106 | ||
107 | virtual bool appMessage( const QCString& msg, const QByteArray& data ); | 107 | virtual bool appMessage( const QCString& msg, const QByteArray& data ); |
108 | 108 | ||
109 | 109 | ||
110 | signals: | 110 | signals: |
111 | void receivedMessageFromTarget(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4 , const QStringList& list5, const QStringList& list6); | 111 | void receivedMessageFromTarget(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4 , const QStringList& list5, const QStringList& list6); |
112 | 112 | ||
113 | }; | 113 | }; |
114 | 114 | ||
115 | /********************************************************************************* | 115 | /********************************************************************************* |
116 | * | 116 | * |
117 | ********************************************************************************/ | 117 | ********************************************************************************/ |
118 | 118 | ||
119 | 119 | ||
120 | class DefaultAppItem | 120 | class DefaultAppItem |
121 | { | 121 | { |
122 | public: | 122 | public: |
123 | DefaultAppItem(int type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2) | 123 | DefaultAppItem(int type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2) |
124 | : _type(type), _id(id), _label(label), _channel(channel), _message(message), _parameters(parameters), _message2(message2), _parameters2(parameters2) | 124 | : _type(type), _id(id), _label(label), _channel(channel), _message(message), _parameters(parameters), _message2(message2), _parameters2(parameters2) |
125 | {} | 125 | {} |
126 | 126 | ||
127 | DefaultAppItem() | 127 | DefaultAppItem() |
128 | { } | 128 | { } |
129 | 129 | ||
130 | public: | 130 | public: |
131 | int _type; | 131 | int _type; |
132 | int _id; | 132 | int _id; |
133 | QString _label; | 133 | QString _label; |
134 | QString _channel; | 134 | QString _channel; |
135 | QString _message; | 135 | QString _message; |
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp index 3771569..0fdc3e4 100644 --- a/libkdepim/kpimglobalprefs.cpp +++ b/libkdepim/kpimglobalprefs.cpp | |||
@@ -115,91 +115,90 @@ void KPimGlobalPrefs::setGlobalConfig() | |||
115 | #else | 115 | #else |
116 | fileName = qApp->applicationDirPath () + "/kdepim/"+ name; | 116 | fileName = qApp->applicationDirPath () + "/kdepim/"+ name; |
117 | #endif | 117 | #endif |
118 | mLocaleDict = 0; | 118 | mLocaleDict = 0; |
119 | if ( mPreferredLanguage > 0 && mPreferredLanguage < 5 ) { | 119 | if ( mPreferredLanguage > 0 && mPreferredLanguage < 5 ) { |
120 | 120 | ||
121 | if ( mPreferredLanguage == 1 ) | 121 | if ( mPreferredLanguage == 1 ) |
122 | fileName = fileName+"germantranslation.txt"; | 122 | fileName = fileName+"germantranslation.txt"; |
123 | else if ( mPreferredLanguage == 4 ) | 123 | else if ( mPreferredLanguage == 4 ) |
124 | fileName = fileName+"usertranslation.txt"; | 124 | fileName = fileName+"usertranslation.txt"; |
125 | else if ( mPreferredLanguage == 2 ) | 125 | else if ( mPreferredLanguage == 2 ) |
126 | fileName = fileName+"frenchtranslation.txt"; | 126 | fileName = fileName+"frenchtranslation.txt"; |
127 | else if ( mPreferredLanguage == 3 ) | 127 | else if ( mPreferredLanguage == 3 ) |
128 | fileName = fileName+"italiantranslation.txt"; | 128 | fileName = fileName+"italiantranslation.txt"; |
129 | QFile file( fileName ); | 129 | QFile file( fileName ); |
130 | if (file.open( IO_ReadOnly ) ) { | 130 | if (file.open( IO_ReadOnly ) ) { |
131 | QTextStream ts( &file ); | 131 | QTextStream ts( &file ); |
132 | ts.setEncoding( QTextStream::Latin1 ); | 132 | ts.setEncoding( QTextStream::Latin1 ); |
133 | //ts.setCodec( QTextCodec::latin1 ); | 133 | //ts.setCodec( QTextCodec::latin1 ); |
134 | QString text = ts.read(); | 134 | QString text = ts.read(); |
135 | file.close(); | 135 | file.close(); |
136 | text.replace( QRegExp("\\\\n"), "\n" ); | 136 | text.replace( QRegExp("\\\\n"), "\n" ); |
137 | QString line; | 137 | QString line; |
138 | QString we; | 138 | QString we; |
139 | QString wt; | 139 | QString wt; |
140 | int br = 0; | 140 | int br = 0; |
141 | int nbr; | 141 | int nbr; |
142 | nbr = text.find ( "},", br ); | 142 | nbr = text.find ( "},", br ); |
143 | line = text.mid( br, nbr - br ); | 143 | line = text.mid( br, nbr - br ); |
144 | br = nbr+1; | 144 | br = nbr+1; |
145 | int se, ee, st, et; | 145 | int se, ee, st, et; |
146 | mLocaleDict = new QDict<QString>; | 146 | mLocaleDict = new QDict<QString>; |
147 | mLocaleDict->setAutoDelete( true ); | ||
147 | QString end = "{ \"\",\"\" }"; | 148 | QString end = "{ \"\",\"\" }"; |
148 | while ( (line != end) && (br > 1) ) { | 149 | while ( (line != end) && (br > 1) ) { |
149 | //qDebug("%d *%s* ", br, line.latin1()); | 150 | //qDebug("%d *%s* ", br, line.latin1()); |
150 | se = line.find("\"")+1; | 151 | se = line.find("\"")+1; |
151 | et = line.findRev("\"",-1); | 152 | et = line.findRev("\"",-1); |
152 | ee = line.find("\",\""); | 153 | ee = line.find("\",\""); |
153 | st = ee+3; | 154 | st = ee+3; |
154 | we = line.mid( se, ee-se ); | 155 | we = line.mid( se, ee-se ); |
155 | wt = line.mid( st, et-st ); | 156 | wt = line.mid( st, et-st ); |
156 | //qDebug("*%s* *%s* ", we.latin1(), wt.latin1()); | 157 | //qDebug("*%s* *%s* ", we.latin1(), wt.latin1()); |
157 | mLocaleDict->insert( we, new QString (wt) ); | 158 | mLocaleDict->insert( we, new QString (wt) ); |
158 | nbr = text.find ( "}", br ); | 159 | nbr = text.find ( "}", br ); |
159 | line = text.mid( br, nbr - br ); | 160 | line = text.mid( br, nbr - br ); |
160 | br = nbr+1; | 161 | br = nbr+1; |
161 | } | 162 | } |
162 | //qDebug("end *%s* ", end.latin1()); | 163 | //qDebug("end *%s* ", end.latin1()); |
163 | 164 | ||
164 | setLocaleDict( mLocaleDict ); | 165 | setLocaleDict( mLocaleDict ); |
165 | } else { | 166 | } else { |
166 | qDebug("KO: Cannot find translation file %s",fileName.latin1() ); | 167 | qDebug("KO: Cannot find translation file %s",fileName.latin1() ); |
167 | } | 168 | } |
168 | } | 169 | } |
169 | } | 170 | } |
170 | 171 | ||
171 | KGlobal::locale()->setHore24Format( !mPreferredTime ); | 172 | KGlobal::locale()->setHore24Format( !mPreferredTime ); |
172 | KGlobal::locale()->setWeekStartMonday( !mWeekStartsOnSunday ); | 173 | KGlobal::locale()->setWeekStartMonday( !mWeekStartsOnSunday ); |
173 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)mPreferredDate ); | 174 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)mPreferredDate ); |
174 | KGlobal::locale()->setLanguage( mPreferredLanguage ); | 175 | KGlobal::locale()->setLanguage( mPreferredLanguage ); |
175 | QString dummy = mUserDateFormatLong; | 176 | QString dummy = mUserDateFormatLong; |
176 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); | 177 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); |
177 | dummy = mUserDateFormatShort; | 178 | dummy = mUserDateFormatShort; |
178 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); | 179 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); |
179 | KGlobal::locale()->setDaylightSaving( mUseDaylightsaving, | 180 | KGlobal::locale()->setDaylightSaving( mUseDaylightsaving, |
180 | mDaylightsavingStart, | 181 | mDaylightsavingStart, |
181 | mDaylightsavingEnd ); | 182 | mDaylightsavingEnd ); |
182 | KGlobal::locale()->setTimezone( mTimeZoneId, mTimeZoneAdd30min ); | 183 | KGlobal::locale()->setTimezone( mTimeZoneId, mTimeZoneAdd30min ); |
183 | 184 | ||
184 | } | 185 | } |
185 | KPimGlobalPrefs::~KPimGlobalPrefs() | 186 | KPimGlobalPrefs::~KPimGlobalPrefs() |
186 | { | 187 | { |
187 | if (sInstance == this) | 188 | if (sInstance == this) |
188 | sInstance = staticDeleterGP.setObject(0); | 189 | sInstance = staticDeleterGP.setObject(0); |
189 | else | 190 | else |
190 | qDebug("Whats this? Error in KPimGlobalPrefs::~KPimGlobalPrefs() ?"); | 191 | qDebug("Whats this? Error in KPimGlobalPrefs::~KPimGlobalPrefs() ?"); |
191 | //qDebug("KPimGlobalPrefs::~KPimGlobalPrefs() "); | ||
192 | writeConfig(); | ||
193 | if ( mLocaleDict ) | 192 | if ( mLocaleDict ) |
194 | delete mLocaleDict; | 193 | delete mLocaleDict; |
195 | } | 194 | } |
196 | 195 | ||
197 | KPimGlobalPrefs *KPimGlobalPrefs::instance() | 196 | KPimGlobalPrefs *KPimGlobalPrefs::instance() |
198 | { | 197 | { |
199 | if ( !sInstance ) { | 198 | if ( !sInstance ) { |
200 | sInstance = staticDeleterGP.setObject( new KPimGlobalPrefs() ); | 199 | sInstance = staticDeleterGP.setObject( new KPimGlobalPrefs() ); |
201 | sInstance->readConfig(); | 200 | sInstance->readConfig(); |
202 | } | 201 | } |
203 | 202 | ||
204 | return sInstance; | 203 | return sInstance; |
205 | } | 204 | } |
diff --git a/microkde/kdeui/klistview.cpp b/microkde/kdeui/klistview.cpp index 5b50ba9..3c809b4 100644 --- a/microkde/kdeui/klistview.cpp +++ b/microkde/kdeui/klistview.cpp | |||
@@ -65,83 +65,82 @@ protected: | |||
65 | private: | 65 | private: |
66 | KListView* mParent; | 66 | KListView* mParent; |
67 | }; | 67 | }; |
68 | 68 | ||
69 | KListView::Tooltip::Tooltip (KListView* parent, QToolTipGroup* group) | 69 | KListView::Tooltip::Tooltip (KListView* parent, QToolTipGroup* group) |
70 | : QToolTip (parent, group), | 70 | : QToolTip (parent, group), |
71 | mParent (parent) | 71 | mParent (parent) |
72 | { | 72 | { |
73 | } | 73 | } |
74 | 74 | ||
75 | void KListView::Tooltip::maybeTip (const QPoint&) | 75 | void KListView::Tooltip::maybeTip (const QPoint&) |
76 | { | 76 | { |
77 | // FIXME | 77 | // FIXME |
78 | } | 78 | } |
79 | // */ | 79 | // */ |
80 | 80 | ||
81 | class KListView::KListViewPrivate | 81 | class KListView::KListViewPrivate |
82 | { | 82 | { |
83 | public: | 83 | public: |
84 | KListViewPrivate (KListView* listview) | 84 | KListViewPrivate (KListView* listview) |
85 | : pCurrentItem (0L), | 85 | : pCurrentItem (0L), |
86 | autoSelectDelay(1), | 86 | autoSelectDelay(1), |
87 | //US dragDelay (KGlobalSettings::dndEventDelay()), | 87 | //US dragDelay (KGlobalSettings::dndEventDelay()), |
88 | 88 | ||
89 | dragDelay (10), | 89 | dragDelay (10), |
90 | //US editor (new KListViewLineEdit (listview)), | 90 | //US editor (new KListViewLineEdit (listview)), |
91 | cursorInExecuteArea(false), | 91 | cursorInExecuteArea(false), |
92 | bUseSingle(false), | 92 | bUseSingle(false), |
93 | bChangeCursorOverItem(false), | 93 | bChangeCursorOverItem(false), |
94 | itemsMovable (true), | 94 | itemsMovable (true), |
95 | selectedBySimpleMove(false), | 95 | selectedBySimpleMove(false), |
96 | selectedUsingMouse(false), | 96 | selectedUsingMouse(false), |
97 | showContextMenusOnPress(true), | ||
98 | itemsRenameable (false), | 97 | itemsRenameable (false), |
99 | validDrag (false), | 98 | validDrag (false), |
100 | dragEnabled (false), | 99 | dragEnabled (false), |
101 | autoOpen (true), | 100 | autoOpen (true), |
102 | dropVisualizer (true), | 101 | dropVisualizer (true), |
103 | dropHighlighter (false), | 102 | dropHighlighter (false), |
104 | createChildren (true), | 103 | createChildren (true), |
105 | pressedOnSelected (false), | 104 | pressedOnSelected (false), |
106 | wasShiftEvent (false), | 105 | wasShiftEvent (false), |
107 | fullWidth (false), | 106 | fullWidth (false), |
108 | sortAscending(true), | 107 | sortAscending(true), |
109 | tabRename(true), | 108 | tabRename(true), |
110 | sortColumn(0), | 109 | sortColumn(0), |
111 | selectionDirection(0), | 110 | selectionDirection(0), |
112 | tooltipColumn (0), | 111 | tooltipColumn (0), |
113 | selectionMode (Single), | 112 | selectionMode (Single), |
114 | //US contextMenuKey (KGlobalSettings::contextMenuKey()), | 113 | contextMenuKey ( Qt::Key_Menu ),//KGlobalSettings::contextMenuKey()), |
115 | //US showContextMenusOnPress (KGlobalSettings::showContextMenusOnPress()), | 114 | showContextMenusOnPress (true),//showContextMenusOnPress (KGlobalSettings::showContextMenusOnPress()), |
116 | mDropVisualizerWidth (4) | 115 | mDropVisualizerWidth (4) |
117 | { | 116 | { |
118 | renameable += 0; | 117 | renameable += 0; |
119 | //US connect(editor, SIGNAL(done(QListViewItem*,int)), listview, SLOT(doneEditing(QListViewItem*,int))); | 118 | //US connect(editor, SIGNAL(done(QListViewItem*,int)), listview, SLOT(doneEditing(QListViewItem*,int))); |
120 | } | 119 | } |
121 | 120 | ||
122 | ~KListViewPrivate () | 121 | ~KListViewPrivate () |
123 | { | 122 | { |
124 | //US delete editor; | 123 | //US delete editor; |
125 | } | 124 | } |
126 | 125 | ||
127 | QListViewItem* pCurrentItem; | 126 | QListViewItem* pCurrentItem; |
128 | 127 | ||
129 | QTimer autoSelect; | 128 | QTimer autoSelect; |
130 | int autoSelectDelay; | 129 | int autoSelectDelay; |
131 | 130 | ||
132 | QTimer dragExpand; | 131 | QTimer dragExpand; |
133 | QListViewItem* dragOverItem; | 132 | QListViewItem* dragOverItem; |
134 | QPoint dragOverPoint; | 133 | QPoint dragOverPoint; |
135 | 134 | ||
136 | QPoint startDragPos; | 135 | QPoint startDragPos; |
137 | int dragDelay; | 136 | int dragDelay; |
138 | 137 | ||
139 | //US KListViewLineEdit *editor; | 138 | //US KListViewLineEdit *editor; |
140 | QValueList<int> renameable; | 139 | QValueList<int> renameable; |
141 | 140 | ||
142 | bool cursorInExecuteArea:1; | 141 | bool cursorInExecuteArea:1; |
143 | bool bUseSingle:1; | 142 | bool bUseSingle:1; |
144 | bool bChangeCursorOverItem:1; | 143 | bool bChangeCursorOverItem:1; |
145 | bool itemsMovable:1; | 144 | bool itemsMovable:1; |
146 | bool selectedBySimpleMove : 1; | 145 | bool selectedBySimpleMove : 1; |
147 | bool selectedUsingMouse:1; | 146 | bool selectedUsingMouse:1; |
diff --git a/pwmanager/pwmanager/main.cpp b/pwmanager/pwmanager/main.cpp index 3f2d055..81e257f 100644 --- a/pwmanager/pwmanager/main.cpp +++ b/pwmanager/pwmanager/main.cpp | |||
@@ -175,39 +175,39 @@ int main(int argc, char *argv[]) | |||
175 | KGlobal::setAppName( "pwmanager" ); | 175 | KGlobal::setAppName( "pwmanager" ); |
176 | #ifndef DESKTOP_VERSION | 176 | #ifndef DESKTOP_VERSION |
177 | //qDebug("width %d ",QApplication::desktop()->width() ); | 177 | //qDebug("width %d ",QApplication::desktop()->width() ); |
178 | if ( QApplication::desktop()->width() > 320 ) | 178 | if ( QApplication::desktop()->width() > 320 ) |
179 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons22/"); | 179 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons22/"); |
180 | else | 180 | else |
181 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons16/"); | 181 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons16/"); |
182 | #else | 182 | #else |
183 | QString fileName ; | 183 | QString fileName ; |
184 | fileName = qApp->applicationDirPath () + "/kdepim/pwmanager/icons22/"; | 184 | fileName = qApp->applicationDirPath () + "/kdepim/pwmanager/icons22/"; |
185 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); | 185 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); |
186 | QApplication::addLibraryPath ( qApp->applicationDirPath () ); | 186 | QApplication::addLibraryPath ( qApp->applicationDirPath () ); |
187 | 187 | ||
188 | #endif | 188 | #endif |
189 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "pwmanager"))); | 189 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "pwmanager"))); |
190 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 190 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
191 | 191 | ||
192 | a.newInstance(); | 192 | a.newInstance(); |
193 | 193 | ||
194 | //US KAddressBookMain m ; | 194 | //US KAddressBookMain m ; |
195 | 195 | ||
196 | //US QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 196 | //US QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
197 | /*US | 197 | /*US |
198 | #ifndef DESKTOP_VERSION | 198 | #ifndef DESKTOP_VERSION |
199 | a.showMainWidget( &m ); | 199 | a.showMainWidget( &m ); |
200 | #else | 200 | #else |
201 | a.setMainWidget( &m ); | 201 | a.setMainWidget( &m ); |
202 | m.resize (640, 480 ); | 202 | m.resize (640, 480 ); |
203 | m.show(); | 203 | m.show(); |
204 | #endif | 204 | #endif |
205 | */ | 205 | */ |
206 | a.exec(); | 206 | a.exec(); |
207 | 207 | KPimGlobalPrefs::instance()->writeConfig(); | |
208 | } | 208 | } |
209 | qDebug("PWMPI: Bye! "); | 209 | qDebug("PWMPI: Bye! "); |
210 | 210 | ||
211 | #endif | 211 | #endif |
212 | 212 | ||
213 | } | 213 | } |
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp index b7b5307..d92c90d 100644 --- a/pwmanager/pwmanager/pwm.cpp +++ b/pwmanager/pwmanager/pwm.cpp | |||
@@ -143,91 +143,93 @@ enum { | |||
143 | BUTTON_POPUP_HELP_LICENSE = 0, | 143 | BUTTON_POPUP_HELP_LICENSE = 0, |
144 | BUTTON_POPUP_HELP_FAQ, | 144 | BUTTON_POPUP_HELP_FAQ, |
145 | BUTTON_POPUP_HELP_ABOUT, | 145 | BUTTON_POPUP_HELP_ABOUT, |
146 | BUTTON_POPUP_HELP_SYNC, | 146 | BUTTON_POPUP_HELP_SYNC, |
147 | BUTTON_POPUP_HELP_WHATSNEW | 147 | BUTTON_POPUP_HELP_WHATSNEW |
148 | }; | 148 | }; |
149 | #endif | 149 | #endif |
150 | 150 | ||
151 | // Button IDs for toolbar | 151 | // Button IDs for toolbar |
152 | enum { | 152 | enum { |
153 | BUTTON_TOOL_NEW = 0, | 153 | BUTTON_TOOL_NEW = 0, |
154 | BUTTON_TOOL_OPEN, | 154 | BUTTON_TOOL_OPEN, |
155 | BUTTON_TOOL_SAVE, | 155 | BUTTON_TOOL_SAVE, |
156 | BUTTON_TOOL_SAVEAS, | 156 | BUTTON_TOOL_SAVEAS, |
157 | BUTTON_TOOL_PRINT, | 157 | BUTTON_TOOL_PRINT, |
158 | BUTTON_TOOL_ADD, | 158 | BUTTON_TOOL_ADD, |
159 | BUTTON_TOOL_EDIT, | 159 | BUTTON_TOOL_EDIT, |
160 | BUTTON_TOOL_DEL, | 160 | BUTTON_TOOL_DEL, |
161 | BUTTON_TOOL_FIND, | 161 | BUTTON_TOOL_FIND, |
162 | BUTTON_TOOL_LOCK, | 162 | BUTTON_TOOL_LOCK, |
163 | BUTTON_TOOL_DEEPLOCK, | 163 | BUTTON_TOOL_DEEPLOCK, |
164 | BUTTON_TOOL_UNLOCK | 164 | BUTTON_TOOL_UNLOCK |
165 | }; | 165 | }; |
166 | 166 | ||
167 | 167 | ||
168 | PwM::PwM(PwMInit *_init, PwMDoc *doc, | 168 | PwM::PwM(PwMInit *_init, PwMDoc *doc, |
169 | bool virginity, | 169 | bool virginity, |
170 | QWidget *parent, const char *name) | 170 | QWidget *parent, const char *name) |
171 | : KMainWindow(parent, "HALLO") | 171 | : KMainWindow(parent, "HALLO") |
172 | , forceQuit (false) | 172 | , forceQuit (false) |
173 | , forceMinimizeToTray (false) | 173 | , forceMinimizeToTray (false) |
174 | { | 174 | { |
175 | syncManager = 0; | ||
175 | virgin = !virginity; | 176 | virgin = !virginity; |
176 | init = _init; | 177 | init = _init; |
177 | connect(doc, SIGNAL(docClosed(PwMDoc *)), | 178 | connect(doc, SIGNAL(docClosed(PwMDoc *)), |
178 | this, SLOT(docClosed(PwMDoc *))); | 179 | this, SLOT(docClosed(PwMDoc *))); |
179 | initMenubar(); | 180 | initMenubar(); |
180 | initToolbar(); | 181 | initToolbar(); |
181 | initMetrics(); | 182 | initMetrics(); |
182 | setVirgin(virginity); | 183 | setVirgin(virginity); |
183 | setFocusPolicy(QWidget::WheelFocus); | 184 | setFocusPolicy(QWidget::WheelFocus); |
184 | #ifndef PWM_EMBEDDED | 185 | #ifndef PWM_EMBEDDED |
185 | statusBar()->show(); | 186 | statusBar()->show(); |
186 | #endif | 187 | #endif |
187 | view = makeNewListView(doc); | 188 | view = makeNewListView(doc); |
188 | setCentralWidget(view); | 189 | setCentralWidget(view); |
189 | updateCaption(); | 190 | updateCaption(); |
190 | showStatMsg(i18n("Ready.")); | 191 | showStatMsg(i18n("Ready.")); |
191 | } | 192 | } |
192 | 193 | ||
193 | PwM::~PwM() | 194 | PwM::~PwM() |
194 | { | 195 | { |
195 | //qDebug("PwM::~PwM()"); | 196 | //qDebug("PwM::~PwM()"); |
196 | disconnect(curDoc(), SIGNAL(docClosed(PwMDoc *)), | 197 | disconnect(curDoc(), SIGNAL(docClosed(PwMDoc *)), |
197 | this, SLOT(docClosed(PwMDoc *))); | 198 | this, SLOT(docClosed(PwMDoc *))); |
198 | conf()->confWndMainWndSize(size()); | 199 | conf()->confWndMainWndSize(size()); |
199 | emit closed(this); | 200 | emit closed(this); |
200 | //qDebug("PwM::~PwM() emited closed(this)"); | 201 | //qDebug("PwM::~PwM() emited closed(this)"); |
201 | delete view; | 202 | delete view; |
203 | delete syncManager; | ||
202 | } | 204 | } |
203 | 205 | ||
204 | void PwM::initMenubar() | 206 | void PwM::initMenubar() |
205 | { | 207 | { |
206 | KIconLoader* picons; | 208 | KIconLoader* picons; |
207 | #ifndef PWM_EMBEDDED | 209 | #ifndef PWM_EMBEDDED |
208 | KIconLoader icons; | 210 | KIconLoader icons; |
209 | picons = &icons; | 211 | picons = &icons; |
210 | #else | 212 | #else |
211 | picons = KGlobal::iconLoader(); | 213 | picons = KGlobal::iconLoader(); |
212 | 214 | ||
213 | 215 | ||
214 | syncPopup = new KPopupMenu(this); | 216 | syncPopup = new KPopupMenu(this); |
215 | 217 | ||
216 | syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::PWMPI, PWMPrefs::instance(), syncPopup); | 218 | syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::PWMPI, PWMPrefs::instance(), syncPopup); |
217 | syncManager->setBlockSave(false); | 219 | syncManager->setBlockSave(false); |
218 | 220 | ||
219 | connect ( syncPopup, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); | 221 | connect ( syncPopup, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); |
220 | syncManager->fillSyncMenu(); | 222 | syncManager->fillSyncMenu(); |
221 | 223 | ||
222 | #endif | 224 | #endif |
223 | filePopup = new KPopupMenu(this); | 225 | filePopup = new KPopupMenu(this); |
224 | importPopup = new KPopupMenu(filePopup); | 226 | importPopup = new KPopupMenu(filePopup); |
225 | exportPopup = new KPopupMenu(filePopup); | 227 | exportPopup = new KPopupMenu(filePopup); |
226 | managePopup = new KPopupMenu(this); | 228 | managePopup = new KPopupMenu(this); |
227 | #ifdef CONFIG_KEYCARD | 229 | #ifdef CONFIG_KEYCARD |
228 | chipcardPopup = new KPopupMenu(this); | 230 | chipcardPopup = new KPopupMenu(this); |
229 | #endif // CONFIG_KEYCARD | 231 | #endif // CONFIG_KEYCARD |
230 | viewPopup = new KPopupMenu(this); | 232 | viewPopup = new KPopupMenu(this); |
231 | optionsPopup = new KPopupMenu(this); | 233 | optionsPopup = new KPopupMenu(this); |
232 | 234 | ||
233 | // "file" popup menu | 235 | // "file" popup menu |