~ubuntu-branches/ubuntu/quantal/kdepimlibs/quantal-proposed

« back to all changes in this revision

Viewing changes to akonadi/conflicthandling/conflictresolvedialog.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-14 14:37:07 UTC
  • mto: This revision was merged to the branch mainline in revision 112.
  • Revision ID: package-import@ubuntu.com-20111214143707-m0qplh3hsd957ukv
Tags: upstream-4.7.90
ImportĀ upstreamĀ versionĀ 4.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
      switch ( mode ) {
72
72
        case NormalMode:
73
73
          mContent.append( QString::fromLatin1( "<tr><td align=\"right\"><b>%1:</b></td><td>%2</td><td></td><td>%3</td></tr>" )
74
 
                                              .arg( name )
75
 
                                              .arg( textToHTML( leftValue ) )
76
 
                                              .arg( textToHTML( rightValue ) ) );
 
74
                                              .arg( name,
 
75
                                                    textToHTML( leftValue ),
 
76
                                                    textToHTML( rightValue ) ) );
77
77
         break;
78
78
        case ConflictMode:
79
79
          mContent.append( QString::fromLatin1( "<tr><td align=\"right\"><b>%1:</b></td><td bgcolor=\"#ff8686\">%2</td><td></td><td bgcolor=\"#ff8686\">%3</td></tr>" )
80
 
                                              .arg( name )
81
 
                                              .arg( textToHTML( leftValue ) )
82
 
                                              .arg( textToHTML( rightValue ) ) );
 
80
                                              .arg( name,
 
81
                                                    textToHTML( leftValue ),
 
82
                                                    textToHTML( rightValue ) ) );
83
83
         break;
84
84
       case AdditionalLeftMode:
85
85
         mContent.append( QString::fromLatin1( "<tr><td align=\"right\"><b>%1:</b></td><td bgcolor=\"#9cff83\">%2</td><td></td><td></td></tr>" )
86
 
                                             .arg( name )
87
 
                                             .arg( textToHTML( leftValue ) ) );
 
86
                                             .arg( name,
 
87
                                                   textToHTML( leftValue ) ) );
88
88
         break;
89
89
       case AdditionalRightMode:
90
90
         mContent.append( QString::fromLatin1( "<tr><td align=\"right\"><b>%1:</b></td><td></td><td></td><td bgcolor=\"#9cff83\">%2</td></tr>" )
91
 
                                             .arg( name )
92
 
                                             .arg( textToHTML( rightValue ) ) );
 
91
                                             .arg( name,
 
92
                                                   textToHTML( rightValue ) ) );
93
93
         break;
94
94
      }
95
95
    }
156
156
  }
157
157
 
158
158
  if ( localAttributes != otherAttributes ) {
159
 
    foreach ( const QByteArray &localKey, localAttributes.keys() ) {
 
159
    foreach ( const QByteArray &localKey, localAttributes ) {
160
160
      if ( !otherAttributes.contains( localKey ) ) {
161
161
        reporter->addProperty( AbstractDifferencesReporter::AdditionalLeftMode, i18n( "Attribute: %1", QString::fromUtf8( localKey ) ),
162
162
                               QString::fromUtf8( localAttributes.value( localKey ) ),
172
172
      }
173
173
    }
174
174
 
175
 
    foreach ( const QByteArray &otherKey, otherAttributes.keys() ) {
 
175
    foreach ( const QByteArray &otherKey, otherAttributes ) {
176
176
      if ( !localAttributes.contains( otherKey ) ) {
177
177
        reporter->addProperty( AbstractDifferencesReporter::AdditionalRightMode, i18n( "Attribute: %1", QString::fromUtf8( otherKey ) ),
178
178
                               QString(),
193
193
  button( User2 )->setText( i18n( "Take right one" ) );
194
194
  button( User1 )->setText( i18n( "Keep both" ) );
195
195
 
196
 
  connect( this, SIGNAL( user1Clicked() ), SLOT( slotUseBothItemsChoosen() ) );
197
 
  connect( this, SIGNAL( user2Clicked() ), SLOT( slotUseOtherItemChoosen() ) );
198
 
  connect( this, SIGNAL( user3Clicked() ), SLOT( slotUseLocalItemChoosen() ) );
 
196
  connect( this, SIGNAL(user1Clicked()), SLOT(slotUseBothItemsChoosen()) );
 
197
  connect( this, SIGNAL(user2Clicked()), SLOT(slotUseOtherItemChoosen()) );
 
198
  connect( this, SIGNAL(user3Clicked()), SLOT(slotUseLocalItemChoosen()) );
199
199
 
200
200
  QWidget *mainWidget = new QWidget;
201
201
  QVBoxLayout *layout = new QVBoxLayout( mainWidget );
216
216
  mOtherItem = otherItem;
217
217
 
218
218
  HtmlDifferencesReporter reporter;
 
219
  compareItems( &reporter, localItem, otherItem );
219
220
 
220
221
  if ( mLocalItem.hasPayload() && mOtherItem.hasPayload() ) {
221
222
 
234
235
                          QString::fromUtf8( mOtherItem.payloadData() ) );
235
236
  }
236
237
 
237
 
  compareItems( &reporter, localItem, otherItem );
238
 
 
239
238
  mView->setHtml( reporter.toHtml() );
240
239
}
241
240