commit 5006d4f9ed636ad0798af9dac01a91bdff877d45
Author: Nathan Ho <nathan@snappizz.com>
Date:   Thu Jul 4 19:56:05 2019 -0700

    scide: Fix crashes for certain menu items and actions with QtWebEngine off

diff --git a/editors/sc-ide/widgets/lookup_dialog.cpp b/editors/sc-ide/widgets/lookup_dialog.cpp
index 6be1ba639..a56d2d120 100644
--- a/editors/sc-ide/widgets/lookup_dialog.cpp
+++ b/editors/sc-ide/widgets/lookup_dialog.cpp
@@ -36,7 +36,9 @@
 namespace ScIDE {
 
 GenericLookupDialog::GenericLookupDialog(QWidget* parent): QDialog(parent) {
+#ifdef SC_USE_QTWEBENGINE
     addAction(MainWindow::instance()->action(MainWindow::LookupDocumentationForCursor));
+#endif // SC_USE_WEBENGINE
 
     mQueryEdit = new QLineEdit(this);
 
diff --git a/editors/sc-ide/widgets/main_window.cpp b/editors/sc-ide/widgets/main_window.cpp
index cfe436212..a6d0f73da 100644
--- a/editors/sc-ide/widgets/main_window.cpp
+++ b/editors/sc-ide/widgets/main_window.cpp
@@ -417,21 +417,20 @@ void MainWindow::createActions() {
     settings->addAction(action, "ide-settings-dialog", ideCategory);
 
     // Help
+    mActions[ReportABug] = action = new QAction(QIcon::fromTheme("system-help"), tr("Report a bug..."), this);
+    action->setStatusTip(tr("Report a bug"));
+    connect(action, SIGNAL(triggered()), this, SLOT(doBugReport()));
+
+#ifdef SC_USE_QTWEBENGINE
     mActions[Help] = action = new QAction(tr("Show &Help Browser"), this);
     action->setStatusTip(tr("Show and focus the Help Browser"));
     connect(action, SIGNAL(triggered()), this, SLOT(openHelp()));
     settings->addAction(action, "help-browser", helpCategory);
 
-#ifdef SC_USE_QTWEBENGINE
     mActions[HelpAboutIDE] = action =
         new QAction(QIcon::fromTheme("system-help"), tr("How to Use SuperCollider IDE"), this);
     action->setStatusTip(tr("Open the SuperCollider IDE guide"));
     connect(action, SIGNAL(triggered()), this, SLOT(openHelpAboutIDE()));
-#endif // SC_USE_QTWEBENGINE
-
-    mActions[ReportABug] = action = new QAction(QIcon::fromTheme("system-help"), tr("Report a bug..."), this);
-    action->setStatusTip(tr("Report a bug"));
-    connect(action, SIGNAL(triggered()), this, SLOT(doBugReport()));
 
     mActions[LookupDocumentationForCursor] = action = new QAction(tr("Look Up Documentation for Cursor"), this);
     action->setShortcut(tr("Ctrl+D", "Look Up Documentation for Cursor"));
@@ -444,6 +443,7 @@ void MainWindow::createActions() {
     action->setStatusTip(tr("Enter text to look up in documentation"));
     connect(action, SIGNAL(triggered()), this, SLOT(lookupDocumentation()));
     settings->addAction(action, "help-lookup", helpCategory);
+#endif // SC_USE_QTWEBENGINE
 
     mActions[ShowAbout] = action = new QAction(QIcon::fromTheme("help-about"), tr("&About SuperCollider"), this);
     connect(action, SIGNAL(triggered()), this, SLOT(showAbout()));
@@ -479,8 +479,10 @@ void MainWindow::createActions() {
 
     // Add actions to docklets, so shortcuts work when docklets detached:
 
+#ifdef SC_USE_QTWEBENGINE
     mPostDocklet->widget()->addAction(mActions[LookupDocumentation]);
     mPostDocklet->widget()->addAction(mActions[LookupDocumentationForCursor]);
+#endif // SC_USE_QTWEBENGINE
     mPostDocklet->widget()->addAction(mActions[LookupImplementation]);
     mPostDocklet->widget()->addAction(mActions[LookupImplementationForCursor]);
     mPostDocklet->widget()->addAction(mActions[LookupReferences]);
@@ -648,7 +650,9 @@ void MainWindow::createMenus() {
     menuBar->addMenu(menu);
 
     menu = new QMenu(tr("&Help"), this);
+#ifdef SC_USE_QTWEBENGINE
     menu->addAction(mActions[HelpAboutIDE]);
+#endif
     menu->addAction(mActions[ReportABug]);
 #ifdef SC_USE_QTWEBENGINE
     menu->addSeparator();
diff --git a/editors/sc-ide/widgets/main_window.hpp b/editors/sc-ide/widgets/main_window.hpp
index 21faea32c..aaea60956 100644
--- a/editors/sc-ide/widgets/main_window.hpp
+++ b/editors/sc-ide/widgets/main_window.hpp
@@ -101,8 +101,15 @@ public:
         Help,
         HelpAboutIDE,
         ReportABug,
+
+#ifdef SC_USE_QTWEBENGINE
+        // These QtWebEngine-only actions are branched at the preprocessor
+        // level so that accidental invocations of these actions in other code
+        // are caught at compile time.
         LookupDocumentationForCursor,
         LookupDocumentation,
+#endif // SC_USE_QTWEBENGINE
+
         ShowAbout,
         ShowAboutQT,
 
