~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to kde/src/klib/helperfunctions.cpp

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (1.1.11)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: package-import@ubuntu.com-20140128182336-3xenud1kbnwmf3mz
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/****************************************************************************
2
 
 *   Copyright (C) 2009-2013 by Savoir-Faire Linux                          *
 
2
 *   Copyright (C) 2009-2014 by Savoir-Faire Linux                          *
3
3
 *   Author : Jérémy Quentin <jeremy.quentin@savoirfairelinux.com>          *
4
4
 *            Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
5
5
 *                                                                          *
30
30
 
31
31
//SFLPhone
32
32
#include "../lib/contact.h"
33
 
 
34
 
///Transform a contact list to a [QString][QString][QVariant] hash
35
 
ContactHash HelperFunctions::toHash(QList<Contact*> contacts) {
36
 
   QHash<QString,QHash<QString,QVariant> > hash;
37
 
   for (int i=0;i<contacts.size();i++) {
38
 
      Contact* cont = contacts[i];
39
 
      QHash<QString,QVariant> conth = cont->toHash();
40
 
      conth   ["phoneCount" ] = cont->getPhoneNumbers().size();
41
 
      if (cont->getPhoneNumbers().size() == 1) {
42
 
         conth["phoneNumber"] = cont->getPhoneNumbers()[0]->getNumber();
43
 
         conth["phoneType"  ] = cont->getPhoneNumbers()[0]->getType();
44
 
      }
45
 
      else {
46
 
         conth["phoneNumber"] = i18np("%1 number","%1 numbers",cont->getPhoneNumbers().size());
47
 
         conth["phoneType"  ].clear();
48
 
      }
49
 
      hash[contacts[i]->getUid()] = conth;
50
 
   }
51
 
   return hash;
52
 
}
 
33
#include "../lib/phonenumber.h"
 
34
#include "../lib/numbercategory.h"
53
35
 
54
36
///Remove accent and upper caps, try to stay ascii as much as possible
55
37
QString HelperFunctions::normStrippped(QString str)