~ubuntu-branches/ubuntu/saucy/kdepimlibs/saucy-proposed

« back to all changes in this revision

Viewing changes to kcalutils/incidenceformatter.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-01-18 15:30:41 UTC
  • mfrom: (1.1.89)
  • Revision ID: package-import@ubuntu.com-20130118153041-ruwjeuwz7w27x8dp
Tags: 4:4.9.98-0ubuntu1
New upstream release candidate

Show diffs side-by-side

added added

removed removed

Lines of Context:
2487
2487
    return tmpStr;
2488
2488
  }
2489
2489
 
 
2490
  if ( incidence->type() == Incidence::TypeFreeBusy ) {
 
2491
    // A FreeBusy does not have a valid attachment due to the static-cast from IncidenceBase
 
2492
    return tmpStr;
 
2493
  }
 
2494
 
2490
2495
  Attachment::List attachments = incidence->attachments();
2491
2496
  if ( !attachments.isEmpty() ) {
2492
2497
    tmpStr += i18n( "Attached Documents:" ) + "<ol>";
2969
2974
 
2970
2975
  Incidence::Ptr inc = incBase.staticCast<Incidence>();  // the incidence in the invitation email
2971
2976
 
 
2977
  // If the IncidenceBase is a FreeBusy, then we cannot access the revision number in
 
2978
  // the static-casted Incidence; so for sake of nothing better use 0 as the revision.
 
2979
  int incRevision = 0;
 
2980
  if ( inc && inc->type() != Incidence::TypeFreeBusy ) {
 
2981
    incRevision = inc->revision();
 
2982
  }
 
2983
 
2972
2984
  // First make the text of the message
2973
2985
  QString html;
2974
2986
  html += "<div align=\"center\" style=\"border:solid 1px;\">";
2988
3000
    if ( msg->method() == iTIPRequest || msg->method() == iTIPReply ||
2989
3001
         msg->method() == iTIPDeclineCounter ) {
2990
3002
      if ( inc && existingIncidence &&
2991
 
           inc->revision() < existingIncidence->revision() ) {
 
3003
           incRevision < existingIncidence->revision() ) {
2992
3004
        bodyOk = bodyVisitor.act( existingIncidence, inc, msg, sender );
2993
3005
      } else {
2994
3006
        bodyOk = bodyVisitor.act( inc, existingIncidence, msg, sender );
3047
3059
  Attendee::Ptr ea;
3048
3060
  if ( !myInc ) {
3049
3061
    Incidence::Ptr rsvpIncidence = existingIncidence;
3050
 
    if ( !rsvpIncidence && inc && inc->revision() > 0 ) {
 
3062
    if ( !rsvpIncidence && inc && incRevision > 0 ) {
3051
3063
      rsvpIncidence = inc;
3052
3064
    }
3053
3065
    if ( rsvpIncidence ) {
3081
3093
    html += "<br/>";
3082
3094
    html += "<i><u>";
3083
3095
    if ( rsvpRec && inc ) {
3084
 
      if ( inc->revision() == 0 ) {
 
3096
      if ( incRevision == 0 ) {
3085
3097
        html += i18n( "Your <b>%1</b> response has been recorded",
3086
3098
                      Stringify::attendeeStatus( ea->status() ) );
3087
3099
      } else {
3108
3120
 
3109
3121
  // Print if the organizer gave you a preset status
3110
3122
  if ( !myInc ) {
3111
 
    if ( inc && inc->revision() == 0 ) {
 
3123
    if ( inc && incRevision == 0 ) {
3112
3124
      QString statStr = myStatusStr( inc );
3113
3125
      if ( !statStr.isEmpty() ) {
3114
3126
        html += "<br/>";
3130
3142
    case iTIPRefresh:
3131
3143
    case iTIPAdd:
3132
3144
    {
3133
 
      if ( inc && inc->revision() > 0 && ( existingIncidence || !helper->calendar() ) ) {
 
3145
      if ( inc && incRevision > 0 && ( existingIncidence || !helper->calendar() ) ) {
3134
3146
        if ( inc->type() == Incidence::TypeTodo ) {
3135
3147
          html += helper->makeLink( "reply", i18n( "[Record invitation in my to-do list]" ) );
3136
3148
        } else {