diff --git a/articlewebview.cc b/articlewebview.cc index f6d4929e..e8bd821d 100644 --- a/articlewebview.cc +++ b/articlewebview.cc @@ -107,10 +107,12 @@ bool ArticleWebView::eventFilter(QObject *obj, QEvent *ev) { return true; } } - // if (ev->type() == QEvent::FocusIn) { - // QFocusEvent *pe = static_cast(ev); - // focusInEvent(pe); - // } + if( ev->type() == QEvent::FocusIn ) + { + QFocusEvent * pe = static_cast< QFocusEvent * >( ev ); + focusInEvent( pe ); + return true; + } return QWebEngineView::eventFilter(obj, ev); } diff --git a/mainwindow.cc b/mainwindow.cc index d9e6517a..b120755c 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -772,7 +772,6 @@ MainWindow::MainWindow( Config::Class & cfg_ ): ui.searchPane->setVisible( cfg.preferences.searchInDock ); applyProxySettings(); - applyWebSettings(); connect( &dictNetMgr, SIGNAL( proxyAuthenticationRequired( QNetworkProxy, QAuthenticator * ) ), this, SLOT( proxyAuthentication( QNetworkProxy, QAuthenticator * ) ) ); @@ -1231,7 +1230,7 @@ void MainWindow::closeEvent( QCloseEvent * ev ) // Don't ignore the close event, because doing so cancels session logout if // the main window is visible when the user attempts to log out. // The main window will be only hidden, because QApplication::quitOnLastWindowClosed - // property is false and Qt::WA_DeleteOnClose widget attribute is not set. + // property is false and Qt::WA_DeleteOnClose widget is not set. Q_ASSERT(!QApplication::quitOnLastWindowClosed()); Q_ASSERT(!testAttribute(Qt::WA_DeleteOnClose)); #else @@ -1305,17 +1304,6 @@ void MainWindow::applyProxySettings() QNetworkProxy::setApplicationProxy( proxy ); } -void MainWindow::applyWebSettings() -{ - QWebEngineSettings * defaultSettings = QWebEngineSettings::defaultSettings(); - defaultSettings->setAttribute( QWebEngineSettings::PluginsEnabled, cfg.preferences.enableWebPlugins ); - defaultSettings->setAttribute( QWebEngineSettings::PlaybackRequiresUserGesture, false ); - defaultSettings->setAttribute( QWebEngineSettings::WebAttribute::LocalContentCanAccessRemoteUrls, true ); - defaultSettings->setAttribute( QWebEngineSettings::WebAttribute::LocalContentCanAccessFileUrls, true ); - defaultSettings->setAttribute( QWebEngineSettings::WebAttribute::ErrorPageEnabled, false ); - defaultSettings->setAttribute( QWebEngineSettings::WebAttribute::JavascriptCanOpenWindows, true ); -} - void MainWindow::setupNetworkCache( int maxSize ) { // x << 20 == x * 2^20 converts mebibytes to bytes. @@ -2229,7 +2217,6 @@ void MainWindow::editPreferences() updateTrayIcon(); applyProxySettings(); - applyWebSettings(); ui.tabWidget->setHideSingleTab(cfg.preferences.hideSingleTab); diff --git a/mainwindow.hh b/mainwindow.hh index cf77a657..3c012630 100644 --- a/mainwindow.hh +++ b/mainwindow.hh @@ -209,7 +209,6 @@ private: void closeEvent( QCloseEvent * ); void applyProxySettings(); - void applyWebSettings(); void setupNetworkCache( int maxSize ); void makeDictionaries(); void updateStatusLine();