Permalink
Browse files

Missing emake Crash Fix (#48)

Make keyword API a noop if emake not connected and look for emake in a folder named "enigma-dev" next to the executable.
  • Loading branch information...
RobertBColton committed Nov 13, 2018
1 parent cab1e51 commit cd8ff62dc5dd3da1d10f6baa2f4e136688d5f090
Showing with 7 additions and 2 deletions.
  1. +1 −1 Plugins/ServerPlugin.cpp
  2. +6 −1 Widgets/CodeWidgetScintilla.cpp
@@ -244,7 +244,7 @@ ServerPlugin::ServerPlugin(MainWindow& mainWindow) : RGMPlugin(mainWindow) {
process = new QProcess(this);

// look for an executable file that looks like emake in some common directories
QList<QString> searchPaths = {QDir::currentPath(), "../RadialGM/Submodules/enigma-dev"};
QList<QString> searchPaths = {QDir::currentPath(), "./enigma-dev", "../RadialGM/Submodules/enigma-dev"};
QFileInfo emakeFileInfo(QFile("emake"));
foreach (auto path, searchPaths) {
const QDir dir(path);
@@ -39,16 +39,21 @@ void CodeWidget::prepareKeywordStore() {
}

void CodeWidget::addKeyword(const QString& keyword, KeywordType type) {
if (!sciApis) return;
QString fmt = keyword + QObject::tr("?%0").arg(type);
sciApis->add(fmt);
}

void CodeWidget::addCalltip(const QString& keyword, const QString& calltip, KeywordType type) {
if (!sciApis) return;
QString fmt = keyword + QObject::tr("?%0(%1)").arg(type).arg(calltip);
sciApis->add(fmt);
}

void CodeWidget::finalizeKeywords() { sciApis->prepare(); }
void CodeWidget::finalizeKeywords() {
if (!sciApis) return;
sciApis->prepare();
}

CodeWidget::CodeWidget(QWidget* parent) : QWidget(parent), font(QFont("Courier", 10)) {
prepare_scintilla_apis();

0 comments on commit cd8ff62

Please sign in to comment.