maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Qt Mobility - How do I check if a QContact is GSM/SKYPE/GMAIL? (https://talk.maemo.org/showthread.php?t=56526)

eitama 2010-06-18 10:16

Qt Mobility - How do I check if a QContact is GSM/SKYPE/GMAIL?
 
Hi,

I am using a QContactManager to get ALL the contacts.
Now I want to write an "if" statement to check if the contact is of type skype/gsm/gmail/other, I can't seem to find anything in the Qt examples / documentation or google.

Anyone knows?

Thanks,
Eitam.

eitama 2010-06-18 12:34

Re: Qt Mobility - How do I check if a QContact is GSM/SKYPE/GMAIL?
 
I worked around the problem, it's not the most efficient, but it does the trick for me.

Code:

bool horizontalcall::doesPhoneNumberExist(QContact *i_Contact)
{
    bool foundPhoneNumber = false;
    QList<QContactDetail> details = i_Contact->details();
    for (int z=0;z < details.size(); z++)
    {
        QString temp = details.at(z).definitionName();
        if (temp == "PhoneNumber") {
            foundPhoneNumber = true;
        }
    }

    return foundPhoneNumber;
}



All times are GMT. The time now is 14:15.

vBulletin® Version 3.8.8