diff --git a/src/internalcommandwindow/internalcommandprocess.cpp b/src/internalcommandwindow/internalcommandprocess.cpp index e7ac056d..48b857a0 100644 --- a/src/internalcommandwindow/internalcommandprocess.cpp +++ b/src/internalcommandwindow/internalcommandprocess.cpp @@ -35,9 +35,11 @@ InternalCommandProcess::~InternalCommandProcess() { wait(); } +#ifdef ENABLE_PYTHON void InternalCommandProcess::setPyRun(PyRun *pyRun) { m_pyRun = pyRun; } +#endif void InternalCommandProcess::run(void) { sendWelcome(); @@ -290,19 +292,21 @@ void InternalCommandProcess::processLine(const QString &sline) { fullCommand = command + " " + args.join(' '); } if(!matched) { - if(m_pyRun) { #ifdef ENABLE_PYTHON + if(m_pyRun) { QString result; int ret = -1; m_pyRun->runScriptStr("from quardCRT import crt\r\nprint("+fullCommand+")", &result, &ret); if(ret == 0) { result.replace("\n","\r\n"); sendString(result); - } else - #endif - { + } else { sendLineString("Invalid command!"); } + } else + #endif + { + sendLineString("Invalid command!"); } } if((!historyCmdList.isEmpty()) && historyCmdList.last() == fullCommand) { diff --git a/src/internalcommandwindow/internalcommandwindow.cpp b/src/internalcommandwindow/internalcommandwindow.cpp index 81975bb7..2e6d6a44 100644 --- a/src/internalcommandwindow/internalcommandwindow.cpp +++ b/src/internalcommandwindow/internalcommandwindow.cpp @@ -169,9 +169,11 @@ InternalCommandWindow::~InternalCommandWindow() { delete ui; } +#ifdef ENABLE_PYTHON void InternalCommandWindow::setPyRun(PyRun *pyRun) { process->setPyRun(pyRun); } +#endif void InternalCommandWindow::contextMenuEvent(QContextMenuEvent *event) { QMenu *menu = new QMenu(this);