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 /korganizer | |
parent | 73c0cb5307a8276f628765c651ef0284b85d64de (diff) | |
download | kdepimpi-a682b1d39c63cff8d709c67460569c70b661d889.zip kdepimpi-a682b1d39c63cff8d709c67460569c70b661d889.tar.gz kdepimpi-a682b1d39c63cff8d709c67460569c70b661d889.tar.bz2 |
fixed several memory leaks
-rw-r--r-- | korganizer/kolistview.cpp | 1 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 10 | ||||
-rw-r--r-- | korganizer/main.cpp | 3 |
3 files changed, 4 insertions, 10 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index d3aa650..3d4acb7 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -985,48 +985,49 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) | |||
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; |
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index f44debc..8dca3ae 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -146,59 +146,49 @@ KOPrefs::KOPrefs() : | |||
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"); |
diff --git a/korganizer/main.cpp b/korganizer/main.cpp index 4194d12..2481ca4 100644 --- a/korganizer/main.cpp +++ b/korganizer/main.cpp | |||
@@ -1,45 +1,46 @@ | |||
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 | } |
@@ -80,27 +81,29 @@ int main( int argc, char **argv ) | |||
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 | } |