author | zautrix <zautrix> | 2004-08-02 00:52:35 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-02 00:52:35 (UTC) |
commit | 54157cb44316de72d776cfae70bdadf6c52f4773 (patch) (side-by-side diff) | |
tree | 953c8ae225a54fc43a7298d49b08e821bf741cb9 /libkcal | |
parent | 3ebd85e83e6f9d4ac59ce1828548f7236e2b1af0 (diff) | |
download | kdepimpi-54157cb44316de72d776cfae70bdadf6c52f4773.zip kdepimpi-54157cb44316de72d776cfae70bdadf6c52f4773.tar.gz kdepimpi-54157cb44316de72d776cfae70bdadf6c52f4773.tar.bz2 |
Hack, hack, hack
-rw-r--r-- | libkcal/calendar.h | 4 | ||||
-rw-r--r-- | libkcal/calendarlocal.cpp | 8 | ||||
-rw-r--r-- | libkcal/calendarlocal.h | 4 | ||||
-rw-r--r-- | libkcal/incidencebase.cpp | 12 | ||||
-rw-r--r-- | libkcal/incidencebase.h | 3 | ||||
-rw-r--r-- | libkcal/sharpformat.cpp | 18 |
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 @@ -161,9 +161,9 @@ 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. The calendar filter is applied. @@ -210,9 +210,9 @@ public: Searches todolist for an event with this unique string identifier, 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. */ virtual QPtrList<Todo> todos( const QDate &date ) = 0; diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index 09ce9f0..e464a77 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp @@ -211,13 +211,13 @@ void CalendarLocal::deleteTodo( Todo *todo ) 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; } @@ -234,13 +234,13 @@ 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 @@ -174,10 +174,10 @@ class CalendarLocal : public Calendar only events are returned, which are completely included in the range. */ 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 ); protected: diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp index f1db8b7..5d8785b 100644 --- a/libkcal/incidencebase.cpp +++ b/libkcal/incidencebase.cpp @@ -37,9 +37,8 @@ IncidenceBase::IncidenceBase() : mFloats = false; mDuration = 0; mHasDuration = false; mPilotId = 0; - mZaurusId = -1; mZaurusUid = 0; mExternalId = ":"; mTempSyncStat = 0; mSyncStatus = 0; @@ -61,9 +60,8 @@ 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; mExternalId = i.mExternalId; @@ -341,18 +339,8 @@ void IncidenceBase::setPilotId( int id ) 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 { return mZaurusUid; diff --git a/libkcal/incidencebase.h b/libkcal/incidencebase.h index 2f85df6..e2950d3 100644 --- a/libkcal/incidencebase.h +++ b/libkcal/incidencebase.h @@ -125,10 +125,8 @@ class IncidenceBase : public CustomProperties void setPilotId(int id); /** Return Pilot Id. */ int pilotId() const; - void setZaurusId(int id); - int zaurusId() const; void setZaurusUid(int id); int zaurusUid() const; void setTempSyncStat(int id); int tempSyncStat() const; @@ -160,9 +158,8 @@ class IncidenceBase : public CustomProperties int mDuration; bool mHasDuration; QString mExternalId; - int mZaurusId; int mZaurusUid; int mTempSyncStat; // PILOT SYNCHRONIZATION STUFF diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp index d39d2dd..605a54d 100644 --- a/libkcal/sharpformat.cpp +++ b/libkcal/sharpformat.cpp @@ -84,14 +84,14 @@ class SharpParser : public QObject ulong cSum = SharpFormat::getCsum(attList ); 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 ); event->setSummary( attList[2] ); @@ -188,9 +188,9 @@ class SharpParser : public QObject mCalendar->addEvent( event); } 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 todo = new Todo; @@ -200,9 +200,9 @@ class SharpParser : public QObject //1,,,,,1,4,Loch zumachen,"" //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 ); todo->setSummary( attList[7] ); @@ -465,9 +465,9 @@ int SharpFormat::getNumFromRecord( QString answer, Incidence* inc ) bool ok; 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 ); } } @@ -519,9 +519,9 @@ bool SharpFormat::save( Calendar *calendar) deleteString += eString + "\n"; 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 ); if (!file.open( IO_ReadOnly ) ) { @@ -605,9 +605,9 @@ bool SharpFormat::save( Calendar *calendar) deleteString += eString + "\n"; 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 ); if (!file.open( IO_ReadOnly ) ) { @@ -695,9 +695,9 @@ 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() ); else @@ -859,9 +859,9 @@ 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() ) { list.append( dtToString( todo->dtStart()) ); |