Disable webpreview to avoid user interactaction
authorDeniz Türkoglu <turkoglu.deniz@gmail.com>
Thu, 13 Feb 2014 11:44:21 +0000 (12:44 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 18 Feb 2014 21:45:20 +0000 (22:45 +0100)
If the user interacts with the webview, for instance click a button
or type text in it, it crashes the client.

Disable the webview so we still get the previews but can't interact
with them.

src/qtui/webpreviewitem.cpp

index d5032cd..99bb553 100644 (file)
@@ -36,6 +36,7 @@ WebPreviewItem::WebPreviewItem(const QUrl &url)
     QWebView *webView = new QWebView;
     webView->settings()->setAttribute(QWebSettings::JavascriptEnabled, false);
     webView->load(url);
     QWebView *webView = new QWebView;
     webView->settings()->setAttribute(QWebSettings::JavascriptEnabled, false);
     webView->load(url);
+    webView->setDisabled(true);
     webView->resize(1000, 750);
     QGraphicsProxyWidget *proxyItem = new QGraphicsProxyWidget(this);
     proxyItem->setWidget(webView);
     webView->resize(1000, 750);
     QGraphicsProxyWidget *proxyItem = new QGraphicsProxyWidget(this);
     proxyItem->setWidget(webView);