[wx-dev] wxLaunchDefaultBrowser is failing
Priyank Bolia
priyank.bolia at gmail.com
Fri Jul 18 22:18:49 PDT 2008
I didn't got u, if you are asking what is the returnCode value for this:
int returnCode =3D wxExecute(xdg_open + _T(" ") + url, wxEXEC_SYNC);
if(returnCode =3D=3D 0)
return true;
then the returnCode is 4, which is the right error code, hence it won't
return and gnome and kde detection code wont be called.
As, I already mentioned currently the flag wxEXEC_SYNC is not used,
defaulting to wxEXEC_ASYNC which will never return 0.
Thanks,
Priyank
On Sat, Jul 19, 2008 at 10:39 AM, Vadim Zeitlin <vadim at wxwidgets.org> wrote:
> On Sat, 19 Jul 2008 09:27:39 +0530 Priyank Bolia <priyank.bolia at gmail.com>
> wrote:
>
> PB> wxExecute is called async, there which means it return the process id
> and it
> PB> would never return false.
> PB> The xdg_open return error codes from 1 to 4, in my case, I am getting
> the
> PB> error code 4, both from the code and manually running on command line.
> PB>
> PB> xdg-open http://google.com
> PB> Error showing url: There was an error launching the default action
> command
> PB> associated with this location.
> PB>
> PB>
> PB>
> http://www.mail-archive.com/ubuntu-bugs@lists.ubuntu.com/msg774351.html
> PB>
> PB> I would be great, if the code modified to:
> PB> wxString path, xdg_open;
> PB> if ( wxGetEnv(_T("PATH"), &path) &&
> PB> wxFindFileInPath(&xdg_open, path, _T("xdg-open")) )
> PB> {
> PB> int returnCode =3D wxExecute(xdg_open + _T(" ") + url,
> wxEXEC_SYNC);
> PB> if(returnCode =3D=3D 0)
> PB> return true;
> PB> }
> PB> and moved to the else condition of the Gnome & KDE.
>
> The desktop detection is not 100% reliable unfortunately and, anyhow, we
> really should make xdg-open to work.
>
> It's true that checking its return value is not done correctly in the
> current code. If using wxEXEC_SYNC works (i.e. returns as soon as the
> browser is launched instead of waiting until it exits as would be the case
> if xdg-open used exec() to launch it), it should definitely be done like
> this.
>
> Could you please test if adding wxEXEC_SYNC to wxExecute() call (*withou=
t*
> moving it after Gnome/KDE checks, so that it would still be executed)
> works?
>
> Thanks,
> 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/ace33=
009/attachment.htm
More information about the wx-dev
mailing list