QtContacts: "database" property specifies address book
The value is a QtContacts URI for an address book, composed of qtcontacts:<backend>:<URL encoded parameters> Example values for "database": qtcontacts:tracker: qtcontacts:eds:source=local:/system
This commit is contained in:
parent
40dd80d25f
commit
377112b99d
2 changed files with 16 additions and 2 deletions
|
@ -25,6 +25,7 @@
|
|||
#include "QtContactsSource.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
|
||||
#include <QContact>
|
||||
#include <QContactManager>
|
||||
|
@ -386,7 +387,12 @@ QtContactsSource::~QtContactsSource()
|
|||
|
||||
void QtContactsSource::open()
|
||||
{
|
||||
m_data = new QtContactsData(this, NULL);
|
||||
QString buffer;
|
||||
QDebug(&buffer) << "available managers (default one first): " << QContactManager::availableManagers();
|
||||
SE_LOG_DEBUG(NULL, NULL, buffer.toUtf8().data());
|
||||
|
||||
string id = getDatabaseID();
|
||||
m_data = new QtContactsData(this, id.c_str());
|
||||
cxxptr<QContactManager> manager(QContactManager::fromUri(m_data->m_managerURI),
|
||||
"QTContactManager");
|
||||
if (manager->error()) {
|
||||
|
@ -394,6 +400,11 @@ void QtContactsSource::open()
|
|||
m_data->m_managerURI.toLocal8Bit().constData(),
|
||||
manager->error()));
|
||||
}
|
||||
buffer = "";
|
||||
QDebug(&buffer) << manager->managerUri() << " manager supports contact types: " << manager->supportedContactTypes() <<
|
||||
" and data types: " << manager->supportedDataTypes();
|
||||
SE_LOG_DEBUG(NULL, NULL, buffer.toUtf8().data());
|
||||
|
||||
m_data->m_manager = manager;
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,10 @@ static RegisterSyncSource registerMe("QtContacts",
|
|||
#endif
|
||||
createSource,
|
||||
"QtContacts = addressbook = contacts = qt-contacts\n"
|
||||
" vCard 3.0 = text/vcard\n",
|
||||
" vCard 3.0 = text/vcard\n"
|
||||
" 'database' is specified via a QtContacts URI, which\n"
|
||||
" consists of qtcontacts:<backend>:<URL encoded parameters>.\n"
|
||||
" Examples: 'qtcontacts:tracker:' or 'qtcontacts:eds:source=local:/system'\n",
|
||||
Values() +
|
||||
(Aliases("QtContacts") + "qt-contacts"));
|
||||
|
||||
|
|
Loading…
Reference in a new issue