summaryrefslogtreecommitdiffabout
path: root/libkcal/incidence.cpp
authorzautrix <zautrix>2005-04-18 10:41:31 (UTC)
committer zautrix <zautrix>2005-04-18 10:41:31 (UTC)
commit409e329447a7d00a93a56855fcddadbb0f793163 (patch) (unidiff)
tree1c92498d2dfb4c89358c64a6944aca1300a27d11 /libkcal/incidence.cpp
parent0ff0dca7ccb94ebb1381351e4e4081fe0bac500a (diff)
downloadkdepimpi-409e329447a7d00a93a56855fcddadbb0f793163.zip
kdepimpi-409e329447a7d00a93a56855fcddadbb0f793163.tar.gz
kdepimpi-409e329447a7d00a93a56855fcddadbb0f793163.tar.bz2
morefixes
Diffstat (limited to 'libkcal/incidence.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/incidence.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index 9c35b1d..762103f 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -346,5 +346,24 @@ void Incidence::checkCategories()
346} 346}
347 347
348void Incidence::setCategories(const QStringList &categories) 348void Incidence::addCategories(const QStringList &categories, bool addToRelations ) //addToRelations = false
349{
350 if (mReadOnly) return;
351 int i;
352 for( i = 0; i < categories.count(); ++i ) {
353 if ( !mCategories.contains (categories[i]))
354 mCategories.append( categories[i] );
355 }
356 checkCategories();
357 updated();
358 if ( addToRelations ) {
359 Incidence * inc;
360 QPtrList<Incidence> Relations = relations();
361 for (inc=Relations.first();inc;inc=Relations.next()) {
362 inc->addCategories( categories, true );
363 }
364 }
365}
366
367void Incidence::setCategories(const QStringList &categories, bool setForRelations ) //setForRelations = false
349{ 368{
350 if (mReadOnly) return; 369 if (mReadOnly) return;
@@ -352,4 +371,11 @@ void Incidence::setCategories(const QStringList &categories)
352 checkCategories(); 371 checkCategories();
353 updated(); 372 updated();
373 if ( setForRelations ) {
374 Incidence * inc;
375 QPtrList<Incidence> Relations = relations();
376 for (inc=Relations.first();inc;inc=Relations.next()) {
377 inc->setCategories( categories, true );
378 }
379 }
354} 380}
355 381