![]() |
Help Required regarding Qt
I am making an application that will push feeds to nokia N9/N950 home screen. I am stuck at a problem and require help. I am able to generate feeds but rest of the stuff is quite messy.
1- How clicking the feed will open that feed description in my own application. 2- Does meventfeed passes complete url of the feed to uri handler application when it is clicked. 3- How to load GUI when clicking the feed |
Re: Help Required regarding Qt
Quote:
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. Quote:
Quote:
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 |
Re: Help Required regarding Qt
Thanks alot marxian for quite a detailed reply... i have successfully registered DBus servie that is able to generate feeds.. One more thing! when clicking the feed item.
1- How parse url information from array of string provided through 'as' argument. I mean its array not a single string. Single string is easy to deal with but how the url information will be sorted in 'as' and how to fetch it in handler. |
Re: Help Required regarding Qt
Quote:
I should add that it is libcontentaction that requires the argument to be of type "as", otherwise the URI handler will not work with DBus. If you do not need the URI handler, you can use argument of type "s" and accept a single string. |
Re: Help Required regarding Qt
In my case, i am registering a method in dbus "refresh()". In this method i am using MEventFeed::instance()->addItem(). Buteo Syncfw plugin will call this dbus method at regular intervals to generate feeds. I have one more dbus method "showContent(Constant QString &uri)". My desktop file looks like this
[Desktop Entry] Type=Application Name=My Application MimeType=x-maemo-urischeme/foo X-Maemo-Service=com.mycompany.service X-Maemo-Method=com.mycompany.service.showContent NotShowIn=X-MeeGo; when i am clicking the feed item, it is not working i.e showContent is not called. Are these configuration correct? If no please guide me further |
Re: Help Required regarding Qt
Quote:
Code:
MimeType=x-maemo-urischeme/foo; If you are using MEventFeed::instance()->addItem(), then your DBus method showContent() should take a QStringList as it's sole argument, instead of a QString. Also, have you created the intreface/adapter files as explained in the wiki page that I linked to earlier? |
Re: Help Required regarding Qt
MEventFeed::instance()->addItem() is meventfeed method to generate event feed. What is corresponding DBus method to generate event feed?
i checked com.nokia.home.EventFeed service and it is listing these methods ~ # qdbus com.nokia.home.EventFeed /eventfeed method qlonglong com.nokia.home.EventFeed.addItem(QVariantMap parameters) method void com.nokia.home.EventFeed.addRefreshAction(QString action) signal void com.nokia.home.EventFeed.refreshRequested() method void com.nokia.home.EventFeed.removeItem(qlonglong id) method void com.nokia.home.EventFeed.removeItemsBySourceName(Q String sourceName) method void com.nokia.home.EventFeed.updateItem(qlonglong id, QVariantMap parameters) My DBus service is working Ok and yes i have used the wrapper generator through qdbusxml2cpp. In the below link http://harmattan-dev.nokia.com/docs/...-Bus_call.html its is stated to use below configurations MRemoteAction action("com.mycompany.example", "/path", "com.mycompany.example", "refresh"); QDBusInterface interface("com.nokia.home.EventFeed", "/eventfeed", "com.nokia.home.EventFeed", QDBusConnection::sessionBus()); interface.call(QDBus::NoBlock, "addRefreshAction", action.toString()); but at the end it is again using MEventFeed::instance()->addItem() in the refresh() method. that means MEventFeed::instance()->addItem() is the only way to generate feeds on home screen. |
Re: Help Required regarding Qt
Quote:
Code:
QDBusMessage message = QDBusMessage::createMethodCall( |
Re: Help Required regarding Qt
Thanks alot Marxian. It is now working for me. Sorry for late reply as i was not around for sometime. I have one new problem :P
when i click the feed item, it opens my application GUI but the particular feed data is not loaded. Its gets loaded only when i click the button that is meant to do the data loading task. However in Component.onCompleted() i am using the same data loading method as in button. 1) how can load GUI when dbus method com.myapplication.example() is called ? i know one way is to define DBus service but it is giving me the above mentioned problem. |
All times are GMT. The time now is 08:28. |
vBulletin® Version 3.8.8