diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /libkcal/incidence.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkcal/incidence.cpp')
-rw-r--r-- | libkcal/incidence.cpp | 134 |
1 files changed, 67 insertions, 67 deletions
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index c4ee51083..94995b12c 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp @@ -60,7 +60,7 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i ),Recurrence::Obse mPriority = i.mPriority; mLocation = i.mLocation; - // Alarms and Attachments are stored in ListBase<...>, which is a QValueList<...*>. + // Alarms and Attachments are stored in ListBase<...>, which is a TQValueList<...*>. // We need to really duplicate the objects stored therein, otherwise deleting // i will also delete all attachments from this object (setAutoDelete...) Alarm::List::ConstIterator it; @@ -100,7 +100,7 @@ Incidence::~Incidence() } // A string comparison that considers that null and empty are the same -static bool stringCompare( const QString& s1, const QString& s2 ) +static bool stringCompare( const TQString& s1, const TQString& s2 ) { return ( s1.isEmpty() && s2.isEmpty() ) || (s1 == s2); } @@ -199,14 +199,14 @@ bool Incidence::operator==( const Incidence& i2 ) const void Incidence::recreate() { - setCreated(QDateTime::currentDateTime()); + setCreated(TQDateTime::currentDateTime()); setUid(CalFormat::createUniqueId()); - setSchedulingID( QString::null ); + setSchedulingID( TQString::null ); setRevision(0); - setLastModified(QDateTime::currentDateTime()); + setLastModified(TQDateTime::currentDateTime()); setPilotId( 0 ); setSyncStatus( SYNCNONE ); } @@ -226,7 +226,7 @@ void Incidence::setFloats(bool f) IncidenceBase::setFloats( f ); } -void Incidence::setCreated( const QDateTime &created ) +void Incidence::setCreated( const TQDateTime &created ) { if (mReadOnly) return; mCreated = created; @@ -235,7 +235,7 @@ void Incidence::setCreated( const QDateTime &created ) // updated(); } -QDateTime Incidence::created() const +TQDateTime Incidence::created() const { return mCreated; } @@ -253,7 +253,7 @@ int Incidence::revision() const return mRevision; } -void Incidence::setDtStart(const QDateTime &dtStart) +void Incidence::setDtStart(const TQDateTime &dtStart) { if ( mRecurrence ) { mRecurrence->setStartDateTime( dtStart ); @@ -262,49 +262,49 @@ void Incidence::setDtStart(const QDateTime &dtStart) IncidenceBase::setDtStart( dtStart ); } -void Incidence::setDescription(const QString &description) +void Incidence::setDescription(const TQString &description) { if (mReadOnly) return; mDescription = description; updated(); } -QString Incidence::description() const +TQString Incidence::description() const { return mDescription; } -void Incidence::setSummary(const QString &summary) +void Incidence::setSummary(const TQString &summary) { if (mReadOnly) return; mSummary = summary; updated(); } -QString Incidence::summary() const +TQString Incidence::summary() const { return mSummary; } -void Incidence::setCategories(const QStringList &categories) +void Incidence::setCategories(const TQStringList &categories) { if (mReadOnly) return; mCategories = categories; updated(); } -// TODO: remove setCategories(QString) function -void Incidence::setCategories(const QString &catStr) +// TODO: remove setCategories(TQString) function +void Incidence::setCategories(const TQString &catStr) { if (mReadOnly) return; mCategories.clear(); if (catStr.isEmpty()) return; - mCategories = QStringList::split(",",catStr); + mCategories = TQStringList::split(",",catStr); - QStringList::Iterator it; + TQStringList::Iterator it; for(it = mCategories.begin();it != mCategories.end(); ++it) { *it = (*it).stripWhiteSpace(); } @@ -312,24 +312,24 @@ void Incidence::setCategories(const QString &catStr) updated(); } -QStringList Incidence::categories() const +TQStringList Incidence::categories() const { return mCategories; } -QString Incidence::categoriesStr() const +TQString Incidence::categoriesStr() const { return mCategories.join(","); } -void Incidence::setRelatedToUid(const QString &relatedToUid) +void Incidence::setRelatedToUid(const TQString &relatedToUid) { if ( mReadOnly || mRelatedToUid == relatedToUid ) return; mRelatedToUid = relatedToUid; updated(); } -QString Incidence::relatedToUid() const +TQString Incidence::relatedToUid() const { return mRelatedToUid; } @@ -345,7 +345,7 @@ void Incidence::setRelatedTo(Incidence *relatedTo) if ( mRelatedTo->uid() != mRelatedToUid ) setRelatedToUid( mRelatedTo->uid() ); } else { - setRelatedToUid( QString::null ); + setRelatedToUid( TQString::null ); } } @@ -372,7 +372,7 @@ void Incidence::removeRelation(Incidence *event) { mRelations.removeRef(event); // if (event->getRelatedTo() == this) event->setRelatedTo(0); - mRelatedToUid=QString(); + mRelatedToUid=TQString(); } @@ -411,12 +411,12 @@ bool Incidence::doesRecur() const else return false; } -bool Incidence::recursOn(const QDate &qd) const +bool Incidence::recursOn(const TQDate &qd) const { return ( mRecurrence && mRecurrence->recursOn(qd) ); } -bool Incidence::recursAt(const QDateTime &qdt) const +bool Incidence::recursAt(const TQDateTime &qdt) const { return ( mRecurrence && mRecurrence->recursAt(qdt) ); } @@ -429,13 +429,13 @@ bool Incidence::recursAt(const QDateTime &qdt) const @return the start date/time of all occurences that overlap with the given date. Empty list if the incidence does not overlap with the date at all */ -QValueList<QDateTime> Incidence::startDateTimesForDate( const QDate &date ) const +TQValueList<TQDateTime> Incidence::startDateTimesForDate( const TQDate &date ) const { //kdDebug(5800) << "Incidence::startDateTimesForDate " << date << ", incidence=" << summary() << endl; - QDateTime start = dtStart(); - QDateTime end = endDateRecurrenceBase(); + TQDateTime start = dtStart(); + TQDateTime end = endDateRecurrenceBase(); - QValueList<QDateTime> result; + TQValueList<TQDateTime> result; // TODO_Recurrence: Also work if only due date is given... if ( !start.isValid() && ! end.isValid() ) { @@ -452,13 +452,13 @@ QValueList<QDateTime> Incidence::startDateTimesForDate( const QDate &date ) cons int days = start.daysTo( end ); // Account for possible recurrences going over midnight, while the original event doesn't - QDate tmpday( date.addDays( -days - 1 ) ); - QDateTime tmp; + TQDate tmpday( date.addDays( -days - 1 ) ); + TQDateTime tmp; while ( tmpday <= date ) { if ( recurrence()->recursOn( tmpday ) ) { - QValueList<QTime> times = recurrence()->recurTimesOn( tmpday ); - for ( QValueList<QTime>::ConstIterator it = times.begin(); it != times.end(); ++it ) { - tmp = QDateTime( tmpday, *it ); + TQValueList<TQTime> times = recurrence()->recurTimesOn( tmpday ); + for ( TQValueList<TQTime>::ConstIterator it = times.begin(); it != times.end(); ++it ) { + tmp = TQDateTime( tmpday, *it ); if ( endDateForStart( tmp ).date() >= date ) result << tmp; } @@ -476,13 +476,13 @@ QValueList<QDateTime> Incidence::startDateTimesForDate( const QDate &date ) cons date/time. Empty list if the incidence does not happen at the given time at all. */ -QValueList<QDateTime> Incidence::startDateTimesForDateTime( const QDateTime &datetime ) const +TQValueList<TQDateTime> Incidence::startDateTimesForDateTime( const TQDateTime &datetime ) const { // kdDebug(5800) << "Incidence::startDateTimesForDateTime " << datetime << ", incidence=" << summary() << endl; - QDateTime start = dtStart(); - QDateTime end = endDateRecurrenceBase(); + TQDateTime start = dtStart(); + TQDateTime end = endDateRecurrenceBase(); - QValueList<QDateTime> result; + TQValueList<TQDateTime> result; // TODO_Recurrence: Also work if only due date is given... if ( !start.isValid() && ! end.isValid() ) { @@ -499,13 +499,13 @@ QValueList<QDateTime> Incidence::startDateTimesForDateTime( const QDateTime &dat int days = start.daysTo( end ); // Account for possible recurrences going over midnight, while the original event doesn't - QDate tmpday( datetime.date().addDays( -days - 1 ) ); - QDateTime tmp; + TQDate tmpday( datetime.date().addDays( -days - 1 ) ); + TQDateTime tmp; while ( tmpday <= datetime.date() ) { if ( recurrence()->recursOn( tmpday ) ) { - QValueList<QTime> times = recurrence()->recurTimesOn( tmpday ); - for ( QValueList<QTime>::ConstIterator it = times.begin(); it != times.end(); ++it ) { - tmp = QDateTime( tmpday, *it ); + TQValueList<TQTime> times = recurrence()->recurTimesOn( tmpday ); + for ( TQValueList<TQTime>::ConstIterator it = times.begin(); it != times.end(); ++it ) { + tmp = TQDateTime( tmpday, *it ); if ( !(tmp > datetime || endDateForStart( tmp ) < datetime ) ) result << tmp; } @@ -516,10 +516,10 @@ QValueList<QDateTime> Incidence::startDateTimesForDateTime( const QDateTime &dat } /** Return the end time of the occurrence if it starts at the given date/time */ -QDateTime Incidence::endDateForStart( const QDateTime &startDt ) const +TQDateTime Incidence::endDateForStart( const TQDateTime &startDt ) const { - QDateTime start = dtStart(); - QDateTime end = endDateRecurrenceBase(); + TQDateTime start = dtStart(); + TQDateTime end = endDateRecurrenceBase(); if ( !end.isValid() ) return start; if ( !start.isValid() ) return end; @@ -536,7 +536,7 @@ QDateTime Incidence::endDateForStart( const QDateTime &startDt ) const updated(); } -void Incidence::addExDate( const QDate &date ) +void Incidence::addExDate( const TQDate &date ) { if ( mReadOnly ) return; recurrence()->addExDate( date ); @@ -558,7 +558,7 @@ void Incidence::setExDateTimes( const DateTimeList &exDates ) updated(); } -void Incidence::addExDateTime( const QDateTime &date ) +void Incidence::addExDateTime( const TQDateTime &date ) { if ( mReadOnly ) return; recurrence()->addExDateTime( date ); @@ -580,7 +580,7 @@ void Incidence::setRDates(const DateList &exDates) updated(); } -void Incidence::addRDate( const QDate &date ) +void Incidence::addRDate( const TQDate &date ) { if ( mReadOnly ) return; recurrence()->addRDate( date ); @@ -602,7 +602,7 @@ void Incidence::setRDateTimes( const DateTimeList &exDates ) updated(); } -void Incidence::addRDateTime( const QDateTime &date ) +void Incidence::addRDateTime( const TQDateTime &date ) { if ( mReadOnly ) return; recurrence()->addRDateTime( date ); @@ -629,7 +629,7 @@ void Incidence::deleteAttachment(Attachment *attachment) mAttachments.removeRef(attachment); } -void Incidence::deleteAttachments( const QString &mime ) +void Incidence::deleteAttachments( const TQString &mime ) { Attachment::List::Iterator it = mAttachments.begin(); while( it != mAttachments.end() ) { @@ -643,7 +643,7 @@ Attachment::List Incidence::attachments() const return mAttachments; } -Attachment::List Incidence::attachments(const QString& mime) const +Attachment::List Incidence::attachments(const TQString& mime) const { Attachment::List attachments; Attachment::List::ConstIterator it; @@ -659,14 +659,14 @@ void Incidence::clearAttachments() mAttachments.clearAll(); } -void Incidence::setResources(const QStringList &resources) +void Incidence::setResources(const TQStringList &resources) { if (mReadOnly) return; mResources = resources; updated(); } -QStringList Incidence::resources() const +TQStringList Incidence::resources() const { return mResources; } @@ -688,11 +688,11 @@ void Incidence::setStatus(Incidence::Status status) { if (mReadOnly || status == StatusX) return; mStatus = status; - mStatusString = QString::null; + mStatusString = TQString::null; updated(); } -void Incidence::setCustomStatus(const QString &status) +void Incidence::setCustomStatus(const TQString &status) { if (mReadOnly) return; mStatus = status.isEmpty() ? StatusNone : StatusX; @@ -705,14 +705,14 @@ Incidence::Status Incidence::status() const return mStatus; } -QString Incidence::statusStr() const +TQString Incidence::statusStr() const { if (mStatus == StatusX) return mStatusString; return statusName(mStatus); } -QString Incidence::statusName(Incidence::Status status) +TQString Incidence::statusName(Incidence::Status status) { switch (status) { case StatusTentative: return i18n("incidence status", "Tentative"); @@ -725,7 +725,7 @@ QString Incidence::statusName(Incidence::Status status) case StatusFinal: return i18n("Final"); case StatusX: case StatusNone: - default: return QString::null; + default: return TQString::null; } } @@ -741,12 +741,12 @@ int Incidence::secrecy() const return mSecrecy; } -QString Incidence::secrecyStr() const +TQString Incidence::secrecyStr() const { return secrecyName(mSecrecy); } -QString Incidence::secrecyName(int secrecy) +TQString Incidence::secrecyName(int secrecy) { switch (secrecy) { case SecrecyPublic: @@ -760,9 +760,9 @@ QString Incidence::secrecyName(int secrecy) } } -QStringList Incidence::secrecyList() +TQStringList Incidence::secrecyList() { - QStringList list; + TQStringList list; list << secrecyName(SecrecyPublic); list << secrecyName(SecrecyPrivate); list << secrecyName(SecrecyConfidential); @@ -811,24 +811,24 @@ bool Incidence::isAlarmEnabled() const return false; } -void Incidence::setLocation(const QString &location) +void Incidence::setLocation(const TQString &location) { if (mReadOnly) return; mLocation = location; updated(); } -QString Incidence::location() const +TQString Incidence::location() const { return mLocation; } -void Incidence::setSchedulingID( const QString& sid ) +void Incidence::setSchedulingID( const TQString& sid ) { mSchedulingID = sid; } -QString Incidence::schedulingID() const +TQString Incidence::schedulingID() const { if ( mSchedulingID.isNull() ) // Nothing set, so use the normal uid |