Comment 140 for bug 1142213

Revision history for this message
In , Ruslan (b7-10110111) wrote :

> - it is defined on windows (with mingw at least) and works, but opens a terminal to execute a command. (not so nice). And I'm not sure _popen would fix this, would it ?
Most likely it won't. But we can make something like this:
#ifdef _WIN32
    ShowWindow(GetConsoleWindow(),SW_HIDE);
#endif
before running popen(). (Ugly, but should do the trick.)
> - on unix, it does not allow to easily redirect stderr, so you get an error message (for every application) when kde4-config is not installed. So that I had to add a 2> /dev/null (committed), to hide the (armless) error message, in current master, because users were already complaining.
This is more serious. Not sure how to fix this well enough...
> popen being more likely to work on windows depends on MinGW (not even sure if it is implemented with VC ...).
_popen() is listed in MSDN, so this one should be available with VC.

> So bottomline: if we want to stick to popen (to be more glib-error safe), we'd likely need more code (and more #ifdef) than what we have now ...
Yeah, hard to decide. Seems you're right and we should go back to glib. (But we should make sure this doesn't break any distro again if they still use unfixed glib version).