×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    16

    Deleting the contact database

    Hello to all,

    recently I started to code a python program to import vcards into the phonebook. This worked out very nice, and it's a very simple way for me to get my address data from Linux on my phone. During this I stumbled upon this:

    If I delete my phonebook with the following code, the phonebook "seems" to get empty (f.ex. there are no contacts anymore to dial/send a sms to), but the database file in c:\system\data\contacts.cdb grows and grows instead of becoming smaller. After several runs this file grew to 1.6MB and almost killed my phone...
    I hope anyone spots the error in this code so my program becomes usable:

    import contacts

    db = contacts.open()
    allkeys = db.keys()
    for i in allkeys:
    del db[i]
    db.close()

    If I use the symbian phonebook instead of my code and delete the addresses, the file gets small again (f.ex. from 1.6MB to 35KB while deleting 50 contacts).

    Thanks for your help, it's very much appreciated,

    Joost

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    3

    Re: Deleting the contact database

    Originally posted by sx1freak
    Hello to all,

    recently I started to code a python program to import vcards into the phonebook. This worked out very nice, and it's a very simple way for me to get my address data from Linux on my phone. During this I stumbled upon this:

    If I delete my phonebook with the following code, the phonebook "seems" to get empty (f.ex. there are no contacts anymore to dial/send a sms to), but the database file in c:\system\data\contacts.cdb grows and grows instead of becoming smaller. After several runs this file grew to 1.6MB and almost killed my phone...
    I hope anyone spots the error in this code so my program becomes usable:

    import contacts

    db = contacts.open()
    allkeys = db.keys()
    for i in allkeys:
    del db[i]
    db.close()

    If I use the symbian phonebook instead of my code and delete the addresses, the file gets small again (f.ex. from 1.6MB to 35KB while deleting 50 contacts).

    Thanks for your help, it's very much appreciated,

    Joost



    -thank you for your note! in the next release the contacts extension will have compact() and compact_required() - methods which should solve this problem.

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    16
    Hi,

    thanks a lot! Of course I thought I had overlooked something, but I'm even more glad I could help! Thanks for python on s60,

    Joost

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×