From: Debian Multimedia Maintainers Date: Sat, 29 Jun 2019 01:02:25 +0000 (+0100) Subject: optional-qtwebengine-14-5006d4f9ed636ad0798af9dac01a91bdff877d45 X-Git-Tag: archive/raspbian/1%3.10.4+repack-1+rpi1~1^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=21bce823f92cdee5bcfaa076b15d61355ade5f69;p=supercollider.git optional-qtwebengine-14-5006d4f9ed636ad0798af9dac01a91bdff877d45 commit 5006d4f9ed636ad0798af9dac01a91bdff877d45 Author: Nathan Ho Date: Thu Jul 4 19:56:05 2019 -0700 scide: Fix crashes for certain menu items and actions with QtWebEngine off Gbp-Pq: Name optional-qtwebengine-14-5006d4f9ed636ad0798af9dac01a91bdff877d45 --- diff --git a/editors/sc-ide/widgets/lookup_dialog.cpp b/editors/sc-ide/widgets/lookup_dialog.cpp index a199e4d..d74410b 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 ae707c1..9b471d7 100644 --- a/editors/sc-ide/widgets/main_window.cpp +++ b/editors/sc-ide/widgets/main_window.cpp @@ -441,21 +441,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")); @@ -468,6 +467,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())); @@ -503,8 +503,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]); @@ -672,7 +674,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 7c9b828..d8fb6af 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,