summaryrefslogtreecommitdiff
path: root/library/datebookdb.cpp
Side-by-side diff
Diffstat (limited to 'library/datebookdb.cpp') (more/less context) (show whitespace changes)
-rw-r--r--library/datebookdb.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/library/datebookdb.cpp b/library/datebookdb.cpp
index 188d8e1..e4ec2bf 100644
--- a/library/datebookdb.cpp
+++ b/library/datebookdb.cpp
@@ -1,81 +1,76 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include <qasciidict.h>
-#include <qfile.h>
#include <qmessagebox.h>
-#include <qstring.h>
-#include <qtextcodec.h>
-#include <qtextstream.h>
#include <qtl.h>
#include <qpe/alarmserver.h>
#include <qpe/global.h>
#include "datebookdb.h"
#include <qpe/stringutil.h>
-#include <qpe/timeconversion.h>
#include <errno.h>
#include <stdlib.h>
class DateBookDBPrivate
{
public:
bool clean; // indcate whether we need to write to disk...
};
// Helper functions
static QString dateBookJournalFile()
{
QString str = getenv("HOME");
return QString( str +"/.caljournal" );
}
static QString dateBookFilename()
{
return Global::applicationFileName("datebook","datebook.xml");
}
/* Calculating the next event of a recuring event is actually
computationally inexpensive, esp. compared to checking each day
individually. There are bad worse cases for say the 29th of
february or the 31st of some other months. However
these are still bounded */
bool nextOccurance(const Event &e, const QDate &from, QDateTime &next)
{
// easy checks, first are we too far in the future or too far in the past?
QDate tmpDate;
int freq = e.repeatPattern().frequency;
int diff, diff2, a;
int iday, imonth, iyear;
int dayOfWeek = 0;
int firstOfWeek = 0;
int weekOfMonth;
if (e.repeatPattern().hasEndDate && e.repeatPattern().endDate() < from)
return FALSE;
if (e.start() >= from) {
next = e.start();
return TRUE;