equal
deleted
inserted
replaced
491 { |
491 { |
492 HbAction* action = qobject_cast<HbAction*>(sender()); |
492 HbAction* action = qobject_cast<HbAction*>(sender()); |
493 |
493 |
494 if(action) |
494 if(action) |
495 { |
495 { |
|
496 //service stuff. |
|
497 QString service("phonebookservices"); |
|
498 QString interface; |
|
499 QString operation; |
496 QList<QVariant> args; |
500 QList<QVariant> args; |
497 QString operation; |
|
498 |
501 |
499 QString data = action->data().toString(); |
502 QString data = action->data().toString(); |
500 |
503 |
501 if(data.contains(QRegExp("^"+NUMBER_RULE))) |
504 if(data.contains(QRegExp("^"+NUMBER_RULE))) |
502 { |
505 { |
508 QContactPhoneNumber::FieldNumber); |
511 QContactPhoneNumber::FieldNumber); |
509 |
512 |
510 if(contactId > 0) |
513 if(contactId > 0) |
511 { |
514 { |
512 //open contact card |
515 //open contact card |
513 operation = QString("open(int)"); |
516 interface = QString("com.nokia.symbian.IContactsView"); |
|
517 operation = QString("openContactCard(int)"); |
514 args << contactId; |
518 args << contactId; |
515 } |
519 } |
516 else |
520 else |
517 { |
521 { |
518 //save to contacts with phone number field prefilled. |
522 //save to contacts with phone number field prefilled. |
519 |
523 interface = QString("com.nokia.symbian.IContactsEdit"); |
520 operation = QString("editCreateNew(QString,QString)"); |
524 operation = QString("editCreateNew(QString,QString)"); |
521 QString type = QContactPhoneNumber::DefinitionName; |
525 QString type = QContactPhoneNumber::DefinitionName; |
522 |
|
523 args << type; |
526 args << type; |
524 args << data; |
527 args << data; |
525 } |
528 } |
526 } |
529 } |
527 else if(data.contains(QRegExp("^"+EMAIL_RULE))) |
530 else if(data.contains(QRegExp("^"+EMAIL_RULE))) |
534 QContactEmailAddress::FieldEmailAddress); |
537 QContactEmailAddress::FieldEmailAddress); |
535 |
538 |
536 if(contactId > 0) |
539 if(contactId > 0) |
537 { |
540 { |
538 //open contact card |
541 //open contact card |
539 operation = QString("open(int)"); |
542 interface = QString("com.nokia.symbian.IContactsView"); |
|
543 operation = QString("openContactCard(int)"); |
540 args << contactId; |
544 args << contactId; |
541 } |
545 } |
542 else |
546 else |
543 { |
547 { |
544 //save to contacts with e-mail field prefilled. |
548 //save to contacts with e-mail field prefilled. |
545 |
549 interface = QString("com.nokia.symbian.IContactsEdit"); |
546 operation = QString("editCreateNew(QString,QString)"); |
550 operation = QString("editCreateNew(QString,QString)"); |
547 |
|
548 QString type = QContactEmailAddress::DefinitionName; |
551 QString type = QContactEmailAddress::DefinitionName; |
549 |
|
550 args << type; |
552 args << type; |
551 args << data; |
553 args << data; |
552 } |
554 } |
553 } |
555 } |
554 |
|
555 //service stuff. |
|
556 QString serviceName("com.nokia.services.phonebookservices"); |
|
557 |
|
558 XQAiwRequest* request; |
556 XQAiwRequest* request; |
559 XQApplicationManager appManager; |
557 XQApplicationManager appManager; |
560 request = appManager.create(serviceName, "Fetch", operation, true); // embedded |
558 request = appManager.create(service, interface, operation, true); // embedded |
561 if ( request == NULL ) |
559 if ( request == NULL ) |
562 { |
560 { |
563 return; |
561 return; |
564 } |
562 } |
565 |
563 |