summaryrefslogtreecommitdiffabout
path: root/libkcal
Side-by-side diff
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/calendar.h4
-rw-r--r--libkcal/calendarlocal.cpp8
-rw-r--r--libkcal/calendarlocal.h4
-rw-r--r--libkcal/incidencebase.cpp12
-rw-r--r--libkcal/incidencebase.h3
-rw-r--r--libkcal/sharpformat.cpp18
6 files changed, 17 insertions, 32 deletions
diff --git a/libkcal/calendar.h b/libkcal/calendar.h
index df5bbcf..d59bca6 100644
--- a/libkcal/calendar.h
+++ b/libkcal/calendar.h
@@ -162,7 +162,7 @@ public:
Retrieves an event on the basis of the unique string ID.
*/
virtual Event *event( const QString &UniqueStr ) = 0;
- virtual Event *event( int ) = 0;
+ virtual Event *event( QString, int ) = 0;
/**
Builds and then returns a list of all events that match for the
date specified. useful for dayView, etc. etc.
@@ -211,7 +211,7 @@ public:
returns a pointer or null.
*/
virtual Todo *todo( const QString &uid ) = 0;
- virtual Todo *todo( int ) = 0;
+ virtual Todo *todo( QString, int ) = 0;
/**
Returns list of todos due on the specified date.
*/
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index 09ce9f0..e464a77 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -212,11 +212,11 @@ QPtrList<Todo> CalendarLocal::rawTodos()
{
return mTodoList;
}
-Todo *CalendarLocal::todo( int id )
+Todo *CalendarLocal::todo( QString syncProf, int id )
{
Todo *todo;
for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) {
- if ( todo->zaurusId() == id ) return todo;
+ if ( todo->getID( syncProf ) == id ) return todo;
}
return 0;
@@ -235,11 +235,11 @@ QPtrList<Event> CalendarLocal::getExternLastSyncEvents()
return el;
}
-Event *CalendarLocal::event( int id )
+Event *CalendarLocal::event( QString syncProf, int id )
{
Event *todo;
for ( todo = mEventList.first(); todo; todo = mEventList.next() ) {
- if ( todo->zaurusId() == id ) return todo;
+ if ( todo->getID( syncProf ) == id ) return todo;
}
return 0;
diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h
index 3257198..4728063 100644
--- a/libkcal/calendarlocal.h
+++ b/libkcal/calendarlocal.h
@@ -175,8 +175,8 @@ class CalendarLocal : public Calendar
*/
QPtrList<Event> rawEvents( const QDate &start, const QDate &end,
bool inclusive = false );
- Todo *CalendarLocal::todo( int uid );
- Event *CalendarLocal::event( int uid );
+ Todo *todo( QString, int uid );
+ Event *event( QString,int uid );
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp
index f1db8b7..5d8785b 100644
--- a/libkcal/incidencebase.cpp
+++ b/libkcal/incidencebase.cpp
@@ -38,7 +38,6 @@ IncidenceBase::IncidenceBase() :
mDuration = 0;
mHasDuration = false;
mPilotId = 0;
- mZaurusId = -1;
mZaurusUid = 0;
mExternalId = ":";
mTempSyncStat = 0;
@@ -62,7 +61,6 @@ IncidenceBase::IncidenceBase(const IncidenceBase &i) :
mFloats = i.mFloats;
mLastModified = i.mLastModified;
mPilotId = i.mPilotId;
- mZaurusId = i.mZaurusId;
mZaurusUid = i.mZaurusUid;
mTempSyncStat = i.mTempSyncStat;
mSyncStatus = i.mSyncStatus;
@@ -342,16 +340,6 @@ int IncidenceBase::pilotId() const
{
return mPilotId;
}
-void IncidenceBase::setZaurusId( int id )
-{
- if (mReadOnly) return;
- mZaurusId = id;
-}
-
-int IncidenceBase::zaurusId() const
-{
- return mZaurusId;
-}
int IncidenceBase::zaurusUid() const
{
diff --git a/libkcal/incidencebase.h b/libkcal/incidencebase.h
index 2f85df6..e2950d3 100644
--- a/libkcal/incidencebase.h
+++ b/libkcal/incidencebase.h
@@ -126,8 +126,6 @@ class IncidenceBase : public CustomProperties
/** Return Pilot Id. */
int pilotId() const;
- void setZaurusId(int id);
- int zaurusId() const;
void setZaurusUid(int id);
int zaurusUid() const;
void setTempSyncStat(int id);
@@ -161,7 +159,6 @@ class IncidenceBase : public CustomProperties
int mDuration;
bool mHasDuration;
QString mExternalId;
- int mZaurusId;
int mZaurusUid;
int mTempSyncStat;
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp
index d39d2dd..605a54d 100644
--- a/libkcal/sharpformat.cpp
+++ b/libkcal/sharpformat.cpp
@@ -85,12 +85,12 @@ class SharpParser : public QObject
if ( qName == "Event" ) {
Event *event;
- event = existingCalendar->event( attList[0].toInt() );
+ event = existingCalendar->event( "Sharp_DTM",attList[0].toInt() );
if ( event )
event = (Event*)event->clone();
else
event = new Event;
- event->setZaurusId( attList[0].toInt() );
+ event->setID("Sharp_DTM", attList[0].toInt() );
event->setZaurusUid( cSum );
event->setTempSyncStat(SYNC_TEMPSTATE_NEW_EXTERNAL );
@@ -189,7 +189,7 @@ class SharpParser : public QObject
} else if ( qName == "Todo" ) {
Todo *todo;
- todo = existingCalendar->todo( attList[0].toInt() );
+ todo = existingCalendar->todo( "Sharp_DTM", attList[0].toInt() );
if (todo )
todo = (Todo*)todo->clone();
else
@@ -201,7 +201,7 @@ class SharpParser : public QObject
//3,Privat,20040317T000000,20040318T000000,20040319T000000,0,5,Call bbb,"notes123 bbb gggg ""bb "" "
//2,"Familie,Freunde,Holiday",20040318T000000,20040324T000000,20040317T000000,1,2,tod2,notes
- todo->setZaurusId( attList[0].toInt() );
+ todo->setID( "Sharp_DTM", attList[0].toInt() );
todo->setZaurusUid( cSum );
todo->setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL );
@@ -466,7 +466,7 @@ int SharpFormat::getNumFromRecord( QString answer, Incidence* inc )
int newnum = templist[0].toInt( &ok );
if ( ok && newnum > 0) {
retval = newnum;
- inc->setZaurusId( newnum );
+ inc->setID( "Sharp_DTM",newnum );
inc->setZaurusUid( getCsum( templist ) );
inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID );
}
@@ -520,7 +520,7 @@ bool SharpFormat::save( Calendar *calendar)
deleteEnt = true;
changeEnt = true;
}
- else if ( ev->zaurusId() == -1 ) { // add new
+ else if ( ev->getID("Sharp_DTM") == -1 ) { // add new
command = "(echo \"" + ePrefix + eString + "\" ) | db2file datebook -w -g -c " + codec+ " > "+ fileName;
system ( command.utf8() );
QFile file( fileName );
@@ -606,7 +606,7 @@ bool SharpFormat::save( Calendar *calendar)
deleteEnt = true;
changeEnt = true;
}
- else if ( to->zaurusId() == -1 ) { // add new
+ else if ( to->getID("Sharp_DTM") == -1 ) { // add new
command = "(echo \"" + tPrefix + eString + "\" ) | db2file todo -w -g -c " + codec+ " > "+ fileName;
system ( command.utf8() );
QFile file( fileName );
@@ -696,7 +696,7 @@ QString SharpFormat::dtToString( const QDateTime& dti, bool useTZ )
QString SharpFormat::getEventString( Event* event )
{
QStringList list;
- list.append( QString::number(event->zaurusId() ) );
+ list.append( QString::number(event->getID("Sharp_DTM") ) );
list.append( event->categories().join(",") );
if ( !event->summary().isEmpty() )
list.append( event->summary() );
@@ -860,7 +860,7 @@ QString SharpFormat::getEventString( Event* event )
QString SharpFormat::getTodoString( Todo* todo )
{
QStringList list;
- list.append( QString::number( todo->zaurusId() ) );
+ list.append( QString::number( todo->getID("Sharp_DTM") ) );
list.append( todo->categories().join(",") );
if ( todo->hasStartDate() ) {