~ubuntu-branches/ubuntu/quantal/kdepim/quantal

« back to all changes in this revision

Viewing changes to calendarviews/eventviews/agenda/agendaitem.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-15 14:17:51 UTC
  • mto: This revision was merged to the branch mainline in revision 193.
  • Revision ID: package-import@ubuntu.com-20111215141751-bmhdpiwl23wd9w26
Tags: upstream-4.7.90
ImportĀ upstreamĀ versionĀ 4.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
137
137
      mIconGroupTent = false;
138
138
      mIconOrganizer = true;
139
139
    } else {
140
 
      KCalCore::Attendee::Ptr me = incidence->attendeeByMails( mEventView->kcalPreferences()->allEmails() );
 
140
      KCalCore::Attendee::Ptr me =
 
141
        incidence->attendeeByMails( mEventView->kcalPreferences()->allEmails() );
 
142
 
141
143
      if ( me ) {
142
144
        if ( me->status() == KCalCore::Attendee::NeedsAction && me->RSVP() ) {
143
145
          mIconReply = true;
667
669
  KABC::Addressee::List list;
668
670
 
669
671
  if ( KABC::VCardDrag::fromMimeData( md, list ) ) {
670
 
    Q_FOREACH( const KABC::Addressee &addressee, list ) {
 
672
    Q_FOREACH ( const KABC::Addressee &addressee, list ) {
671
673
      QString em( addressee.fullEmail() );
672
674
      if ( em.isEmpty() ) {
673
675
        em = addressee.realName();
770
772
    conditionalPaint( p, !mSpecialEvent, x, y, ft, SmallIcon( iconName ) );
771
773
  }
772
774
 
773
 
  if ( icons.contains( EventView::RecurringIcon ) )
 
775
  if ( icons.contains( EventView::RecurringIcon ) ) {
774
776
    conditionalPaint( p, mIconRecur && !mSpecialEvent, x, y, ft, *recurPxmp );
 
777
  }
775
778
 
776
 
  if ( icons.contains( EventView::ReminderIcon ) )
 
779
  if ( icons.contains( EventView::ReminderIcon ) ) {
777
780
    conditionalPaint( p, mIconAlarm && !mSpecialEvent, x, y, ft, *alarmPxmp );
 
781
  }
778
782
 
779
 
  if ( icons.contains( EventView::ReadOnlyIcon ) )
 
783
  if ( icons.contains( EventView::ReadOnlyIcon ) ) {
780
784
    conditionalPaint( p, mIconReadonly && !mSpecialEvent, x, y, ft, *readonlyPxmp );
 
785
  }
781
786
 
782
 
  if ( icons.contains( EventView::ReplyIcon ) )
 
787
  if ( icons.contains( EventView::ReplyIcon ) ) {
783
788
    conditionalPaint( p, mIconReply, x, y, ft, *replyPxmp );
 
789
  }
784
790
 
785
 
  if ( icons.contains( EventView::AttendingIcon ) )
 
791
  if ( icons.contains( EventView::AttendingIcon ) ) {
786
792
    conditionalPaint( p, mIconGroup, x, y, ft, *groupPxmp );
 
793
  }
787
794
 
788
 
  if ( icons.contains( EventView::TentativeIcon ) )
 
795
  if ( icons.contains( EventView::TentativeIcon ) ) {
789
796
    conditionalPaint( p, mIconGroupTent, x, y, ft, *groupPxmpTent );
 
797
  }
790
798
 
791
 
  if ( icons.contains( EventView::OrganizerIcon ) )
 
799
  if ( icons.contains( EventView::OrganizerIcon ) ) {
792
800
    conditionalPaint( p, mIconOrganizer, x, y, ft, *organizerPxmp );
 
801
  }
793
802
}
794
803
 
795
804
void AgendaItem::paintEvent( QPaintEvent *ev )
835
844
       !mEventView->preferences()->todosUseCategoryColors() ) {
836
845
    Todo::Ptr todo = CalendarSupport::todo( mIncidence );
837
846
    Q_ASSERT( todo );
838
 
    const QDate dueDate = todo->dtDue().toTimeSpec( CalendarSupport::KCalPrefs::instance()->timeSpec() ).date();
839
 
    const QDate today = KDateTime::currentDateTime( CalendarSupport::KCalPrefs::instance()->timeSpec() ).date();
 
847
    const QDate dueDate =
 
848
      todo->dtDue().toTimeSpec( CalendarSupport::KCalPrefs::instance()->timeSpec() ).date();
 
849
    const QDate today =
 
850
      KDateTime::currentDateTime( CalendarSupport::KCalPrefs::instance()->timeSpec() ).date();
840
851
    if ( todo->isOverdue() && today >= mDate ) {
841
852
      bgColor = mEventView->preferences()->todoOverdueColor();
842
853
    } else if ( dueDate == today && dueDate == mDate ) {
924
935
  QString longH;
925
936
  if ( !isMultiItem() ) {
926
937
    // TODO: When we depend on kdepimlibs 4.7, replace with: shortH
927
 
    // KGlobal::locale()->formatTime(incidence->dateTime( KCalCore::Incidence::RoleDisplayStart ).toTimeSpec( mEventView->preferences()->timeSpec() ).time() )
 
938
    // KGlobal::locale()->formatTime(incidence->dateTime( KCalCore::Incidence::RoleDisplayStart ).
 
939
    //   toTimeSpec( mEventView->preferences()->timeSpec() ).time() )
928
940
    if ( incidence->type() == Incidence::TypeEvent ) {
929
 
      shortH = KGlobal::locale()->formatTime( incidence->dtStart().toTimeSpec( mEventView->preferences()->timeSpec() ).time() );
 
941
      shortH = KGlobal::locale()->formatTime(
 
942
        incidence->dtStart().toTimeSpec( mEventView->preferences()->timeSpec() ).time() );
930
943
    } else if ( incidence->type() == Incidence::TypeTodo ) {
931
944
      Todo::Ptr todo = CalendarSupport::todo( mIncidence );
932
 
      if ( todo )
933
 
        shortH = KGlobal::locale()->formatTime( todo->dtDue().toTimeSpec( mEventView->preferences()->timeSpec() ).time() );
 
945
      if ( todo ) {
 
946
        shortH = KGlobal::locale()->formatTime(
 
947
          todo->dtDue().toTimeSpec( mEventView->preferences()->timeSpec() ).time() );
 
948
      }
934
949
    }
935
950
    if ( CalendarSupport::hasEvent( mIncidence ) ) {
936
951
      longH = i18n( "%1 - %2",