summaryrefslogtreecommitdiff
path: root/core/pim
authorharlekin <harlekin>2002-04-07 13:08:50 (UTC)
committer harlekin <harlekin>2002-04-07 13:08:50 (UTC)
commit9aced2eebc244de560c1ca72786183dc93019b9d (patch) (side-by-side diff)
treea9061ef92e0510efb552088d464ac218583f142a /core/pim
parentf87f79ef356475764d8b9011c3f3b467d3015426 (diff)
downloadopie-9aced2eebc244de560c1ca72786183dc93019b9d.zip
opie-9aced2eebc244de560c1ca72786183dc93019b9d.tar.gz
opie-9aced2eebc244de560c1ca72786183dc93019b9d.tar.bz2
fixed a mem leak, patch by Stefan Eilers
Diffstat (limited to 'core/pim') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 51aba69..7cef035 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -66,24 +66,25 @@ Today::Today( QWidget* parent, const char* name, WFlags fl )
QObject::connect( (QObject*)TodoButton, SIGNAL( clicked() ), this, SLOT(startTodo() ) );
QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startDatebook() ) );
QObject::connect( (QObject*)MailButton, SIGNAL( clicked() ), this, SLOT(startMail() ) );
#if defined(Q_WS_QWS)
#if !defined(QT_NO_COP)
QCopChannel *todayChannel = new QCopChannel("QPE/Today" , this );
connect (todayChannel, SIGNAL( received(const QCString &, const QByteArray &)),
this, SLOT ( channelReceived(const QCString &, const QByteArray &)) );
#endif
#endif
+ db = NULL;
setOwnerField();
todo = new ToDoDB;
getTodo();
draw();
autoStart();
}
/*
* Qcop receive method.
*/
void Today::channelReceived(const QCString &msg, const QByteArray & data) {
QDataStream stream(data, IO_ReadOnly );
@@ -200,25 +201,25 @@ void Today::init() {
MAX_LINES_TASK = cfg.readNumEntry("maxlinestask",5);
// after how many chars should the be cut off on tasks and notes
MAX_CHAR_CLIP = cfg.readNumEntry("maxcharclip",40);
// how many lines should be showed in the datebook section
MAX_LINES_MEET = cfg.readNumEntry("maxlinesmeet",5);
// If location is to be showed too, 1 to activate it.
SHOW_LOCATION = cfg.readNumEntry("showlocation",1);
// if notes should be shown
SHOW_NOTES = cfg.readNumEntry("shownotes",0);
// should only later appointments be shown or all for the current day.
ONLY_LATER = cfg.readNumEntry("onlylater",1);
- db = new DateBookDB;
+ //db = new DateBookDB;
}
/*
* The method for the configuration dialog.
*/
void Today::startConfig() {
conf = new todayconfig ( this, "", true );
// read the config
Config cfg("today");
cfg.setGroup("BaseConfig");
@@ -265,25 +266,30 @@ void Today::startConfig() {
}
/*
* Get all events that are in the datebook xml file for today
*/
void Today::getDates() {
QDate date = QDate::currentDate();
if (AllDateBookEvents) delete AllDateBookEvents;
AllDateBookEvents = new QWidget( );
QVBoxLayout* layoutDates = new QVBoxLayout(AllDateBookEvents);
-
+
+ if (db) {
+ delete db;
+ }
+ db = new DateBookDB;
+
QValueList<EffectiveEvent> list = db->getEffectiveEvents(date, date);
qBubbleSort(list);
// printf("Get dates\n");
Config config( "qpe" );
// if 24 h format
//bool ampm = config.readBoolEntry( "AMPM", TRUE );
int count=0;
if ( list.count() > 0 ) {