Skip to content

Instantly share code, notes, and snippets.

@juergbi
Created October 6, 2012 13:02
Show Gist options
  • Save juergbi/3844886 to your computer and use it in GitHub Desktop.
Save juergbi/3844886 to your computer and use it in GitHub Desktop.
--- src/client/contacts.py 2012-10-06 14:32:00.148779992 +0200
+++ - 2012-10-06 14:56:20.841356974 +0200
@@ -361,7 +361,7 @@
numbers = contact.details(QContactPhoneNumber.DefinitionName);
for number in numbers:
- self.contacts.append({"alphabet":label[0].upper(),"name":label,"number":QContactPhoneNumber(number).number(),"picture":avatar});
+ self.contacts.append({"alphabet":label[0].upper(),"name":label,"number":QContactPhoneNumber(number).number().replace(" ","").replace("(","").replace(")",""),"picture":avatar});
return self.contacts;
@@ -377,7 +377,7 @@
allnumbers = []
for number in numbers:
- allnumbers.append(QContactPhoneNumber(number).number())
+ allnumbers.append(QContactPhoneNumber(number).number().replace(" ","").replace("(","").replace(")",""))
self.contacts.append({"name":label,"numbers":allnumbers,"picture":avatar});
@TimmW123
Copy link

TimmW123 commented Jan 8, 2013

Hi,

sorry for bothering but I stumbled over this when finding that the new version (0.9.16) of WazApp did not import my contatcs anymore correctly - with 0.2.x it did though. So I was just wondering what this code is doing and understood that this is ripping all brackets and spaces from phone numbers - but is it doing this when WazApp syncs the contacts and parses the address books numbers or is this altering your phone's address book ? Might be a stupid question but I am not an expert...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment