[SailfishDevel] Cannot access phone book on phone when starting app from QtCreator

Karsten Todtermuschke katomu at web.de
Mon Jan 6 00:23:45 UTC 2014


Hi Matze,

I observed the same issue.

I used QtContacts 5.0 in Qml and selected "org.nemomobile.contacts.sqlite" 
from the available managers for ContactModel.manager

In the output from the application started with QtCreator I read the error 
message: Unable to create contacts database directory 
/home/nemo/.local/share/system//privileged/Contacts/qtcontacts-sqlite

so there is a double-slash in the path. I already found at the source of 
qtcontacts-sqlite

in file:

https://github.com/nemomobile/qtcontacts-sqlite/blob/master/src/engine/contactsdatabase.cpp

and method:

QSqlDatabase ContactsDatabase::open(const QString &databaseName)

how the path is created:

    QString privilegedDataDir(QString("%1/%2/")
            .arg(QString::fromLatin1(QTCONTACTS_SQLITE_CENTRAL_DATA_DIR))
            .arg(QString::fromLatin1(QTCONTACTS_SQLITE_PRIVILEGED_DIR)));

I further found the defines in https://github.com/nemomobile/qtcontacts-sqlite/blob/master/src/engine/engine.pro where 

DEFINES += 
'QTCONTACTS_SQLITE_CENTRAL_DATA_DIR=\'\"/home/nemo/.local/share/system/\"\''

already includes the slash. So at this point I know why the double slash is in 
the path.

What I do not understand at all is: Why it works when I launch it at the 
phone?

Best regards,

Karsten


Am Sonntag 05 Januar 2014, 23:10:46 schrieb Matthias Barmeier:
>Hi,
>
>I am unable to access the phone book when running my app from QtCreator
>on the phone.
>Is this a security feature ?
>Is it possible to work with a fake contact DB ?
>
>Ciao
>     Matze
>_______________________________________________
>SailfishOS.org Devel mailing list



More information about the Devel mailing list