! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
"open with" dialog displays nothing
Status:
RESOLVED: FIXED
Product:
Xarchiver
Component:
general

Comments

Description tuxce 2008-11-16 18:34:28 CET
Created attachment 1984 
correct path to applications .desktop files

hi, 
Window displayed by selecting "open with" does not list applications installed on system.

It's because xarchiver search in wrong desktop directories, there is a "/" missing in src/open-with-dlg.c at ligne 178.
Comment 1 Giuseppe Torelli 2008-11-16 18:55:46 CET
Created attachment 1985 
Double applications loaded with the patch.
Comment 2 Giuseppe Torelli 2008-11-16 18:56:07 CET
Created attachment 1986 
Applications listed correctly
Comment 3 Giuseppe Torelli 2008-11-16 18:57:12 CET
Please see the attachment. I can see applications in the "Open With" dialog on my Xubuntu 8.04. The .desktop files are loaded from /usr/share/applications. Which distro do you have?
Comment 4 tuxce 2008-11-16 19:47:14 CET
I use Archlinux, i just see that XDG_DATA_HOME is defined without trailing "/".

I couldn't find in freedesktop basedir specs, if the last "/" must be defined or not...

maybe, I should open a ticket on arch bugtracker.
Comment 5 Giuseppe Torelli 2008-11-17 07:53:09 CET
(In reply to comment #4)
> I use Archlinux, i just see that XDG_DATA_HOME is defined without trailing "/".

Can you please add this line:

g_print ("%s\n",filename);

AFTER line 178 and post the output here please?
Comment 6 tuxce 2008-11-17 12:50:40 CET
$ xarchiver file.tar.gz
/usr/shareapplications
/usr/local/shareapplications
/usr/share/gdm/applications

$ echo $XDG_DATA_DIRS 
/usr/share:/usr/local/share:/usr/share/gdm/
Comment 7 Giuseppe Torelli 2008-11-17 12:55:26 CET
(In reply to comment #6)
> $ xarchiver file.tar.gz
> /usr/shareapplications
> /usr/local/shareapplications
> /usr/share/gdm/applications
> 
> $ echo $XDG_DATA_DIRS 
> /usr/share:/usr/local/share:/usr/share/gdm/

Ok, it's a Xarchiver bug. Don't open any ticket on arch bugtracker.
Comment 8 tuxce 2008-11-17 13:05:17 CET
ok

(In reply to comment #1)
> Created an attachment (id=1985) [details]
> Double applications loaded with the patch.

I didn't see this comment, applications are loaded twice because of double definitions of "/usr/share", one with trailing "/" and other one without it.
Comment 9 Giuseppe Torelli 2008-11-18 12:35:22 CET
(In reply to comment #6)
> $ xarchiver file.tar.gz
> /usr/shareapplications
> /usr/local/shareapplications
> /usr/share/gdm/applications
> 
> $ echo $XDG_DATA_DIRS 
> /usr/share:/usr/local/share:/usr/share/gdm/

I think have to come back on my steps, here (Ubuntu 8.04 and Xubuntu 8.04) I have:

gt[xarchiver]$ echo $XDG_DATA_DIRS
/usr/local/share/:/usr/share/:/usr/share/gdm/
gt[xarchiver]$

As you can see /usr/share ends with a / so I think the problem lies on Archlinux. Please let me know if it occurs with other distro if you have the chance.

Thank you
Giuseppe
Comment 10 tuxce 2008-11-18 18:23:18 CET
(In reply to comment #9)
> As you can see /usr/share ends with a / so I think the problem lies on
> Archlinux. Please let me know if it occurs with other distro if you have the
> chance.
In Fedora 9 (KDE):
$ echo $XDG_DATA_DIRS
/usr/share/kde-settings/kde-profile/default/share:/usr/local/share:/usr/share

At http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html, there is some examples without last "/".
If we take another variable name, for example $PATH, I can either set path with the last / or not

Maybe you can use g_build_filename() to avoid "/" checking.
Comment 11 Giuseppe Torelli 2008-11-19 06:58:59 CET
(In reply to comment #10)
> Maybe you can use g_build_filename() to avoid "/" checking.

Yes, thank you. Can you please edit line 178 like the following and tell me if it works so we close this bug?

filename = g_build_path ("/",dirname,"applications",NULL);

Thanks,
Giuseppe
Comment 12 tuxce 2008-11-19 18:56:15 CET
Yes, it works.
Thanks.
Comment 13 Giuseppe Torelli 2008-11-20 07:12:52 CET
Fixed in revision 28867.

Bug #4626

Reported by:
tuxce
Reported on: 2008-11-16
Last modified on: 2008-11-20

People

Assignee:
Giuseppe Torelli
CC List:
0 users

Version

Attachments

correct path to applications .desktop files (346 bytes, patch)
2008-11-16 18:34 CET , tuxce
no flags
Double applications loaded with the patch. (78.87 KB, image/png)
2008-11-16 18:55 CET , Giuseppe Torelli
no flags
Applications listed correctly (68.92 KB, image/png)
2008-11-16 18:56 CET , Giuseppe Torelli
no flags

Additional information