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

Timur Kristóf timur.kristof at gmail.com
Mon Jan 6 11:58:56 UTC 2014


Possibly because when you launch it from the SDK it runs either as a
different user, or just isn't part of the session on the phone, ie. not all
the environment variables are set, etc.


Timur



On Mon, Jan 6, 2014 at 1:23 AM, Karsten Todtermuschke <katomu at web.de> wrote:

> 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.prowhere
>
> 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
>
> _______________________________________________
> SailfishOS.org Devel mailing list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20140106/ba926467/attachment.html>


More information about the Devel mailing list