Hello Suparno!

Did you have a look at QSparql? It'll give you access to Tracker in a
much more Qt-ish way. In any case, you can have a look at the examples
for either library, that might help you get started:
libtracker-sparql (not so simple one):
http://git.gnome.org/browse/tracker/tree/examples/libtracker-sparql/async-connection.c
qsparql:
https://maemo.gitorious.org/maemo-af/qsparql/blobs/master/examples/sparql/simple/main.cpp

In your case, not sure why tracker_sparql_connection_get would fail...
What platform are you developing on? Are there special restrictions to
the DB access?

Cheers

Adrien

Le Fri, 5 Aug 2011 10:05:28 +0530,
<[email protected]> a écrit :

> Hi Martyn,
> 
>                 Here is  what am doing inside my application :
> 
>  
> 
>   g_type_init();
> 
>   GError *error = NULL;
> 
>   m_connection = tracker_sparql_connection_get_direct(&error);
> 
>   qDebug() << error->message;
> 
>   if(m_connection != NULL)
> 
>   {
> 
>     gchar *query;
> 
>     query = g_strdup_printf ("SELECT ?url WHERE { ?song a
> nmm:MusicPiece ; nie:isStoredAs ?as . ?as nie:url ?url . }");
> 
>     if(0 != query)
> 
>         m_cursor = tracker_sparql_connection_query (m_connection,
> query, NULL, &error);
> 
>     else
> 
>         printf("Query is null \n");
> 
>  
> 
>     if(0 != error)
> 
>     {
> 
>         g_print("Error Message %s\n", error->message);
> 
>         //qDebug() << error->message;
> 
>         g_free (query);
> 
>     }
> 
>     else
> 
>         printf("No error returned from the SPARQL\n");
> 
>  
> 
>     if(0 != m_cursor)
> 
>         print_cursor (m_cursor, "No classes were found to match search
> term", "Classes", TRUE, l_list);
> 
>     else
> 
>         printf("cursor is NULL \n");
> 
>   }
> 
>   else
> 
>   {
> 
>     qDebug() << "connection not establisheds";
> 
>   }
> 
>  
> 
> -----Original Message-----
> From: Martyn Russell [mailto:[email protected]] 
> Sent: Thursday, August 04, 2011 6:53 PM
> To: Suparno Bose (WT01 - Manufacturing & Hi Tech)
> Cc: [email protected]
> Subject: Re: [Tracker] Tracker-WARNING **: file is encrypted or is
> not a database
> 
>  
> 
> On 04/08/11 13:31, [email protected]
> <mailto:[email protected]>  wrote:
> 
> > Attaching the file
> 
>  
> 
> Thanks,
> 
>  
> 
> > -----Original Message-----
> 
> > From: Suparno Bose (WT01 - Manufacturing&  Hi Tech)
> 
> > Sent: Thursday, August 04, 2011 6:00 PM
> 
> > To: 'Martyn Russell'
> 
> > Cc: [email protected]
> 
> > Subject: RE: [Tracker] Tracker-WARNING **: file is encrypted or is
> > not
> 
> 
> > a database
> 
> > 
> 
> > Sorry Martyn ,
> 
> >             I did some mistake. Please find my new log attached.
> 
> > This time it worked fine from the command line but not from the 
> 
> > application .
> 
>  
> 
> I see, so how are you doing it form the application then? The command
> line tools are there to help you sanity check what you're application
> might be doing.
> 
>  
> 
> --
> 
> Regards,
> 
> Martyn
> 
>  
> 
> Founder and CEO of Lanedo GmbH.
> 

_______________________________________________
tracker-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/tracker-list

Reply via email to