WebView: Temporarily redirect stderr to /dev/null when creating the first WebView, to get rid of spurious libpng warnings on PNG files integrated inside the Qt WebKit library.

[GB.QT4.WEBKIT]
* BUG: WebView: Temporarily redirect stderr to /dev/null when creating the first WebView, to get rid of spurious libpng warnings on PNG files integrated inside the Qt WebKit library.

[GB.QT5.WEBKIT]
* BUG: WebView: Temporarily redirect stderr to /dev/null when creating the first WebView, to get rid of spurious libpng warnings on PNG files integrated inside the Qt WebKit library.
This commit is contained in:
gambas 2018-09-19 20:51:13 +02:00
parent be9a0b29d3
commit d2782ed91c
2 changed files with 18 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -64,6 +64,7 @@ DECLARE_EVENT(EVENT_DOWNLOAD);
static QNetworkAccessManager *_network_access_manager = 0;
static CWEBVIEW *_network_access_manager_view = 0;
static QT_COLOR_FUNC _old_after_set_color;
static bool _ignore_png_warnings = false;
/*
static WEBVIEW_ACTION _actions[] =
@ -203,7 +204,24 @@ static void stop_view(void *_object)
BEGIN_METHOD(WebView_new, GB_OBJECT parent)
int fd_save = -1;
if (!_ignore_png_warnings)
{
int fd = ::open("/dev/null", O_RDWR);
fd_save = ::dup(2);
::dup2(fd, 2);
::close(fd);
}
MyWebView *wid = new MyWebView(QT.GetContainer(VARG(parent)));
if (!_ignore_png_warnings)
{
::dup2(fd_save, 2);
::close(fd_save);
_ignore_png_warnings = true;
}
QT.InitWidget(wid, _object, false);