summaryrefslogtreecommitdiffabout
path: root/libkcal
Side-by-side diff
Diffstat (limited to 'libkcal') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/calendarlocal.cpp1
-rw-r--r--libkcal/icalformat.cpp9
-rw-r--r--libkcal/icalformat.h3
-rw-r--r--libkcal/todo.cpp5
4 files changed, 14 insertions, 4 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index e37a7ad..eef8327 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -65,6 +65,7 @@ void CalendarLocal::init()
CalendarLocal::~CalendarLocal()
{
+ registerObserver( 0 );
if ( mDeleteIncidencesOnClose )
close();
}
diff --git a/libkcal/icalformat.cpp b/libkcal/icalformat.cpp
index 5877406..6f3a799 100644
--- a/libkcal/icalformat.cpp
+++ b/libkcal/icalformat.cpp
@@ -50,8 +50,9 @@ extern "C" {
using namespace KCal;
-ICalFormat::ICalFormat( )
+ICalFormat::ICalFormat( bool pe )
{
+ mProcessEvents = pe;
mImpl = new ICalFormatImpl( this );
tzOffsetMin = 0;
//qDebug("new ICalFormat() ");
@@ -189,8 +190,11 @@ QString ICalFormat::toString( Calendar *cal )
component = mImpl->writeTodo(qlt.current());
icalcomponent_add_component(calendar,component);
//qDebug(" todos ");
+ if ( mProcessEvents ) {
+ //qDebug("mProcessEvents ");
qApp->processEvents();
}
+ }
// events
QPtrList<Event> events = cal->rawEvents();
Event *ev;
@@ -198,6 +202,7 @@ QString ICalFormat::toString( Calendar *cal )
component = mImpl->writeEvent(ev);
icalcomponent_add_component(calendar,component);
//qDebug("events ");
+ if ( mProcessEvents )
qApp->processEvents();
}
@@ -208,11 +213,13 @@ QString ICalFormat::toString( Calendar *cal )
component = mImpl->writeJournal(j);
icalcomponent_add_component(calendar,component);
//qDebug("journals ");
+ if ( mProcessEvents )
qApp->processEvents();
}
const char *text;
QString ret ="";
text = icalcomponent_as_ical_string( calendar );
+ if ( mProcessEvents )
qApp->processEvents();
// text = "BEGIN:VCALENDAR\nPRODID\n :-//K Desktop Environment//NONSGML libkcal 3.1//EN\nVERSION\n :2.0\nBEGIN:VEVENT\nDTSTAMP\n :20031231T213514Z\nORGANIZER\n :MAILTO:lutz@putz.de\nCREATED\n :20031231T213513Z\nUID\n :libkcal-1295166342.120\nSEQUENCE\n :0\nLAST-MODIFIED\n :20031231T213513Z\nSUMMARY\n :test1\nCLASS\n :PUBLIC\nPRIORITY\n :3\nDTSTART\n :20040101T090000Z\nDTEND\n :20040101T110000Z\nTRANSP\n :OPAQUE\nEND:VEVENT\nEND:VCALENDAR\n";
diff --git a/libkcal/icalformat.h b/libkcal/icalformat.h
index 485ab6e..a770dbb 100644
--- a/libkcal/icalformat.h
+++ b/libkcal/icalformat.h
@@ -40,7 +40,7 @@ class ICalFormatImpl;
class ICalFormat : public CalFormat {
public:
/** Create new iCalendar format. */
- ICalFormat( );
+ ICalFormat( bool pe = true);
virtual ~ICalFormat();
/**
@@ -103,6 +103,7 @@ class ICalFormat : public CalFormat {
bool utc() const;
private:
+ bool mProcessEvents;
ICalFormatImpl *mImpl;
QString mTimeZoneId;
QCString mTzString;
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 4ada2d8..7bf756a 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -66,6 +66,7 @@ void Todo::setRunningFalse( QString s )
if ( ! mRunning )
return;
mRunning = false;
+ if ( mRunSaveTimer )
mRunSaveTimer->stop();
saveRunningInfoToFile( s );
}
@@ -139,7 +140,7 @@ void Todo::saveRunningInfoToFile( QString comment )
to->setDescription( "TT-Note: " + comment +"\n" + des );
}
cal.addIncidence( to );
- ICalFormat format;
+ ICalFormat format( false );
file = dir +"/" +file +".ics";
format.save( &cal, file );
saveParents();
@@ -167,7 +168,7 @@ void Todo::saveParents()
cal.setLocalTime();
Todo * par = (Todo *) to->clone();
cal.addIncidence( par );
- ICalFormat format;
+ ICalFormat format( false );
format.save( &cal, file );
}
to->saveParents();