-rw-r--r-- | libkcal/incidence.cpp | 6 |
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 | |||
@@ -331,384 +331,390 @@ void Incidence::cloneRelations( Incidence * newInc ) | |||
331 | } | 331 | } |
332 | } | 332 | } |
333 | void Incidence::setReadOnly( bool readOnly ) | 333 | void Incidence::setReadOnly( bool readOnly ) |
334 | { | 334 | { |
335 | IncidenceBase::setReadOnly( readOnly ); | 335 | IncidenceBase::setReadOnly( readOnly ); |
336 | if ( mRecurrence ) | 336 | if ( mRecurrence ) |
337 | mRecurrence->setRecurReadOnly( readOnly); | 337 | mRecurrence->setRecurReadOnly( readOnly); |
338 | } | 338 | } |
339 | void Incidence::setLastModifiedSubInvalid() | 339 | void Incidence::setLastModifiedSubInvalid() |
340 | { | 340 | { |
341 | mLastModifiedSub = QDateTime(); | 341 | mLastModifiedSub = QDateTime(); |
342 | if ( mRelatedTo ) | 342 | if ( mRelatedTo ) |
343 | mRelatedTo->setLastModifiedSubInvalid(); | 343 | mRelatedTo->setLastModifiedSubInvalid(); |
344 | } | 344 | } |
345 | QString Incidence::lastModifiedSubSortKey() const | 345 | QString Incidence::lastModifiedSubSortKey() const |
346 | { | 346 | { |
347 | if ( mLastModifiedSubSortKey.isEmpty() ) | 347 | if ( mLastModifiedSubSortKey.isEmpty() ) |
348 | return lastModifiedSortKey(); | 348 | return lastModifiedSortKey(); |
349 | return mLastModifiedSubSortKey; | 349 | return mLastModifiedSubSortKey; |
350 | } | 350 | } |
351 | QDateTime Incidence::lastModifiedSub() | 351 | QDateTime Incidence::lastModifiedSub() |
352 | { | 352 | { |
353 | if ( !mRelations.count() ) | 353 | if ( !mRelations.count() ) |
354 | return lastModified(); | 354 | return lastModified(); |
355 | if ( mLastModifiedSub.isValid() ) | 355 | if ( mLastModifiedSub.isValid() ) |
356 | return mLastModifiedSub; | 356 | return mLastModifiedSub; |
357 | mLastModifiedSub = lastModified(); | 357 | mLastModifiedSub = lastModified(); |
358 | Incidence * inc; | 358 | Incidence * inc; |
359 | QPtrList<Incidence> Relations = relations(); | 359 | QPtrList<Incidence> Relations = relations(); |
360 | for (inc=Relations.first();inc;inc=Relations.next()) { | 360 | for (inc=Relations.first();inc;inc=Relations.next()) { |
361 | if ( inc->lastModifiedSub() > mLastModifiedSub ) | 361 | if ( inc->lastModifiedSub() > mLastModifiedSub ) |
362 | mLastModifiedSub = inc->lastModifiedSub(); | 362 | mLastModifiedSub = inc->lastModifiedSub(); |
363 | } | 363 | } |
364 | mLastModifiedSubSortKey.sprintf("%04d%02d%02d%02d%02d%02d", | 364 | mLastModifiedSubSortKey.sprintf("%04d%02d%02d%02d%02d%02d", |
365 | mLastModifiedSub.date().year(), | 365 | mLastModifiedSub.date().year(), |
366 | mLastModifiedSub.date().month(), | 366 | mLastModifiedSub.date().month(), |
367 | mLastModifiedSub.date().day(), | 367 | mLastModifiedSub.date().day(), |
368 | mLastModifiedSub.time().hour(), | 368 | mLastModifiedSub.time().hour(), |
369 | mLastModifiedSub.time().minute(), | 369 | mLastModifiedSub.time().minute(), |
370 | mLastModifiedSub.time().second() ); | 370 | mLastModifiedSub.time().second() ); |
371 | return mLastModifiedSub; | 371 | return mLastModifiedSub; |
372 | } | 372 | } |
373 | void Incidence::setCreated(QDateTime created) | 373 | void Incidence::setCreated(QDateTime created) |
374 | { | 374 | { |
375 | if (mReadOnly) return; | 375 | if (mReadOnly) return; |
376 | mCreated = getEvenTime(created); | 376 | mCreated = getEvenTime(created); |
377 | } | 377 | } |
378 | 378 | ||
379 | QDateTime Incidence::created() const | 379 | QDateTime Incidence::created() const |
380 | { | 380 | { |
381 | return mCreated; | 381 | return mCreated; |
382 | } | 382 | } |
383 | 383 | ||
384 | void Incidence::setRevision(int rev) | 384 | void Incidence::setRevision(int rev) |
385 | { | 385 | { |
386 | if (mReadOnly) return; | 386 | if (mReadOnly) return; |
387 | mRevision = rev; | 387 | mRevision = rev; |
388 | 388 | ||
389 | updated(); | 389 | updated(); |
390 | } | 390 | } |
391 | 391 | ||
392 | int Incidence::revision() const | 392 | int Incidence::revision() const |
393 | { | 393 | { |
394 | return mRevision; | 394 | return mRevision; |
395 | } | 395 | } |
396 | 396 | ||
397 | void Incidence::setDtStart(const QDateTime &dtStart) | 397 | void Incidence::setDtStart(const QDateTime &dtStart) |
398 | { | 398 | { |
399 | 399 | ||
400 | QDateTime dt = getEvenTime(dtStart); | 400 | QDateTime dt = getEvenTime(dtStart); |
401 | 401 | ||
402 | if ( mRecurrence ) | 402 | if ( mRecurrence ) |
403 | mRecurrence->setRecurStart( dt); | 403 | mRecurrence->setRecurStart( dt); |
404 | IncidenceBase::setDtStart( dt ); | 404 | IncidenceBase::setDtStart( dt ); |
405 | } | 405 | } |
406 | 406 | ||
407 | void Incidence::setDescription(const QString &description) | 407 | void Incidence::setDescription(const QString &description) |
408 | { | 408 | { |
409 | if (mReadOnly) return; | 409 | if (mReadOnly) return; |
410 | mDescription = description; | 410 | mDescription = description; |
411 | updated(); | 411 | updated(); |
412 | } | 412 | } |
413 | 413 | ||
414 | QString Incidence::description() const | 414 | QString Incidence::description() const |
415 | { | 415 | { |
416 | return mDescription; | 416 | return mDescription; |
417 | } | 417 | } |
418 | 418 | ||
419 | 419 | ||
420 | void Incidence::setSummary(const QString &summary) | 420 | void Incidence::setSummary(const QString &summary) |
421 | { | 421 | { |
422 | if (mReadOnly) return; | 422 | if (mReadOnly) return; |
423 | mSummary = summary; | 423 | mSummary = summary; |
424 | updated(); | 424 | updated(); |
425 | } | 425 | } |
426 | 426 | ||
427 | QString Incidence::summary() const | 427 | QString Incidence::summary() const |
428 | { | 428 | { |
429 | return mSummary; | 429 | return mSummary; |
430 | } | 430 | } |
431 | void Incidence::checkCategories() | 431 | void Incidence::checkCategories() |
432 | { | 432 | { |
433 | mHoliday = mCategories.contains("Holiday") || mCategories.contains(i18n("Holiday")); | 433 | mHoliday = mCategories.contains("Holiday") || mCategories.contains(i18n("Holiday")); |
434 | mBirthday = mCategories.contains("Birthday") || mCategories.contains(i18n("Birthday")); | 434 | mBirthday = mCategories.contains("Birthday") || mCategories.contains(i18n("Birthday")); |
435 | mAnniversary = mCategories.contains("Anniversary") || mCategories.contains(i18n("Anniversary")); | 435 | mAnniversary = mCategories.contains("Anniversary") || mCategories.contains(i18n("Anniversary")); |
436 | } | 436 | } |
437 | 437 | ||
438 | void Incidence::addCategories(const QStringList &categories, bool addToRelations ) //addToRelations = false | 438 | void Incidence::addCategories(const QStringList &categories, bool addToRelations ) //addToRelations = false |
439 | { | 439 | { |
440 | if (mReadOnly) return; | 440 | if (mReadOnly) return; |
441 | int i; | 441 | int i; |
442 | for( i = 0; i < categories.count(); ++i ) { | 442 | for( i = 0; i < categories.count(); ++i ) { |
443 | if ( !mCategories.contains (categories[i])) | 443 | if ( !mCategories.contains (categories[i])) |
444 | mCategories.append( categories[i] ); | 444 | mCategories.append( categories[i] ); |
445 | } | 445 | } |
446 | checkCategories(); | 446 | checkCategories(); |
447 | updated(); | 447 | updated(); |
448 | if ( addToRelations ) { | 448 | if ( addToRelations ) { |
449 | Incidence * inc; | 449 | Incidence * inc; |
450 | QPtrList<Incidence> Relations = relations(); | 450 | QPtrList<Incidence> Relations = relations(); |
451 | for (inc=Relations.first();inc;inc=Relations.next()) { | 451 | for (inc=Relations.first();inc;inc=Relations.next()) { |
452 | inc->addCategories( categories, true ); | 452 | inc->addCategories( categories, true ); |
453 | } | 453 | } |
454 | } | 454 | } |
455 | } | 455 | } |
456 | 456 | ||
457 | void Incidence::setCategories(const QStringList &categories, bool setForRelations ) //setForRelations = false | 457 | void Incidence::setCategories(const QStringList &categories, bool setForRelations ) //setForRelations = false |
458 | { | 458 | { |
459 | if (mReadOnly) return; | 459 | if (mReadOnly) return; |
460 | mCategories = categories; | 460 | mCategories = categories; |
461 | checkCategories(); | 461 | checkCategories(); |
462 | updated(); | 462 | updated(); |
463 | if ( setForRelations ) { | 463 | if ( setForRelations ) { |
464 | Incidence * inc; | 464 | Incidence * inc; |
465 | QPtrList<Incidence> Relations = relations(); | 465 | QPtrList<Incidence> Relations = relations(); |
466 | for (inc=Relations.first();inc;inc=Relations.next()) { | 466 | for (inc=Relations.first();inc;inc=Relations.next()) { |
467 | inc->setCategories( categories, true ); | 467 | inc->setCategories( categories, true ); |
468 | } | 468 | } |
469 | } | 469 | } |
470 | } | 470 | } |
471 | 471 | ||
472 | // TODO: remove setCategories(QString) function | 472 | // TODO: remove setCategories(QString) function |
473 | void Incidence::setCategories(const QString &catStr) | 473 | void Incidence::setCategories(const QString &catStr) |
474 | { | 474 | { |
475 | if (mReadOnly) return; | 475 | if (mReadOnly) return; |
476 | mCategories.clear(); | 476 | mCategories.clear(); |
477 | 477 | ||
478 | if (catStr.isEmpty()) return; | 478 | if (catStr.isEmpty()) return; |
479 | 479 | ||
480 | mCategories = QStringList::split(",",catStr); | 480 | mCategories = QStringList::split(",",catStr); |
481 | 481 | ||
482 | QStringList::Iterator it; | 482 | QStringList::Iterator it; |
483 | for(it = mCategories.begin();it != mCategories.end(); ++it) { | 483 | for(it = mCategories.begin();it != mCategories.end(); ++it) { |
484 | *it = (*it).stripWhiteSpace(); | 484 | *it = (*it).stripWhiteSpace(); |
485 | } | 485 | } |
486 | checkCategories(); | 486 | checkCategories(); |
487 | updated(); | 487 | updated(); |
488 | } | 488 | } |
489 | // using this makes filtering 3 times faster | 489 | // using this makes filtering 3 times faster |
490 | QStringList* Incidence::categoriesP() | 490 | QStringList* Incidence::categoriesP() |
491 | { | 491 | { |
492 | return &mCategories; | 492 | return &mCategories; |
493 | } | 493 | } |
494 | 494 | ||
495 | QStringList Incidence::categories() const | 495 | QStringList Incidence::categories() const |
496 | { | 496 | { |
497 | return mCategories; | 497 | return mCategories; |
498 | } | 498 | } |
499 | 499 | ||
500 | QString Incidence::categoriesStr() | 500 | QString Incidence::categoriesStr() |
501 | { | 501 | { |
502 | return mCategories.join(","); | 502 | return mCategories.join(","); |
503 | } | 503 | } |
504 | QString Incidence::categoriesStrWithSpace() | 504 | QString Incidence::categoriesStrWithSpace() |
505 | { | 505 | { |
506 | return mCategories.join(", "); | 506 | return mCategories.join(", "); |
507 | } | 507 | } |
508 | 508 | ||
509 | void Incidence::setRelatedToUid(const QString &relatedToUid) | 509 | void Incidence::setRelatedToUid(const QString &relatedToUid) |
510 | { | 510 | { |
511 | if (mReadOnly) return; | 511 | if (mReadOnly) return; |
512 | mRelatedToUid = relatedToUid; | 512 | mRelatedToUid = relatedToUid; |
513 | } | 513 | } |
514 | void Incidence::clearRelations() | 514 | void Incidence::clearRelations() |
515 | { | 515 | { |
516 | mRelatedTo = 0; | 516 | mRelatedTo = 0; |
517 | mRelations.clear(); | 517 | mRelations.clear(); |
518 | } | 518 | } |
519 | QString Incidence::relatedToUid() const | 519 | QString Incidence::relatedToUid() const |
520 | { | 520 | { |
521 | return mRelatedToUid; | 521 | return mRelatedToUid; |
522 | } | 522 | } |
523 | void Incidence::resetRelatedTo() | ||
524 | { | ||
525 | QString store = mRelatedToUid; | ||
526 | setRelatedTo( 0 ); | ||
527 | mRelatedToUid = store; | ||
528 | } | ||
523 | 529 | ||
524 | void Incidence::setRelatedTo(Incidence *relatedTo) | 530 | void Incidence::setRelatedTo(Incidence *relatedTo) |
525 | { | 531 | { |
526 | //qDebug("Incidence::setRelatedTo %d ", relatedTo); | 532 | //qDebug("Incidence::setRelatedTo %d ", relatedTo); |
527 | //qDebug("setRelatedTo(Incidence *relatedTo) %s %s", summary().latin1(), relatedTo->summary().latin1() ); | 533 | //qDebug("setRelatedTo(Incidence *relatedTo) %s %s", summary().latin1(), relatedTo->summary().latin1() ); |
528 | if (mReadOnly || mRelatedTo == relatedTo) return; | 534 | if (mReadOnly || mRelatedTo == relatedTo) return; |
529 | if(mRelatedTo) { | 535 | if(mRelatedTo) { |
530 | // updated(); | 536 | // updated(); |
531 | mRelatedTo->removeRelation(this); | 537 | mRelatedTo->removeRelation(this); |
532 | } | 538 | } |
533 | mRelatedTo = relatedTo; | 539 | mRelatedTo = relatedTo; |
534 | if (mRelatedTo) { | 540 | if (mRelatedTo) { |
535 | mRelatedTo->addRelation(this); | 541 | mRelatedTo->addRelation(this); |
536 | mRelatedToUid = mRelatedTo->uid(); | 542 | mRelatedToUid = mRelatedTo->uid(); |
537 | } else { | 543 | } else { |
538 | mRelatedToUid = ""; | 544 | mRelatedToUid = ""; |
539 | } | 545 | } |
540 | } | 546 | } |
541 | 547 | ||
542 | Incidence *Incidence::relatedTo() const | 548 | Incidence *Incidence::relatedTo() const |
543 | { | 549 | { |
544 | return mRelatedTo; | 550 | return mRelatedTo; |
545 | } | 551 | } |
546 | 552 | ||
547 | QPtrList<Incidence> Incidence::relations() const | 553 | QPtrList<Incidence> Incidence::relations() const |
548 | { | 554 | { |
549 | return mRelations; | 555 | return mRelations; |
550 | } | 556 | } |
551 | 557 | ||
552 | void Incidence::addRelationsToList(QPtrList<Incidence> *rel) | 558 | void Incidence::addRelationsToList(QPtrList<Incidence> *rel) |
553 | { | 559 | { |
554 | Incidence* inc; | 560 | Incidence* inc; |
555 | QPtrList<Incidence> Relations = relations(); | 561 | QPtrList<Incidence> Relations = relations(); |
556 | for (inc=Relations.first();inc;inc=Relations.next()) { | 562 | for (inc=Relations.first();inc;inc=Relations.next()) { |
557 | inc->addRelationsToList( rel ); | 563 | inc->addRelationsToList( rel ); |
558 | } | 564 | } |
559 | if ( rel->findRef( this ) == -1 ) | 565 | if ( rel->findRef( this ) == -1 ) |
560 | rel->append( this ); | 566 | rel->append( this ); |
561 | } | 567 | } |
562 | 568 | ||
563 | void Incidence::addRelation(Incidence *event) | 569 | void Incidence::addRelation(Incidence *event) |
564 | { | 570 | { |
565 | setLastModifiedSubInvalid(); | 571 | setLastModifiedSubInvalid(); |
566 | if( mRelations.findRef( event ) == -1 ) { | 572 | if( mRelations.findRef( event ) == -1 ) { |
567 | mRelations.append(event); | 573 | mRelations.append(event); |
568 | //updated(); | 574 | //updated(); |
569 | } | 575 | } |
570 | } | 576 | } |
571 | 577 | ||
572 | void Incidence::removeRelation(Incidence *event) | 578 | void Incidence::removeRelation(Incidence *event) |
573 | { | 579 | { |
574 | setLastModifiedSubInvalid(); | 580 | setLastModifiedSubInvalid(); |
575 | mRelations.removeRef(event); | 581 | mRelations.removeRef(event); |
576 | // if (event->getRelatedTo() == this) event->setRelatedTo(0); | 582 | // if (event->getRelatedTo() == this) event->setRelatedTo(0); |
577 | } | 583 | } |
578 | 584 | ||
579 | bool Incidence::recursOn(const QDate &qd) const | 585 | bool Incidence::recursOn(const QDate &qd) const |
580 | { | 586 | { |
581 | if (mRecurrence && mRecurrence->recursOnPure(qd) && !isException(qd)) return true; | 587 | if (mRecurrence && mRecurrence->recursOnPure(qd) && !isException(qd)) return true; |
582 | else return false; | 588 | else return false; |
583 | } | 589 | } |
584 | 590 | ||
585 | void Incidence::setExDates(const DateList &exDates) | 591 | void Incidence::setExDates(const DateList &exDates) |
586 | { | 592 | { |
587 | if (mReadOnly) return; | 593 | if (mReadOnly) return; |
588 | mExDates = exDates; | 594 | mExDates = exDates; |
589 | recurrence()->setRecurExDatesCount(mExDates.count()); | 595 | recurrence()->setRecurExDatesCount(mExDates.count()); |
590 | 596 | ||
591 | updated(); | 597 | updated(); |
592 | } | 598 | } |
593 | 599 | ||
594 | void Incidence::addExDate(const QDate &date) | 600 | void Incidence::addExDate(const QDate &date) |
595 | { | 601 | { |
596 | if (mReadOnly) return; | 602 | if (mReadOnly) return; |
597 | mExDates.append(date); | 603 | mExDates.append(date); |
598 | 604 | ||
599 | recurrence()->setRecurExDatesCount(mExDates.count()); | 605 | recurrence()->setRecurExDatesCount(mExDates.count()); |
600 | 606 | ||
601 | updated(); | 607 | updated(); |
602 | } | 608 | } |
603 | 609 | ||
604 | DateList Incidence::exDates() const | 610 | DateList Incidence::exDates() const |
605 | { | 611 | { |
606 | return mExDates; | 612 | return mExDates; |
607 | } | 613 | } |
608 | 614 | ||
609 | bool Incidence::isException(const QDate &date) const | 615 | bool Incidence::isException(const QDate &date) const |
610 | { | 616 | { |
611 | DateList::ConstIterator it; | 617 | DateList::ConstIterator it; |
612 | for( it = mExDates.begin(); it != mExDates.end(); ++it ) { | 618 | for( it = mExDates.begin(); it != mExDates.end(); ++it ) { |
613 | if ( (*it) == date ) { | 619 | if ( (*it) == date ) { |
614 | return true; | 620 | return true; |
615 | } | 621 | } |
616 | } | 622 | } |
617 | 623 | ||
618 | return false; | 624 | return false; |
619 | } | 625 | } |
620 | 626 | ||
621 | void Incidence::addAttachment(Attachment *attachment) | 627 | void Incidence::addAttachment(Attachment *attachment) |
622 | { | 628 | { |
623 | if (mReadOnly || !attachment) return; | 629 | if (mReadOnly || !attachment) return; |
624 | mAttachments.append(attachment); | 630 | mAttachments.append(attachment); |
625 | updated(); | 631 | updated(); |
626 | } | 632 | } |
627 | 633 | ||
628 | void Incidence::deleteAttachment(Attachment *attachment) | 634 | void Incidence::deleteAttachment(Attachment *attachment) |
629 | { | 635 | { |
630 | mAttachments.removeRef(attachment); | 636 | mAttachments.removeRef(attachment); |
631 | } | 637 | } |
632 | 638 | ||
633 | void Incidence::deleteAttachments(const QString& mime) | 639 | void Incidence::deleteAttachments(const QString& mime) |
634 | { | 640 | { |
635 | Attachment *at = mAttachments.first(); | 641 | Attachment *at = mAttachments.first(); |
636 | while (at) { | 642 | while (at) { |
637 | if (at->mimeType() == mime) | 643 | if (at->mimeType() == mime) |
638 | mAttachments.remove(); | 644 | mAttachments.remove(); |
639 | else | 645 | else |
640 | at = mAttachments.next(); | 646 | at = mAttachments.next(); |
641 | } | 647 | } |
642 | } | 648 | } |
643 | 649 | ||
644 | QPtrList<Attachment> Incidence::attachments() const | 650 | QPtrList<Attachment> Incidence::attachments() const |
645 | { | 651 | { |
646 | return mAttachments; | 652 | return mAttachments; |
647 | } | 653 | } |
648 | 654 | ||
649 | QPtrList<Attachment> Incidence::attachments(const QString& mime) const | 655 | QPtrList<Attachment> Incidence::attachments(const QString& mime) const |
650 | { | 656 | { |
651 | QPtrList<Attachment> attachments; | 657 | QPtrList<Attachment> attachments; |
652 | QPtrListIterator<Attachment> it( mAttachments ); | 658 | QPtrListIterator<Attachment> it( mAttachments ); |
653 | Attachment *at; | 659 | Attachment *at; |
654 | while ( (at = it.current()) ) { | 660 | while ( (at = it.current()) ) { |
655 | if (at->mimeType() == mime) | 661 | if (at->mimeType() == mime) |
656 | attachments.append(at); | 662 | attachments.append(at); |
657 | ++it; | 663 | ++it; |
658 | } | 664 | } |
659 | 665 | ||
660 | return attachments; | 666 | return attachments; |
661 | } | 667 | } |
662 | 668 | ||
663 | void Incidence::setResources(const QStringList &resources) | 669 | void Incidence::setResources(const QStringList &resources) |
664 | { | 670 | { |
665 | if (mReadOnly) return; | 671 | if (mReadOnly) return; |
666 | mResources = resources; | 672 | mResources = resources; |
667 | updated(); | 673 | updated(); |
668 | } | 674 | } |
669 | 675 | ||
670 | QStringList Incidence::resources() const | 676 | QStringList Incidence::resources() const |
671 | { | 677 | { |
672 | return mResources; | 678 | return mResources; |
673 | } | 679 | } |
674 | 680 | ||
675 | 681 | ||
676 | void Incidence::setPriority(int priority) | 682 | void Incidence::setPriority(int priority) |
677 | { | 683 | { |
678 | if (mReadOnly) return; | 684 | if (mReadOnly) return; |
679 | mPriority = priority; | 685 | mPriority = priority; |
680 | updated(); | 686 | updated(); |
681 | } | 687 | } |
682 | 688 | ||
683 | int Incidence::priority() const | 689 | int Incidence::priority() const |
684 | { | 690 | { |
685 | return mPriority; | 691 | return mPriority; |
686 | } | 692 | } |
687 | 693 | ||
688 | void Incidence::setSecrecy(int sec) | 694 | void Incidence::setSecrecy(int sec) |
689 | { | 695 | { |
690 | if (mReadOnly) return; | 696 | if (mReadOnly) return; |
691 | mSecrecy = sec; | 697 | mSecrecy = sec; |
692 | updated(); | 698 | updated(); |
693 | } | 699 | } |
694 | 700 | ||
695 | int Incidence::secrecy() const | 701 | int Incidence::secrecy() const |
696 | { | 702 | { |
697 | return mSecrecy; | 703 | return mSecrecy; |
698 | } | 704 | } |
699 | 705 | ||
700 | QString Incidence::secrecyStr() const | 706 | QString Incidence::secrecyStr() const |
701 | { | 707 | { |
702 | return secrecyName(mSecrecy); | 708 | return secrecyName(mSecrecy); |
703 | } | 709 | } |
704 | 710 | ||
705 | QString Incidence::secrecyName(int secrecy) | 711 | QString Incidence::secrecyName(int secrecy) |
706 | { | 712 | { |
707 | switch (secrecy) { | 713 | switch (secrecy) { |
708 | case SecrecyPublic: | 714 | case SecrecyPublic: |
709 | return i18n("Public"); | 715 | return i18n("Public"); |
710 | break; | 716 | break; |
711 | case SecrecyPrivate: | 717 | case SecrecyPrivate: |
712 | return i18n("Private"); | 718 | return i18n("Private"); |
713 | break; | 719 | break; |
714 | case SecrecyConfidential: | 720 | case SecrecyConfidential: |