[jitsi-dev] Jitsi cannot open received files folders (Linux, Xfce)


#1

Hello,

On my computer, Jitsi cannot open the folder of received files.
When i click on "Open Folder", i get this message:

"We couldn't find an application to open this folder."

exo-open, gnome-open, xdg-open are all capable of opening folders with the specified file manager (thunar).

Where are the file associations stored that Jitsi uses?

···

--
O zi buna,

Kertesz Laszlo

Using Opera's revolutionary email client: http://www.opera.com/mail/


#2

Hi Kertesz,

We use the DesktopService to open file and folder. If you are on JDK6, it uses java.awt.Desktop (http://download.oracle.com/javase/6/docs/api/java/awt/Desktop.html). But it seems that this classes is not 100% portable so methods may not work properly on Xfce.

You can try the following code in Java, and test it on Xfce. If you get the same error, it comes from JDK6 and we should handle this case in the DesktopServiceImpl.

import java.awt.*;
import java.io.*;

public class Test
{
         public static void main(String argv[]) throws Exception
         {
                 File folder = new File("/");
                 if(Desktop.isDesktopSupported())
                 {
                         Desktop desktop = Desktop.getDesktop();
                         if(desktop.isSupported(Desktop.Action.OPEN))
                         {
                                 desktop.open(folder);
                         }
                         else
                         {
                                 System.out.println("OPEN not supported");
                         }
                 }
                 else
                 {
                         System.out.println("Desktop not supported");
                 }
         }
}

Regards,

···

--
Seb

Le 11/10/11 09:51, Kertesz Laszlo a écrit :

Hello,

On my computer, Jitsi cannot open the folder of received files.
When i click on "Open Folder", i get this message:

"We couldn't find an application to open this folder."

exo-open, gnome-open, xdg-open are all capable of opening folders with the specified file manager (thunar).

Where are the file associations stored that Jitsi uses?


#3

From: "Sebastien Vincent" <seb@jitsi.org>
To: dev@jitsi.java.net
Sent: Tuesday, October 11, 2011 11:18:30 AM
Subject: [jitsi-dev] Re: Jitsi cannot open received files folders (Linux, Xfce)

Hi Kertesz,

We use the DesktopService to open file and folder. If you are on
JDK6,
it uses java.awt.Desktop
(http://download.oracle.com/javase/6/docs/api/java/awt/Desktop.html).
But it seems that this classes is not 100% portable so methods may
not
work properly on Xfce.

I did some further digging and i came to these conclusions (and a workaround):

1. Both Java (Sunand JDk) seem to behave similarly - same error.
2. The method used is based on gnome-open (which is an executable part of the libgnome2-0 package). Or some othe rcomponent of that package.
If i uninstall it, no GUI error is presented anymore only some in the logs and no visible stuff happens when clicking on links (open file/folder or web URLs).
3. But while gnome-open works on its own from terminal by using the settings specified through xdg settings ($HOME/.local/share/applications/mimeapps.list contains the settings), the method used by the JVM is not working everytime only in the case below:
4. The Java method uses only the associations set in the $HOME/.local/share/applications/defaults.list file. I dont know exactly how that file works (it is used by gnome-open, that is clear), and it has the file type associations of the programs that have in their .desktop files their mime types specified (but i dont know when those apps are added to it though, some apps just popped up in it after i reinstalled libgnome2). I personally softlinked the mimeapps.list to defaults.list and it is working it seems (they both use the same syntax).

Now, this makes Jitsi effectively depend on libgnome2-provided services for the opening of links. Which i dont know if its quite ok.

You can try the following code in Java, and test it on Xfce. If you
get
the same error, it comes from JDK6 and we should handle this case in
the
DesktopServiceImpl.

import java.awt.*;
import java.io.*;

public class Test
{
         public static void main(String argv[]) throws Exception
         {
                 File folder = new File("/");
                 if(Desktop.isDesktopSupported())
                 {
                         Desktop desktop = Desktop.getDesktop();
                         if(desktop.isSupported(Desktop.Action.OPEN))
                         {
                                 desktop.open(folder);
                         }
                         else
                         {
                                 System.out.println("OPEN not
                                 supported");
                         }
                 }
                 else
                 {
                         System.out.println("Desktop not supported");
                 }
         }
}

Regards,
--
Seb

I tried to run the code in Geany which supposedly has java support, but it seems that i dont have the java build environment set up correctly (as i never used it).
Maybe if you could compile it for me i can try running it.

···

----- Original Message -----

Le 11/10/11 09:51, Kertesz Laszlo a écrit :
> Hello,
>
> On my computer, Jitsi cannot open the folder of received files.
> When i click on "Open Folder", i get this message:
>
> "We couldn't find an application to open this folder."
>
> exo-open, gnome-open, xdg-open are all capable of opening folders
> with
> the specified file manager (thunar).
>
> Where are the file associations stored that Jitsi uses?
>

--
O zi buna,

Kertesz Laszlo


#4

Hi Kertesz,

Thanks for having looked at the problem!

Unfortunately I think the softlinking is too much related to system and it is not the work of Jitsi to modify it.

Personally I don't have any $HOME/.local/share/applications (but maybe it is because I use Gnome desktop and not XFCE).

I search a little bit on the internet and I found http://ubuntuforums.org/showthread.php?t=777603, which talk about mime problem on Ubuntu. The solution was to remove the folder $HOME/.local/share. I don't know what other stuff .local/share/ folder contains (and if it can be dangerous to remove for the OS) but you may, _if you want_, try to move this folder somewhere, reboot and launch again jitsi. And if Jitsi still has a problem for opening folder you can always move again the .share folder to its original location (to not loose any stuff that .share contains). Be careful I am not sure removing .local/share is safe!

···

--
Seb

Le 30/10/11 10:34, Kertesz Laszlo a écrit :

----- Original Message -----

From: "Sebastien Vincent"<seb@jitsi.org>
To: dev@jitsi.java.net
Sent: Tuesday, October 11, 2011 11:18:30 AM
Subject: [jitsi-dev] Re: Jitsi cannot open received files folders (Linux, Xfce)

Hi Kertesz,

We use the DesktopService to open file and folder. If you are on
JDK6,
it uses java.awt.Desktop
(http://download.oracle.com/javase/6/docs/api/java/awt/Desktop.html).
But it seems that this classes is not 100% portable so methods may
not
work properly on Xfce.

I did some further digging and i came to these conclusions (and a workaround):

1. Both Java (Sunand JDk) seem to behave similarly - same error.
2. The method used is based on gnome-open (which is an executable part of the libgnome2-0 package). Or some othe rcomponent of that package.
If i uninstall it, no GUI error is presented anymore only some in the logs and no visible stuff happens when clicking on links (open file/folder or web URLs).
3. But while gnome-open works on its own from terminal by using the settings specified through xdg settings ($HOME/.local/share/applications/mimeapps.list contains the settings), the method used by the JVM is not working everytime only in the case below:
4. The Java method uses only the associations set in the $HOME/.local/share/applications/defaults.list file. I dont know exactly how that file works (it is used by gnome-open, that is clear), and it has the file type associations of the programs that have in their .desktop files their mime types specified (but i dont know when those apps are added to it though, some apps just popped up in it after i reinstalled libgnome2). I personally softlinked the mimeapps.list to defaults.list and it is working it seems (they both use the same syntax).

Now, this makes Jitsi effectively depend on libgnome2-provided services for the opening of links. Which i dont know if its quite ok.

You can try the following code in Java, and test it on Xfce. If you
get
the same error, it comes from JDK6 and we should handle this case in
the
DesktopServiceImpl.

import java.awt.*;
import java.io.*;

public class Test
{
          public static void main(String argv[]) throws Exception
          {
                  File folder = new File("/");
                  if(Desktop.isDesktopSupported())
                  {
                          Desktop desktop = Desktop.getDesktop();
                          if(desktop.isSupported(Desktop.Action.OPEN))
                          {
                                  desktop.open(folder);
                          }
                          else
                          {
                                  System.out.println("OPEN not
                                  supported");
                          }
                  }
                  else
                  {
                          System.out.println("Desktop not supported");
                  }
          }
}

Regards,
--
Seb

I tried to run the code in Geany which supposedly has java support, but it seems that i dont have the java build environment set up correctly (as i never used it).
Maybe if you could compile it for me i can try running it.

Le 11/10/11 09:51, Kertesz Laszlo a écrit :

Hello,

On my computer, Jitsi cannot open the folder of received files.
When i click on "Open Folder", i get this message:

"We couldn't find an application to open this folder."

exo-open, gnome-open, xdg-open are all capable of opening folders
with
the specified file manager (thunar).

Where are the file associations stored that Jitsi uses?