xdg-settings and xdg-mime query fail with status 4 in kde 5

Bug #1620772 reported by Vikash
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
xdg-utils (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Description: Ubuntu 16.04.1 LTS
Release: 16.04

xdg-utils:
  Installed: 1.1.1-1ubuntu1

I ran into the chrome default browser bug after updating : https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1509139

I tried the fix there and found it was not working.

So to debug the issue i tried

xdg-settings get default-web-browser

expected: google-chrome.desktop

result: no output to stdio, it fails with status code 4

I also tried

xdg-mime query default text/html

expected: google-chrome.desktop

result: no output to stdio, it fails with status code 4

Further Info.:
Both of these commands show correct output if executed as sudo

Revision history for this message
Vikash (master-bvik) wrote :

I debugged xdg-mime and found the error is generated in the line 1005 in function defapp_kde()

trader_result=`$KTRADER $MIMETYPE "$MIME" $SERVICETYPE Application 2>/dev/null \
            | grep DesktopEntryPath | head -n 1 | cut -d ':' -f 2 | cut -d \' -f 2`

trader_result gets value empty string because grep DesktopEntryPath returns empty string, i have no idea what it is supposed to be either

The actual output of $KTRADER $MIMETYPE "$MIME" $SERVICETYPE Application 2>/dev/null is:

mimetype is : text/html
servicetype is : Application
got 9 offers.
/usr/share/applications/google-chrome.desktop
/usr/share/applications/firefox.desktop
/usr/share/applications/rstudio.desktop
/usr/share/applications/org.kde.kate.desktop
/usr/share/applications/libreoffice-writer.desktop
/usr/share/applications/kde4/okularApplication_txt.desktop
/usr/share/applications/emacs24.desktop
/usr/share/applications/vim.desktop
/usr/share/applications/emacs24-term.desktop

Which means grep DesktopEntryPath doesn't do anything and it is not an environment variable either it is not being set anywhere in the xdg-mime script.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xdg-utils (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.