View Single Post
marxian's Avatar
Posts: 2,448 | Thanked: 9,523 times | Joined on Aug 2010 @ Wigan, UK
#2
Originally Posted by nauman.altaf View Post
1- How clicking the feed will open that feed description in my own application.
There are two ways to enable opening of a feed item in your application:
  1. Pass the URI as an argument in the Exec command specified in the .desktop file, e.g Exec=/path/to/my/binary %U.
  2. Add a DBus service (e.g. com.me.MyApplication) for your application that includes a method for displaying the feed item (e.g. showFeedItem). The method should have DBus method signature "as" (an array of strings, or in Qt terms, QStringList).

The DBus method is better because, as far as I'm aware, passing the URI as an argument to the Exec command only works when there is not an instance of your application already running (unless you allow multiple instances, which is undesirable in most cases). The DBus method allows you to raise an existing instance of your application.

Additionally, using DBus means that you do not necessarily need to add a URI handler, because the event feed itself has a DBus method to add events to it, which allows you to specify a DBus call as the action (whereas MEventFeed uses libcontentaction, which in turn requires you to add the URI handler). Of course, it may well be useful to add the URI handler anyway, for other purposes.

Originally Posted by nauman.altaf View Post
2- Does meventfeed passes complete url of the feed to uri handler application when it is clicked.
Yes, as far I know, though I prefer the DBus method over MEventFeed.

Originally Posted by nauman.altaf View Post
3- How to load GUI when clicking the feed
If you add a DBus service, your DBus method will be called with the URL as the argument. You then need to handle this inside your application to display whatever data you wish. Same applies if you receive the argument via the Exec command.

I recommend adding a DBus service regardless of whether or not you use MEventFeed to add the items, otherwise you will face the problem of not being able to pass an argument to an existing instance of your application.

There is some nice information about using DBus in a Qt application at http://www.developer.nokia.com/Commu...quick_tutorial
__________________
'Men of high position are allowed, by a special act of grace, to accomodate their reasoning to the answer they need. Logic is only required in those of lesser rank.' - J K Galbraith

My website

GitHub

Last edited by marxian; 2013-01-30 at 13:05.
 

The Following 6 Users Say Thank You to marxian For This Useful Post: