[Piklab-svn] SF.net SVN: piklab:[2928] trunk/piklab_kde4
IDE for PIC microcontrollers
Brought to you by:
azhyd
|
From: <az...@us...> - 2012-07-04 07:02:34
|
Revision: 2928
http://piklab.svn.sourceforge.net/piklab/?rev=2928&view=rev
Author: azhyd
Date: 2012-07-04 07:02:24 +0000 (Wed, 04 Jul 2012)
Log Message:
-----------
+ fixed so that an error is reported when executable not found
+ fixed parsing for jalv2
+ fixed jalv2 templerate generator
Modified Paths:
--------------
trunk/piklab_kde4/Changelog
trunk/piklab_kde4/src/common/global/process.cpp
trunk/piklab_kde4/src/common/global/process.h
trunk/piklab_kde4/src/common/global/process_kde.cpp
trunk/piklab_kde4/src/common/global/process_kde.h
trunk/piklab_kde4/src/progs/custom/base/custom_prog.cpp
trunk/piklab_kde4/src/tools/boost/boostc_compile.cpp
trunk/piklab_kde4/src/tools/c18/c18_compile.cpp
trunk/piklab_kde4/src/tools/cc5x/cc5x_compile.cpp
trunk/piklab_kde4/src/tools/ccsc/ccsc_compile.cpp
trunk/piklab_kde4/src/tools/ccsc/ccsc_compile.h
trunk/piklab_kde4/src/tools/gputils/gputils_compile.cpp
trunk/piklab_kde4/src/tools/gui/toolchain_config_widget.cpp
trunk/piklab_kde4/src/tools/jalv2/CMakeLists.txt
trunk/piklab_kde4/src/tools/jalv2/jalv2.cpp
trunk/piklab_kde4/src/tools/jalv2/jalv2_compile.cpp
trunk/piklab_kde4/src/tools/list/compile_process.cpp
trunk/piklab_kde4/src/tools/list/compile_process.h
trunk/piklab_kde4/src/tools/mpc/mpc_compile.cpp
trunk/piklab_kde4/src/tools/mpc/mpc_compile.h
trunk/piklab_kde4/src/tools/sdcc/sdcc_compile.cpp
Added Paths:
-----------
trunk/piklab_kde4/src/tools/jalv2/jalv2_generator.cpp
trunk/piklab_kde4/src/tools/jalv2/jalv2_generator.h
Modified: trunk/piklab_kde4/Changelog
===================================================================
--- trunk/piklab_kde4/Changelog 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/Changelog 2012-07-04 07:02:24 UTC (rev 2928)
@@ -1,3 +1,8 @@
+0.16.2 (3 July 2012)
+* fixed toolchain output when executable cannot be found
+* fixed parsing for jalv2 [reported by biglacko]
+* fixed template generator for jalv2
+
0.16.1 (1 July 2012)
* fixed command-line utilities compilation with Qt only
* fixed command-line utilities compilation on Windows
Modified: trunk/piklab_kde4/src/common/global/process.cpp
===================================================================
--- trunk/piklab_kde4/src/common/global/process.cpp 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/src/common/global/process.cpp 2012-07-04 07:02:24 UTC (rev 2928)
@@ -23,7 +23,8 @@
_stopExecute(false)
{
_process = new ProcessIO(this);
- connect(_process, SIGNAL(processExited()), SLOT(exitedSlot()));
+ connect(_process, SIGNAL(finished()), SLOT(finishedSlot()));
+ connect(_process, SIGNAL(error()), SLOT(errorSlot()));
connect(_process, SIGNAL(readyReadStdout()), SLOT(readyReadStdoutSlot()));
connect(_process, SIGNAL(readyReadStderr()), SLOT(readyReadStderrSlot()));
connect(&_timer, SIGNAL(timeout()), SLOT(timeoutSlot()));
@@ -69,7 +70,7 @@
}
if ( !_process->start(env.isEmpty() ? 0 : &env) ) {
- _state = StartFailed;
+ _state = Error;
return false;
}
@@ -83,14 +84,21 @@
return _process->_kproc->exitCode();
}
-void Process::Base::exitedSlot()
+void Process::Base::finishedSlot()
{
_timer.stop();
_state = Exited;
FOR_EACH(OutputType, type) readyRead(type);
- emit done(exitCode());
+ emit done();
}
+void Process::Base::errorSlot()
+{
+ _timer.stop();
+ _state = Error;
+ emit error();
+}
+
void Process::Base::timeoutSlot()
{
kill();
Modified: trunk/piklab_kde4/src/common/global/process.h
===================================================================
--- trunk/piklab_kde4/src/common/global/process.h 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/src/common/global/process.h 2012-07-04 07:02:24 UTC (rev 2928)
@@ -27,7 +27,7 @@
//typedef Q3Process ProcessIO;
//----------------------------------------------------------------------------
-enum State { Stopped, StartFailed, Running, Exited, Timedout, Killed };
+enum State { Stopped, Error, Running, Exited, Timedout, Killed, };
BEGIN_DECLARE_ENUM(OutputType)
Stdout = 0, Stderr
@@ -55,7 +55,8 @@
bool execute(int msec); // -1 == no timeout
signals:
- void done(int code);
+ void done();
+ void error();
void timeout();
void dataReceived(::Process::OutputType type);
@@ -63,7 +64,8 @@
void kill();
protected slots:
- void exitedSlot();
+ void finishedSlot();
+ void errorSlot();
void timeoutSlot();
void readyReadStdoutSlot() { readyRead(OutputType::Stdout); }
void readyReadStderrSlot() { readyRead(OutputType::Stderr); }
Modified: trunk/piklab_kde4/src/common/global/process_kde.cpp
===================================================================
--- trunk/piklab_kde4/src/common/global/process_kde.cpp 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/src/common/global/process_kde.cpp 2012-07-04 07:02:24 UTC (rev 2928)
@@ -17,7 +17,8 @@
_kproc->setOutputChannelMode(KProcess::SeparateChannels);
connect(_kproc.get(), SIGNAL(readyReadStandardOutput()), SLOT(receivedStandardOutput()));
connect(_kproc.get(), SIGNAL(readyReadStandardError()), SLOT(receivedStandardError()));
- connect(_kproc.get(), SIGNAL(stateChanged(QProcess::ProcessState)), SLOT(stateChanged(QProcess::ProcessState)));
+ connect(_kproc.get(), SIGNAL(error(QProcess::ProcessError)), SIGNAL(error()));
+ connect(_kproc.get(), SIGNAL(finished(int, QProcess::ExitStatus)), SIGNAL(finished()));
}
void Process::ProcessIO::setArguments(const QStringList &args)
@@ -78,8 +79,3 @@
for (int i=0; i<data.size(); i++) _stderr[n+i] = data[i] != '\0' ? data[i] : ' ';
emit readyReadStderr();
}
-
-void Process::ProcessIO::stateChanged(QProcess::ProcessState state)
-{
- if (state == QProcess::NotRunning) emit processExited();
-}
Modified: trunk/piklab_kde4/src/common/global/process_kde.h
===================================================================
--- trunk/piklab_kde4/src/common/global/process_kde.h 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/src/common/global/process_kde.h 2012-07-04 07:02:24 UTC (rev 2928)
@@ -28,12 +28,12 @@
private slots:
void receivedStandardOutput();
void receivedStandardError();
- void stateChanged(QProcess::ProcessState);
signals:
void readyReadStdout();
void readyReadStderr();
- void processExited();
+ void error();
+ void finished();
private:
std::auto_ptr<KProcess> _kproc;
Modified: trunk/piklab_kde4/src/progs/custom/base/custom_prog.cpp
===================================================================
--- trunk/piklab_kde4/src/progs/custom/base/custom_prog.cpp 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/src/progs/custom/base/custom_prog.cpp 2012-07-04 07:02:24 UTC (rev 2928)
@@ -73,7 +73,7 @@
}
log(Log::LineType::Command, _process->arguments().join(" "));
Process::State state = Process::runSynchronouslyDialog(*_process, i18n("Executing '%1' command...").arg(action));
- if (state == Process::StartFailed) {
+ if (state == Process::Error) {
log(Log::LineType::Error, i18n("*** Error executing command ***"));
return false;
}
Modified: trunk/piklab_kde4/src/tools/boost/boostc_compile.cpp
===================================================================
--- trunk/piklab_kde4/src/tools/boost/boostc_compile.cpp 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/src/tools/boost/boostc_compile.cpp 2012-07-04 07:02:24 UTC (rev 2928)
@@ -14,7 +14,7 @@
//----------------------------------------------------------------------------
void Boost::Process::logLine(::Process::OutputType, const QString &line)
{
- if ( parseErrorLine(line, Compile::ParseErrorData("(.*)\\((\\d+).*\\): (error|warning):(.*)", 1, 2, 4, 3)) ) return;
+ if ( parseErrorLine(line, Compile::ParseErrorData("(.*)\\((\\d+).*\\): (error|warning):(.*)", 1, 2, 4, 3, Log::LineType::Error)) ) return;
doLog(Log::LineType::Normal, line, QString::null, 0);
}
Modified: trunk/piklab_kde4/src/tools/c18/c18_compile.cpp
===================================================================
--- trunk/piklab_kde4/src/tools/c18/c18_compile.cpp 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/src/tools/c18/c18_compile.cpp 2012-07-04 07:02:24 UTC (rev 2928)
@@ -34,8 +34,8 @@
void C18::CompileFile::logLine(::Process::OutputType, const QString &line)
{
- if ( parseErrorLine(line, Compile::ParseErrorData("(.*):([0-9]+):([^:]+):\\s*(.+)", 1, 2, 4, 3)) ) return;
- if ( parseErrorLine(line, Compile::ParseErrorData("(.*):([0-9]+):([^\\[]+)\\s*(.+)", 1, 2, 4, 3)) ) return;
+ if ( parseErrorLine(line, Compile::ParseErrorData("(.*):([0-9]+):([^:]+):\\s*(.+)", 1, 2, 4, 3, Log::LineType::Error)) ) return;
+ if ( parseErrorLine(line, Compile::ParseErrorData("(.*):([0-9]+):([^\\[]+)\\s*(.+)", 1, 2, 4, 3, Log::LineType::Error)) ) return;
doLog(Log::LineType::Normal, line, QString::null, 0);
}
Modified: trunk/piklab_kde4/src/tools/cc5x/cc5x_compile.cpp
===================================================================
--- trunk/piklab_kde4/src/tools/cc5x/cc5x_compile.cpp 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/src/tools/cc5x/cc5x_compile.cpp 2012-07-04 07:02:24 UTC (rev 2928)
@@ -28,7 +28,7 @@
void CC5X::CompileFile::logLine(::Process::OutputType, const QString &line)
{
- if ( parseErrorLine(line, Compile::ParseErrorData("(.*):([0-9]+):(.+)\\[([0-9]+)\\](.+)", 1, 2, 5, 3)) ) return;
+ if ( parseErrorLine(line, Compile::ParseErrorData("(.*):([0-9]+):(.+)\\[([0-9]+)\\](.+)", 1, 2, 5, 3, Log::LineType::Error)) ) return;
doLog(Log::LineType::Normal, line, QString::null, 0); // unrecognized
}
Modified: trunk/piklab_kde4/src/tools/ccsc/ccsc_compile.cpp
===================================================================
--- trunk/piklab_kde4/src/tools/ccsc/ccsc_compile.cpp 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/src/tools/ccsc/ccsc_compile.cpp 2012-07-04 07:02:24 UTC (rev 2928)
@@ -73,12 +73,12 @@
doLog(Log::LineType::Normal, line, QString::null, 0); // unrecognized
return;
}
- if ( parseErrorLine(line, Compile::ParseErrorData("[*>-]+\\s\\w+\\s\\d+\\s\"([^\"]*)\"\\sLine\\s(\\d+)\\([^)]*\\):(.*)", 1, 2, 3, type)) ) return;
- if ( parseErrorLine(line, Compile::ParseErrorData("[*>-]+\\s\"([^\"]*)\"\\sLine\\s(\\d+):\\s\\w+\\s#\\d+:(.*)", 1, 2, 3, type)) ) return;
+ if ( parseErrorLine(line, Compile::ParseErrorData("[*>-]+\\s\\w+\\s\\d+\\s\"([^\"]*)\"\\sLine\\s(\\d+)\\([^)]*\\):(.*)", 1, 2, 3, -1, type)) ) return;
+ if ( parseErrorLine(line, Compile::ParseErrorData("[*>-]+\\s\"([^\"]*)\"\\sLine\\s(\\d+):\\s\\w+\\s#\\d+:(.*)", 1, 2, 3, -1, type)) ) return;
doLog(type, line, QString::null, 0);
}
-void CCSC::CompileFile::done(int code)
+void CCSC::CompileFile::done()
{
// with wine, rely on error file
if ( Compile::Config::executableType(group())==Tool::ExecutableType::Windows ) {
@@ -91,7 +91,7 @@
for (int i=0; i<lines.count(); i++) parseLine(lines[i]);
}
}
- Compile::Process::done(code);
+ Compile::Process::done();
}
PURL::Url CCSC::CompileFile::url(PURL::FileType type, uint i) const
Modified: trunk/piklab_kde4/src/tools/ccsc/ccsc_compile.h
===================================================================
--- trunk/piklab_kde4/src/tools/ccsc/ccsc_compile.h 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/src/tools/ccsc/ccsc_compile.h 2012-07-04 07:02:24 UTC (rev 2928)
@@ -26,7 +26,7 @@
virtual PURL::Url url(PURL::FileType type = PURL::Nb_FileTypes, uint i = 0) const;
protected slots:
- virtual void done(int code);
+ virtual void done();
private:
void parseLine(const QString &line);
Modified: trunk/piklab_kde4/src/tools/gputils/gputils_compile.cpp
===================================================================
--- trunk/piklab_kde4/src/tools/gputils/gputils_compile.cpp 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/src/tools/gputils/gputils_compile.cpp 2012-07-04 07:02:24 UTC (rev 2928)
@@ -24,8 +24,8 @@
//-----------------------------------------------------------------------------
void GPUtils::AssembleFile::logLine(::Process::OutputType, const QString &line)
{
- if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*):([0-9]+):(.+)\\[[0-9]+\\](.+)", 1, 2, 4, 3)) ) return;
- if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*):([^:]+):([0-9]+):(.+)", 2, 3, 4, Log::LineType::Warning)) ) return;
+ if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*):([0-9]+):(.+)\\[[0-9]+\\](.+)", 1, 2, 4, 3, Log::LineType::Error)) ) return;
+ if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*):([^:]+):([0-9]+):(.+)", 2, 3, 4, -1, Log::LineType::Warning)) ) return;
doLog(Log::LineType::Normal, line, QString::null, 0); // unrecognized
}
Modified: trunk/piklab_kde4/src/tools/gui/toolchain_config_widget.cpp
===================================================================
--- trunk/piklab_kde4/src/tools/gui/toolchain_config_widget.cpp 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/src/tools/gui/toolchain_config_widget.cpp 2012-07-04 07:02:24 UTC (rev 2928)
@@ -215,10 +215,14 @@
if ( !_group.base(k)->checkExecutable() ) _data[k].label->setText(i18n("Unknown"));
else {
_data[k].checkLines.clear();
- delete _data[k].process;
+ if (_data[k].process != NULL) {
+ _data[k].process->blockSignals(true);
+ delete _data[k].process;
+ }
_data[k].process = checkExecutableProcess(k);
_data[k].command = _data[k].process->prettyCommand();
- connect(_data[k].process, SIGNAL(done(int)), SLOT(checkExecutableDone()));
+ connect(_data[k].process, SIGNAL(done()), SLOT(checkExecutableDone()));
+ connect(_data[k].process, SIGNAL(error()), SLOT(checkExecutableDone()));
connect(_data[k].process, SIGNAL(timeout()), SLOT(checkExecutableDone()));
QString exec = baseExecutable(k);
if ( !_data[k].process->start(5000) ) _data[k].label->setText(i18n("\"%1\" not found").arg(exec));
@@ -234,7 +238,8 @@
delete _devicesData[i].process;
_devicesData[i].process = checkDevicesProcess(i);
_devicesData[i].command = _devicesData[i].process->prettyCommand();
- connect(_devicesData[i].process, SIGNAL(done(int)), SLOT(checkDevicesDone()));
+ connect(_devicesData[i].process, SIGNAL(done()), SLOT(checkDevicesDone()));
+ connect(_devicesData[i].process, SIGNAL(error()), SLOT(checkDevicesDone()));
connect(_devicesData[i].process, SIGNAL(timeout()), SLOT(checkDevicesDone()));
_devicesData[i].done = false;
_devicesData[i].checkLines.clear();
Modified: trunk/piklab_kde4/src/tools/jalv2/CMakeLists.txt
===================================================================
--- trunk/piklab_kde4/src/tools/jalv2/CMakeLists.txt 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/src/tools/jalv2/CMakeLists.txt 2012-07-04 07:02:24 UTC (rev 2928)
@@ -6,6 +6,7 @@
jalv2_compile.cpp
jalv2_config.cpp
jalv2.cpp
+ jalv2_generator.cpp
)
automoc(${jalv2_STAT_SRCS})
Modified: trunk/piklab_kde4/src/tools/jalv2/jalv2.cpp
===================================================================
--- trunk/piklab_kde4/src/tools/jalv2/jalv2.cpp 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/src/tools/jalv2/jalv2.cpp 2012-07-04 07:02:24 UTC (rev 2928)
@@ -10,11 +10,11 @@
#include "jalv2_compile.h"
#include "jalv2_config.h"
+#include "jalv2_generator.h"
#include "devices/base/device_group.h"
#include "devices/pic/pic/pic_memory.h"
#include "devices/list/device_list.h"
#include "common/global/process.h"
-#include "tools/jal/jal_generator.h"
//----------------------------------------------------------------------------
bool JALV2::Base::checkExecutableResult(Tool::ExecutableType, QStringList &lines) const
@@ -64,5 +64,5 @@
Tool::SourceGenerator *JALV2::Group::sourceGeneratorFactory() const
{
- return new JAL::SourceGenerator;
+ return new JALV2::SourceGenerator;
}
Modified: trunk/piklab_kde4/src/tools/jalv2/jalv2_compile.cpp
===================================================================
--- trunk/piklab_kde4/src/tools/jalv2/jalv2_compile.cpp 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/src/tools/jalv2/jalv2_compile.cpp 2012-07-04 07:02:24 UTC (rev 2928)
@@ -33,8 +33,8 @@
void JALV2::CompileFile::logLine(::Process::OutputType, const QString &line)
{
- if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*):([0-9]+):\\s*(warning)(.+)", 1, 2, 4, 3)) ) return;
- if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*):([0-9]+):\\s*(.+)", 1, 2, 3, Log::LineType::Error)) ) return;
+ if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*):([0-9]+):\\s*(warning)(.+)", 1, 2, 4, 3, Log::LineType::Warning)) ) return;
+ if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*):([0-9]+):\\s*(.+)", 1, 2, 3, -1, Log::LineType::Error)) ) return;
doLog(Log::LineType::Normal, line, QString::null, 0); // unrecognized
}
Added: trunk/piklab_kde4/src/tools/jalv2/jalv2_generator.cpp
===================================================================
--- trunk/piklab_kde4/src/tools/jalv2/jalv2_generator.cpp (rev 0)
+++ trunk/piklab_kde4/src/tools/jalv2/jalv2_generator.cpp 2012-07-04 07:02:24 UTC (rev 2928)
@@ -0,0 +1,34 @@
+/***************************************************************************
+ * Copyright (C) 2012 Nicolas Hadacek <ha...@kd...> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ ***************************************************************************/
+#include "jalv2_generator.h"
+
+#include "devices/pic/base/pic.h"
+
+SourceLine::List JALV2::SourceGenerator::configLines(PURL::ToolType, const Device::Memory &, bool &) const
+{
+ // no config lines (?)
+ return SourceLine::List();
+}
+
+SourceLine::List JALV2::SourceGenerator::includeLines(PURL::ToolType, const Device::Data &data) const
+{
+ SourceLine::List lines;
+ lines.appendNotIndentedCode("include " + data.name().lower());
+ return lines;
+}
+
+SourceLine::List JALV2::SourceGenerator::sourceFileContent(PURL::ToolType, const Device::Data &, bool &) const
+{
+ SourceLine::List lines;
+ lines.appendTitle(i18n("main code"));
+ lines.appendNotIndentedCode(QString::null, "<< " + i18n("insert code") + " >>");
+ lines.appendNotIndentedCode("forever loop", i18n("loop forever"));
+ lines.appendNotIndentedCode("end loop");
+ return lines;
+}
Added: trunk/piklab_kde4/src/tools/jalv2/jalv2_generator.h
===================================================================
--- trunk/piklab_kde4/src/tools/jalv2/jalv2_generator.h (rev 0)
+++ trunk/piklab_kde4/src/tools/jalv2/jalv2_generator.h 2012-07-04 07:02:24 UTC (rev 2928)
@@ -0,0 +1,27 @@
+/***************************************************************************
+ * Copyright (C) 2012 Nicolas Hadacek <ha...@kd...> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ ***************************************************************************/
+#ifndef JALV2_GENERATOR_H
+#define JALV2_GENERATOR_H
+
+#include "tools/base/tool_group.h"
+
+namespace JALV2
+{
+
+class SourceGenerator : public Tool::SourceGenerator
+{
+public:
+ virtual SourceLine::List configLines(PURL::ToolType type, const Device::Memory &memory, bool &ok) const;
+ virtual SourceLine::List sourceFileContent(PURL::ToolType type, const Device::Data &data, bool &ok) const;
+ virtual SourceLine::List includeLines(PURL::ToolType type, const Device::Data &data) const;
+};
+
+} // namespace
+
+#endif
Modified: trunk/piklab_kde4/src/tools/list/compile_process.cpp
===================================================================
--- trunk/piklab_kde4/src/tools/list/compile_process.cpp 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/src/tools/list/compile_process.cpp 2012-07-04 07:02:24 UTC (rev 2928)
@@ -209,7 +209,8 @@
_stderr = QString::null;
delete _process;
_process = new ::Process::LineSignal;
- connect(_process, SIGNAL(done(int)), SLOT(done(int)));
+ connect(_process, SIGNAL(done()), SLOT(done()));
+ connect(_process, SIGNAL(error()), SLOT(error()));
connect(_process, SIGNAL(timeout()), SLOT(timeout()));
connect(_process, SIGNAL(logLine(::Process::OutputType, const QString &)),
SLOT(logLine(::Process::OutputType, const QString &)));
@@ -219,15 +220,26 @@
return _process->start();
}
-void Compile::BaseProcess::done(int code)
+void Compile::BaseProcess::error()
{
+ _manager->log(Log::LineType::Error, i18n("*** Error executing command ***"));
+ _manager->processFailed();
+}
+
+void Compile::BaseProcess::done()
+{
+ int code = _process->exitCode();
if ( code!=0 ) {
_manager->log(Log::LineType::Error, i18n("*** Exited with status: %1 ***").arg(code));
_manager->processFailed();
- } else if ( _manager->hasError() ) {
+ return;
+ }
+ if ( _manager->hasError() ) {
_manager->log(Log::LineType::Error, i18n("*** Error ***"));
_manager->processFailed();
- } else _manager->processDone();
+ return;
+ }
+ _manager->processDone();
}
void Compile::BaseProcess::timeout()
Modified: trunk/piklab_kde4/src/tools/list/compile_process.h
===================================================================
--- trunk/piklab_kde4/src/tools/list/compile_process.h 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/src/tools/list/compile_process.h 2012-07-04 07:02:24 UTC (rev 2928)
@@ -72,11 +72,7 @@
class ParseErrorData {
public:
- ParseErrorData(const QString &p, int iFile, int iLine, int iMessage, Log::LineType dLineType)
- : pattern(p), indexFile(iFile), indexLine(iLine), indexMessage(iMessage), indexLogType(-1),
- defaultLineType(dLineType) {}
- ParseErrorData(const QString &p, int iFile, int iLine, int iMessage, uint iLogType,
- Log::LineType dLineType = Log::LineType::Error)
+ ParseErrorData(const QString &p, int iFile, int iLine, int iMessage, uint iLogType, Log::LineType dLineType)
: pattern(p), indexFile(iFile), indexLine(iLine), indexMessage(iMessage), indexLogType(iLogType),
defaultLineType(dLineType) {}
QString pattern;
@@ -189,7 +185,8 @@
protected slots:
virtual void logLine(::Process::OutputType type, const QString &line) = 0;
- virtual void done(int code);
+ virtual void done();
+ void error();
void timeout();
};
Modified: trunk/piklab_kde4/src/tools/mpc/mpc_compile.cpp
===================================================================
--- trunk/piklab_kde4/src/tools/mpc/mpc_compile.cpp 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/src/tools/mpc/mpc_compile.cpp 2012-07-04 07:02:24 UTC (rev 2928)
@@ -28,11 +28,11 @@
void MPC::CompileFile::parseLine(const QString &line)
{
- if ( parseErrorLine(line, Compile::ParseErrorData("(\\w+)\\s+(.*)\\s+(\\d+):\\d+:(.*)", 2, 3, 4, 1)) ) return;
+ if ( parseErrorLine(line, Compile::ParseErrorData("(\\w+)\\s+(.*)\\s+(\\d+):\\d+:(.*)", 2, 3, 4, 1, Log::LineType::Error)) ) return;
doLog(Log::LineType::Normal, line, QString::null, 0); // unrecognized
}
-void MPC::CompileFile::done(int code)
+void MPC::CompileFile::done()
{
// rely on error file
PURL::Url url = PURL::Url(directory(), inputFilepath(0)).toExtension("err");
@@ -43,7 +43,7 @@
QStringList lines = file.readLines();
for (int i=0; i<lines.count(); i++) parseLine(lines[i]);
}
- Compile::Process::done(code);
+ Compile::Process::done();
}
QString MPC::CompileFile::outputFiles() const
Modified: trunk/piklab_kde4/src/tools/mpc/mpc_compile.h
===================================================================
--- trunk/piklab_kde4/src/tools/mpc/mpc_compile.h 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/src/tools/mpc/mpc_compile.h 2012-07-04 07:02:24 UTC (rev 2928)
@@ -24,7 +24,7 @@
virtual QString outputFiles() const;
protected slots:
- virtual void done(int code);
+ virtual void done();
private:
void parseLine(const QString &line);
Modified: trunk/piklab_kde4/src/tools/sdcc/sdcc_compile.cpp
===================================================================
--- trunk/piklab_kde4/src/tools/sdcc/sdcc_compile.cpp 2012-07-02 00:58:48 UTC (rev 2927)
+++ trunk/piklab_kde4/src/tools/sdcc/sdcc_compile.cpp 2012-07-04 07:02:24 UTC (rev 2928)
@@ -43,13 +43,13 @@
void SDCC::Process::logLine(::Process::OutputType, const QString &line)
{
- if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*):([0-9]+):( syntax error):(.+)", 1, 2, 4, -1)) ) return;
- if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*):([0-9]+):( error)(.+)", 1, 2, 4, -1)) ) return;
- if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*):([0-9]+):(error|warning|message):(.+)", 1, 2, 4, 3)) ) return;
- if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*):([0-9]+):(\\w+)\\s*\\[[0-9]+\\](.+)", 1, 2, 4, 3)) ) return;
+ if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*):([0-9]+):( syntax error):(.+)", 1, 2, 4, -1, Log::LineType::Error)) ) return;
+ if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*):([0-9]+):( error)(.+)", 1, 2, 4, -1, Log::LineType::Error)) ) return;
+ if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*):([0-9]+):(error|warning|message):(.+)", 1, 2, 4, 3, Log::LineType::Error)) ) return;
+ if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*):([0-9]+):(\\w+)\\s*\\[[0-9]+\\](.+)", 1, 2, 4, 3, Log::LineType::Error)) ) return;
if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*)\\s*[0-9]+:(.+)", -1, -1, 2, 1, Log::LineType::Warning)) ) return;
- if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*):([0-9]+):(.+)", 1, 2, 3, Log::LineType::Warning)) ) return;
- if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*):([^:]+):([0-9]+):(.+)", 2, 3, 4, Log::LineType::Warning)) ) return;
+ if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*):([0-9]+):(.+)", 1, 2, 3, -1, Log::LineType::Warning)) ) return;
+ if ( parseErrorLine(line, Compile::ParseErrorData("([^:]*):([^:]+):([0-9]+):(.+)", 2, 3, 4, -1, Log::LineType::Warning)) ) return;
if ( parseErrorLine(line, Compile::ParseErrorData("([^:]+):(.+)", -1, -1, 2, 1, Log::LineType::Warning)) ) return;
doLog(filterType(line), line, QString::null, 0);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|