[wx-dev] wxLaunchDefaultBrowser is failing
Priyank Bolia
priyank.bolia at gmail.com
Fri Jul 18 20:57:39 PDT 2008
On Sat, Jul 19, 2008 at 3:57 AM, Vadim Zeitlin <vadim at wxwidgets.org> wrote:
> On Fri, 18 Jul 2008 23:47:10 +0530 Priyank Bolia <priyank.bolia at gmail.com>
> wrote:
>
> PB> wxLaunchDefaultBrowser fails on Ubuntu 8.04, because the xdg_open is
> failing
> PB> in utilscmn.cpp.
>
> Which version of wx do you use?
2.8 latest stable release.
>
>
> PB> My questions is why this code is there, when the gnome and KDE should
> be
> PB> given priority and the xdg_open should be run only if they fail.
>
> If you post here, please take time to look up a (long) discussion about
> this just a couple of weeks ago,
Sorry, can you tell me how to search the mailing list achieve :(
>
>
> PB> Relying on GNome or KDE should be the better way AFAIK. Also if you
> think
> PB> this is not possible, can you please add an output error check for
> xdg_open.
>
> I do see the error check in the code, if wxExecute() returns true but
> xdg-open failed you really need to tell us more details, like why did it
> fail, what error code did it return and so on.
>
wxExecute is called async, there which means it return the process id and it
would never return false.
The xdg_open return error codes from 1 to 4, in my case, I am getting the
error code 4, both from the code and manually running on command line.
xdg-open http://google.com
Error showing url: There was an error launching the default action command
associated with this location.
http://www.mail-archive.com/ubuntu-bugs@lists.ubuntu.com/msg774351.html
I would be great, if the code modified to:
wxString path, xdg_open;
if ( wxGetEnv(_T("PATH"), &path) &&
wxFindFileInPath(&xdg_open, path, _T("xdg-open")) )
{
int returnCode =3D wxExecute(xdg_open + _T(" ") + url, wxEXEC_SYNC);
if(returnCode =3D=3D 0)
return true;
}
and moved to the else condition of the Gnome & KDE.
>
> Regards,
> VZ
>
> _______________________________________________
> wx-dev mailing list
> wx-dev at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wx-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-dev/attachments/20080719/15070=
a9f/attachment-0001.htm
More information about the wx-dev
mailing list