We have moved to a new Sailfish OS Forum. Please start new discussions there.
12

[3.0.2.8] xdg-open *.desktop don't open application anymore [answered]

asked 2019-03-19 09:01:12 +0300

Karry gravatar image

updated 2019-03-20 11:53:07 +0300

jovirkku gravatar image

Hi.

I am using systemd for opening few application after phone startup. I do this task with xdg-open tool:

xdg-open /usr/share/applications/jolla-email.desktop It worked fine, this command opened application defined in desktop file. But after 3.0.2 upgrade, this command opens tIDEditor with desktop file content. So I tried to un-install tIDEditor, but now, desktop file is opened in Sailfish Browser ;-)

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by jiit
close date 2019-03-25 14:02:32.534891

Comments

3 Answers

Sort by » oldest newest most voted
9

answered 2019-03-19 14:33:25 +0300

Pekka Vuorela gravatar image

updated 2019-03-20 10:40:46 +0300

jovirkku gravatar image

This was changed on purpose. xdg-open and the like tell they open a file in user's preferred application and actually launching the file can be surprising, but also dangerous. Also for comparison the Linux desktop here opens the file in a text editor.

If you want to specifically launch the app, you could perhaps use
lca-tool --triggerdesktop jolla-email.desktop

edit flag offensive delete publish link more

Comments

Nice, thanks. 'lca-tool' - I've not heard of this before, great!, another 'toy' to play with! ;)

Spam Hunter ( 2019-03-19 17:18:26 +0300 )edit
3

This also affects Qt.openUrlExternally. I assume that too is intentional? Any suggestions on a future-proof way of invoking apps from qml, or is this "dirty" behaviour?

attah ( 2019-03-19 19:34:46 +0300 )edit

@attah - I have 2 apps I made that have Qt.openUrlExternally function within, but I see no problems with either app.

Spam Hunter ( 2019-03-19 19:51:29 +0300 )edit

For .desktop files?

attah ( 2019-03-19 23:41:07 +0300 )edit
1

Yes, applies also to openUrlExternally(). Docs "Attempts to open the specified target url in an external application, based on the user's desktop preferences", opening a .desktop file with application vs launching it.

Pekka Vuorela ( 2019-03-20 11:32:53 +0300 )edit
2

answered 2019-03-24 19:25:56 +0300

tortoisedoc gravatar image

updated 2019-03-25 11:32:59 +0300

@Pekka Vuorela it appears libcontentaction is not whitelisted in Harbour tho. Are there plans to whitelist it, or do we rely on the lca-tool directly?

edit flag offensive delete publish link more

Comments

No plans at the moment. What kind of need would you have for that? Attah mentioned under another answer there about bringing application to front when there's d-bus triggered action, but on the case the application can do it itself.

Pekka Vuorela ( 2019-03-25 11:46:29 +0300 )edit

Via D-bus? Is there such API? I'd rather use libcontentaction for that; guess i have to bundle it :/ But the basic need is for quickbar to launch apps. @Pekka Vuorela

tortoisedoc ( 2019-03-25 13:21:56 +0300 )edit
0

answered 2019-03-19 23:26:36 +0300

tortoisedoc gravatar image

updated 2019-03-25 11:32:38 +0300

I can up this problem. On C++ side, QDesktopServices::openUrl does NOT open correctly desktop files. From the logs, lipstick cannot make sense of the url-formatted file entry (you get an error like Desktop file does not exist : file:///usr/share/applications/mydesktop.desktop

On the other hand, lca-tool does the job, which means libcontentaction finally works again \O/

I am a bit puzzled about the correlation between linux desktop and mobile. Isn't it all mime-types dependent @Pekka Vuorela ?

edit flag offensive delete publish link more

Comments

I am a bit puzzled about the correlation between linux desktop and mobile. Isn't it all mime-types dependent

It's kind of mime type handling, but just saying as comparison it's been somewhat unexpected that the launching has ever worked. While digging the source, recall initial commit for adding it to contentaction was a bigger bunch of changes, not necessarily a concious decision.

Pekka Vuorela ( 2019-03-20 11:35:05 +0300 )edit

Thing is, if QDesktopServices::openUrl boils down to xdg-open, and xdg-open relies on lca-tool; how comes issuing QDesktopServices::openUrl("/usr/share/application/desktopfile.desktop") doesnt work ? lca-tool works just fine (as well as libcontentaction). That leaves the problem to be either between xdg-open and Qt, or on the lipstick side. But nothing has changed in xdg-utils in a while afaik. In fact, in the log lipstick complains about the non-existing .desktop file.

tortoisedoc ( 2019-03-20 14:04:36 +0300 )edit

It's all still there, but contentaction/lca-tool has different actions to perform. If it's asked to launch a .desktop file it will do that. If it's asked to open a file in an application it will do that, but it does not include executing the given file.

Pekka Vuorela ( 2019-03-20 14:07:08 +0300 )edit

Indeed it is; but what made it (as in QDesktopServices::openUrl) break?

tortoisedoc ( 2019-03-20 14:44:20 +0300 )edit
2

Question tools

Follow
5 followers

Stats

Asked: 2019-03-19 09:01:12 +0300

Seen: 682 times

Last updated: Mar 25 '19