~ubuntu-branches/ubuntu/vivid/kdepim/vivid

« back to all changes in this revision

Viewing changes to kaddressbook/grantleecontactformatter.cpp

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman, Jonathan Riddell, Rohan Garg, Scott Kitterman
  • Date: 2012-11-21 13:12:36 UTC
  • mfrom: (0.2.33)
  • Revision ID: package-import@ubuntu.com-20121121131236-32ijw9a2txrar80k
Tags: 4:4.9.80-0ubuntu1
[ Jonathan Riddell ]
* New upstream beta release

[ Rohan Garg ]
* Add nepomuk-core-dev to build-deps

[ Scott Kitterman ]
* Add new package, libpimcommon4
  - Add libpimcommon4.install
  - Add to debian/control, including kdepim-dbg and kdepim-dev depends
  - Add to kdepim-dev.install
* Remove usr/bin/backupmail and related files from kmail.install as they are
  not provided by upstream anymore
* Add usr/bin/pimsettingexporter and related files to kmail.install
* Add libnepomukwidgets-dev to build-depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
206
206
  if ( birthday.isValid() ) {
207
207
    contactObject.insert( QLatin1String( "birthday" ), KGlobal::locale()->formatDate( birthday ) );
208
208
 
 
209
    contactObject.insert( QLatin1String("birthdayi18n"), i18n("Birthday"));
209
210
    const int years = contactAge( birthday );
210
211
    contactObject.insert( QLatin1String( "age" ), QString::number( years ) );
211
212
  }
216
217
  if ( anniversary.isValid() ) {
217
218
    contactObject.insert( QLatin1String( "anniversary" ),
218
219
                          KGlobal::locale()->formatDate( anniversary ) );
 
220
    contactObject.insert( QLatin1String("anniversaryi18n"), i18n("Anniversary"));
219
221
  }
220
222
 
221
223
  // Emails
222
224
  QStringList emails;
223
225
  foreach ( const QString &email, rawContact.emails() ) {
224
 
    QString type = i18nc( "a contact's email address", "Email" );
225
 
 
226
226
    const QString fullEmail = QString::fromLatin1( KUrl::toPercentEncoding( rawContact.fullEmail( email ) ) );
227
227
 
228
228
    const QString url = QString::fromLatin1( "<a href=\"mailto:%1\">%2</a>" )
229
229
      .arg( fullEmail, email );
230
230
    emails<<url;
231
231
  }
 
232
  contactObject.insert( QLatin1String("emailsi18n"), i18n("Emails"));
232
233
  contactObject.insert( QLatin1String( "emails" ), emails);
233
234
 
234
235
  // Phone numbers
251
252
 
252
253
    url = KStringHandler::tagUrls( url );
253
254
    contactObject.insert( QLatin1String( "website" ), url );
 
255
    contactObject.insert( QLatin1String( "websitei18n" ), i18n("Website") );
254
256
  }
255
257
 
256
258
  // Blog Feed
258
260
    rawContact.custom( QLatin1String( "KADDRESSBOOK" ), QLatin1String( "BlogFeed" ) );
259
261
  if ( !blog.isEmpty() ) {
260
262
    contactObject.insert( QLatin1String( "blogUrl" ), KStringHandler::tagUrls( blog ) );
 
263
    contactObject.insert( QLatin1String( "blogUrli18n" ), i18n("Blog Feed") );
261
264
  }
262
265
 
263
266
  // Address Book
265
268
    rawContact.custom( QLatin1String( "KADDRESSBOOK" ), QLatin1String( "AddressBook" ) );
266
269
  if ( !addressBookName.isEmpty() ) {
267
270
    contactObject.insert( QLatin1String( "addressBookName" ), addressBookName );
 
271
    contactObject.insert( QLatin1String("addressBookNamei18n"), i18n("Address Book"));
268
272
  }
269
273
 
270
274
  // Addresses
278
282
  if ( !rawContact.note().isEmpty() ) {
279
283
    const QString notes = rawContact.note().replace( QLatin1Char( '\n' ), QLatin1String( "<br>" ));
280
284
    contactObject.insert( QLatin1String( "note" ), notes );
 
285
    contactObject.insert( QLatin1String("notei18n"),i18n("Note"));
281
286
  }
282
287
 
283
288
  contactObject.insert( QLatin1String( "addresses" ), addresses );
291
296
  setHashField( contactObject, QLatin1String( "organization" ), rawContact.organization() );
292
297
 
293
298
  setHashField( contactObject, QLatin1String( "department" ), rawContact.department() );
 
299
  contactObject.insert(QLatin1String("departmenti18n"),i18n("Department"));
294
300
 
295
301
  setHashField( contactObject, QLatin1String( "note" ), rawContact.note() );
296
302
 
297
303
  setHashField( contactObject, QLatin1String( "profession" ),
298
304
                rawContact.custom( QLatin1String( "KADDRESSBOOK" ),
299
305
                                   QLatin1String( "X-Profession" ) ) );
300
 
 
 
306
  contactObject.insert(QLatin1String("Professioni18n"),i18n("Profession"));
301
307
  setHashField( contactObject, QLatin1String( "office" ),
302
308
                rawContact.custom( QLatin1String( "KADDRESSBOOK" ),
303
309
                                   QLatin1String( "X-Office" ) ) );
 
310
  contactObject.insert(QLatin1String("officei18n"),i18n("Office"));
304
311
 
305
312
  setHashField( contactObject, QLatin1String( "manager" ),
306
313
                rawContact.custom( QLatin1String( "KADDRESSBOOK" ),
307
314
                                   QLatin1String( "X-ManagersName" ) ) );
 
315
  contactObject.insert(QLatin1String("manageri18n"),i18n("Manager's Name"));
308
316
 
309
317
  setHashField( contactObject, QLatin1String( "assistant" ),
310
318
                rawContact.custom( QLatin1String( "KADDRESSBOOK" ),
311
319
                                   QLatin1String( "X-AssistantsName" ) ) );
 
320
  contactObject.insert(QLatin1String("assistanti18n"),i18n("Assistant's Name"));
312
321
 
313
322
  setHashField( contactObject, QLatin1String( "spouse" ),
314
323
                rawContact.custom( QLatin1String( "KADDRESSBOOK" ),
315
324
                                   QLatin1String( "X-SpousesName" ) ) );
 
325
  contactObject.insert(QLatin1String("spousei18n"),i18n("Partner's Name"));
316
326
 
317
327
  setHashField( contactObject, QLatin1String( "imAddress" ),
318
328
                rawContact.custom( QLatin1String( "KADDRESSBOOK" ),
319
329
                                   QLatin1String( "X-IMAddress" ) ) );
 
330
  contactObject.insert(QLatin1String("imAddressi18n"), i18n("IM Address"));
320
331
 
321
332
  // Custom fields
322
333