summaryrefslogtreecommitdiffabout
path: root/libkcal/incidence.cpp
Side-by-side diff
Diffstat (limited to 'libkcal/incidence.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/incidence.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index fe9f854..7dd9bd2 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -475,96 +475,102 @@ void Incidence::setCategories(const QString &catStr)
if (mReadOnly) return;
mCategories.clear();
if (catStr.isEmpty()) return;
mCategories = QStringList::split(",",catStr);
QStringList::Iterator it;
for(it = mCategories.begin();it != mCategories.end(); ++it) {
*it = (*it).stripWhiteSpace();
}
checkCategories();
updated();
}
// using this makes filtering 3 times faster
QStringList* Incidence::categoriesP()
{
return &mCategories;
}
QStringList Incidence::categories() const
{
return mCategories;
}
QString Incidence::categoriesStr()
{
return mCategories.join(",");
}
QString Incidence::categoriesStrWithSpace()
{
return mCategories.join(", ");
}
void Incidence::setRelatedToUid(const QString &relatedToUid)
{
if (mReadOnly) return;
mRelatedToUid = relatedToUid;
}
void Incidence::clearRelations()
{
mRelatedTo = 0;
mRelations.clear();
}
QString Incidence::relatedToUid() const
{
return mRelatedToUid;
}
+void Incidence::resetRelatedTo()
+{
+ QString store = mRelatedToUid;
+ setRelatedTo( 0 );
+ mRelatedToUid = store;
+}
void Incidence::setRelatedTo(Incidence *relatedTo)
{
//qDebug("Incidence::setRelatedTo %d ", relatedTo);
//qDebug("setRelatedTo(Incidence *relatedTo) %s %s", summary().latin1(), relatedTo->summary().latin1() );
if (mReadOnly || mRelatedTo == relatedTo) return;
if(mRelatedTo) {
// updated();
mRelatedTo->removeRelation(this);
}
mRelatedTo = relatedTo;
if (mRelatedTo) {
mRelatedTo->addRelation(this);
mRelatedToUid = mRelatedTo->uid();
} else {
mRelatedToUid = "";
}
}
Incidence *Incidence::relatedTo() const
{
return mRelatedTo;
}
QPtrList<Incidence> Incidence::relations() const
{
return mRelations;
}
void Incidence::addRelationsToList(QPtrList<Incidence> *rel)
{
Incidence* inc;
QPtrList<Incidence> Relations = relations();
for (inc=Relations.first();inc;inc=Relations.next()) {
inc->addRelationsToList( rel );
}
if ( rel->findRef( this ) == -1 )
rel->append( this );
}
void Incidence::addRelation(Incidence *event)
{
setLastModifiedSubInvalid();
if( mRelations.findRef( event ) == -1 ) {
mRelations.append(event);
//updated();
}
}