maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Start Default Application (QT4) (https://talk.maemo.org/showthread.php?t=44816)

oprocopio 2010-02-17 08:05

Start Default Application (QT4)
 
Hi there,

Is there a way to start the default application depending of the Mime-Type?

I would like to import a Vcard but with QDesktopService::openUrl(file.vcf) the browser and not the addressbook starts up.

if I open the file with the filemanager then it starts correctly the addrebook.

Can I maybe use DBUS?

Thanks for any help

Orlando

oprocopio 2010-02-17 11:09

Re: Start Default Application (QT4)
 
I have found the solution with DBus

from terminal execute:

dbus-send --print-reply --type=method_call --dest=com.nokia.osso_addressbook /com/nokia/osso_addressbook com.nokia.osso_addressbook.mime_open string:'filename.vcf'

with QT:

QDBusInterface *ABook = new QDBusInterface("com.nokia.osso_addressbook", "/com/nokia/osso_addressbook", "com.nokia.osso_addressbook", dbus);

ABook->call("mime_open", file.fileName());


thanks

orlando


All times are GMT. The time now is 01:49.

vBulletin® Version 3.8.8