summaryrefslogtreecommitdiffstats
path: root/src/tools/list/compile_process.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/list/compile_process.cpp')
-rw-r--r--src/tools/list/compile_process.cpp126
1 files changed, 63 insertions, 63 deletions
diff --git a/src/tools/list/compile_process.cpp b/src/tools/list/compile_process.cpp
index 4f251bc..4d24e88 100644
--- a/src/tools/list/compile_process.cpp
+++ b/src/tools/list/compile_process.cpp
@@ -9,8 +9,8 @@
***************************************************************************/
#include "compile_process.h"
-#include <qtimer.h>
-#include <qregexp.h>
+#include <tqtimer.h>
+#include <tqregexp.h>
#include "devices/list/device_list.h"
#include "common/global/process.h"
@@ -67,10 +67,10 @@ void Compile::FileData::List::cleanGenerated() const
}
//-----------------------------------------------------------------------------
-Compile::LogWidget::LogWidget(QWidget *parent)
- : Log::Widget(parent, "compile_log")
+Compile::LogWidget::LogWidget(TQWidget *tqparent)
+ : Log::Widget(tqparent, "compile_log")
{
- connect(this, SIGNAL(clicked(int, int)), SLOT(lineClicked(int)));
+ connect(this, TQT_SIGNAL(clicked(int, int)), TQT_SLOT(lineClicked(int)));
}
void Compile::LogWidget::clear()
@@ -79,13 +79,13 @@ void Compile::LogWidget::clear()
_map.clear();
}
-void Compile::LogWidget::appendLine(Log::LineType type, const QString &message, const QString &filepath, uint line)
+void Compile::LogWidget::appendLine(Log::LineType type, const TQString &message, const TQString &filepath, uint line)
{
log(type, message, Log::Delayed);
if ( !filepath.isEmpty() ) _map[paragraphs()-1] = Data(filepath, line);
}
-void Compile::LogWidget::appendLine(Log::DebugLevel level, const QString &message, const QString &filepath, uint line)
+void Compile::LogWidget::appendLine(Log::DebugLevel level, const TQString &message, const TQString &filepath, uint line)
{
log(level, message, Log::Delayed);
if ( !filepath.isEmpty() ) _map[paragraphs()-1] = Data(filepath, line);
@@ -93,16 +93,16 @@ void Compile::LogWidget::appendLine(Log::DebugLevel level, const QString &messag
void Compile::LogWidget::lineClicked(int line)
{
- if ( !_map.contains(line) ) return;
+ if ( !_map.tqcontains(line) ) return;
PURL::Url url = PURL::Url::fromPathOrUrl(_map[line].filepath);
- TextEditor *e = ::qt_cast<TextEditor *>(Main::editorManager().openEditor(url));
+ TextEditor *e = ::tqqt_cast<TextEditor *>(Main::editorManager().openEditor(url));
if ( e==0 ) return;
e->setCursor(_map[line].line, 0);
}
//-----------------------------------------------------------------------------
Compile::BaseProcess::BaseProcess()
- : QObject(0, "compile_process"), _manager(0), _process(0)
+ : TQObject(0, "compile_process"), _manager(0), _process(0)
{}
void Compile::BaseProcess::init(const Data &data, Manager *manager)
@@ -120,14 +120,14 @@ PURL::Directory Compile::BaseProcess::directory(uint i) const
bool Compile::BaseProcess::start()
{
- _stdout = QString::null;
- _stderr = QString::null;
+ _stdout = TQString();
+ _stderr = TQString();
delete _process;
_process = new ::Process::LineSignal;
- connect(_process, SIGNAL(done(int)), SLOT(done(int)));
- connect(_process, SIGNAL(timeout()), SLOT(timeout()));
- connect(_process, SIGNAL(logStdoutLine(const QString &)), SLOT(logStdoutLine(const QString &)));
- connect(_process, SIGNAL(logStderrLine(const QString &)), SLOT(logStderrLine(const QString &)));
+ connect(_process, TQT_SIGNAL(done(int)), TQT_SLOT(done(int)));
+ connect(_process, TQT_SIGNAL(timeout()), TQT_SLOT(timeout()));
+ connect(_process, TQT_SIGNAL(logStdoutLine(const TQString &)), TQT_SLOT(logStdoutLine(const TQString &)));
+ connect(_process, TQT_SIGNAL(logStderrLine(const TQString &)), TQT_SLOT(logStderrLine(const TQString &)));
_process->setWorkingDirectory(directory().path());
setupProcess();
_manager->log(Log::LineType::Command, _process->arguments().join(" "));
@@ -137,7 +137,7 @@ bool Compile::BaseProcess::start()
void Compile::BaseProcess::done(int code)
{
if ( code!=0 ) {
- _manager->log(Log::LineType::Error, i18n("*** Exited with status: %1 ***").arg(code));
+ _manager->log(Log::LineType::Error, i18n("*** Exited with status: %1 ***").tqarg(code));
_manager->processFailed();
} else if ( _manager->hasError() ) {
_manager->log(Log::LineType::Error, i18n("*** Error ***"));
@@ -183,12 +183,12 @@ PURL::Url Compile::Process::url(PURL::FileType type, uint i) const
return url.toFileType(type);
}
-QString Compile::Process::filepath(PURL::FileType type, uint i) const
+TQString Compile::Process::filepath(PURL::FileType type, uint i) const
{
return url(type, i).relativeTo(directory(), Compile::Config::withWine(group()) ? PURL::WindowsSeparator : PURL::UnixSeparator);
}
-QString Compile::Process::outputFilepath() const
+TQString Compile::Process::outputFilepath() const
{
if ( _data.category==Tool::Category::Librarian ) return filepath(PURL::Library);
return filepath(PURL::Hex);
@@ -203,8 +203,8 @@ Compile::FileData::List Compile::Process::files(bool *ok) const
{
if (ok) *ok = true;
FileData::List list;
- QRegExp rexp("PURL::(.*)");
- QStringList files = QStringList::split(" ", outputFiles());
+ TQRegExp rexp("PURL::(.*)");
+ TQStringList files = TQStringList::split(" ", outputFiles());
for (uint i=0; i<files.count(); i++) {
if ( rexp.exactMatch(files[i]) ) {
PURL::FileType type = PURL::FileType::fromKey(rexp.cap(1));
@@ -228,31 +228,31 @@ Compile::FileData::List Compile::Process::files(bool *ok) const
return list;
}
-bool Compile::Process::checkIs(const QString &s, const QString &key)
+bool Compile::Process::checkIs(const TQString &s, const TQString &key)
{
- if ( !s.contains(key) ) return false;
+ if ( !s.tqcontains(key) ) return false;
if ( s!=key ) qWarning("Argument should be only %s, the rest will be ignored...", key.latin1());
return true;
}
-QString Compile::Process::replaceIf(const QString &s, const QString &key, bool condition)
+TQString Compile::Process::replaceIf(const TQString &s, const TQString &key, bool condition)
{
- QRegExp rexp("(.*)\\$" + key + "\\(([^)]*)\\)(.*)");
+ TQRegExp rexp("(.*)\\$" + key + "\\(([^)]*)\\)(.*)");
if ( !rexp.exactMatch(s) ) return s;
- return rexp.cap(1) + (condition ? rexp.cap(2) : QString::null) + rexp.cap(3);
+ return rexp.cap(1) + (condition ? rexp.cap(2) : TQString()) + rexp.cap(3);
}
-QStringList Compile::Process::arguments() const
+TQStringList Compile::Process::arguments() const
{
bool custom = _config->hasCustomArguments(_data.category);
bool withWine = Compile::Config::withWine(group());
- QStringList args = (custom ? _config->customArguments(_data.category) : genericArguments(*_config));
+ TQStringList args = (custom ? _config->customArguments(_data.category) : genericArguments(*_config));
PURL::Url lkr = Main::toolGroup().linkerScript(_data.project, _data.linkType);
- QStringList nargs;
+ TQStringList nargs;
for (uint i=0; i<args.count(); i++) {
- if ( args[i].contains("$(SRCPATH)") ) {
- args[i].replace("$(SRCPATH)", directory().path());
- args[i].replace("//", "/");
+ if ( args[i].tqcontains("$(SRCPATH)") ) {
+ args[i].tqreplace("$(SRCPATH)", directory().path());
+ args[i].tqreplace("//", "/");
}
args[i] = replaceIf(args[i], "WINE", withWine);
args[i] = replaceIf(args[i], "LKR", hasLinkerScript());
@@ -267,22 +267,22 @@ QStringList Compile::Process::arguments() const
continue;
}
if ( checkIs(args[i], "%LIBS") ) {
- if (_data.project) nargs += _data.project->librariesForLinker(QString::null, withWine);
+ if (_data.project) nargs += _data.project->librariesForLinker(TQString(), withWine);
continue;
}
- args[i].replace("%OBJECT", filepath(PURL::Object)); // before %O
- args[i].replace("%O", outputFilepath());
- args[i].replace("%COFF", filepath(PURL::Coff));
- if (_data.project) args[i].replace("%PROJECT", _data.project->name());
- else args[i].replace("%PROJECT", url().basename());
- args[i].replace("%MAP", filepath(PURL::Map));
- args[i].replace("%SYM", url().toExtension("sym").relativeTo(directory(), withWine ? PURL::WindowsSeparator : PURL::UnixSeparator));
- args[i].replace("%LIST", filepath(PURL::Lst));
- args[i].replace("%DEVICE", deviceName());
- args[i].replace("%FAMILY", familyName());
- args[i].replace("%LKR_PATH", lkr.path()); // before %LKR
- args[i].replace("%LKR_NAME", lkr.filename()); // before LKR
- args[i].replace("%LKR", lkr.filepath());
+ args[i].tqreplace("%OBJECT", filepath(PURL::Object)); // before %O
+ args[i].tqreplace("%O", outputFilepath());
+ args[i].tqreplace("%COFF", filepath(PURL::Coff));
+ if (_data.project) args[i].tqreplace("%PROJECT", _data.project->name());
+ else args[i].tqreplace("%PROJECT", url().basename());
+ args[i].tqreplace("%MAP", filepath(PURL::Map));
+ args[i].tqreplace("%SYM", url().toExtension("sym").relativeTo(directory(), withWine ? PURL::WindowsSeparator : PURL::UnixSeparator));
+ args[i].tqreplace("%LIST", filepath(PURL::Lst));
+ args[i].tqreplace("%DEVICE", deviceName());
+ args[i].tqreplace("%FAMILY", familyName());
+ args[i].tqreplace("%LKR_PATH", lkr.path()); // before %LKR
+ args[i].tqreplace("%LKR_NAME", lkr.filename()); // before LKR
+ args[i].tqreplace("%LKR", lkr.filepath());
if ( checkIs(args[i], "%I") ) {
for (uint k=0; k<nbFiles(); k++) nargs += inputFilepath(k);
continue;
@@ -290,46 +290,46 @@ QStringList Compile::Process::arguments() const
if ( !args[i].isEmpty() ) nargs += args[i];
}
args.clear();
- for (uint i=0; i<nargs.count(); i++) args += QStringList::split("%SEP", nargs[i]);
+ for (uint i=0; i<nargs.count(); i++) args += TQStringList::split("%SEP", nargs[i]);
return args;
}
void Compile::Process::setupProcess()
{
bool withWine = Compile::Config::withWine(group());
- QString exec = tool()->baseExecutable(withWine, Compile::Config::outputExecutableType(group()));
- QString path = tool()->executableDirectory().path();
+ TQString exec = tool()->baseExecutable(withWine, Compile::Config::outputExecutableType(group()));
+ TQString path = tool()->executableDirectory().path();
_process->setup(path + exec, arguments(), withWine);
}
-Log::LineType Compile::Process::filterType(const QString &type) const
+Log::LineType Compile::Process::filterType(const TQString &type) const
{
- QString s = type.lower();
+ TQString s = type.lower();
if ( s.startsWith("warning") ) return Log::LineType::Warning;
if ( s.startsWith("error") ) return Log::LineType::Error;
if ( s.startsWith("message") ) return Log::LineType::Information;
return Log::LineType::Normal;
}
-bool Compile::Process::parseErrorLine(const QString &s, const ParseErrorData &data)
+bool Compile::Process::parseErrorLine(const TQString &s, const ParseErrorData &data)
{
- QRegExp re(data.pattern);
+ TQRegExp re(data.pattern);
if ( !re.exactMatch(s) ) return false;
- QString file;
+ TQString file;
if ( data.indexFile>=0 ) {
file = re.cap(data.indexFile).stripWhiteSpace();
if ( file.endsWith(".") ) file = file.mid(0, file.length()-1);
- if ( file=="-" ) file = QString::null;
+ if ( file=="-" ) file = TQString();
}
bool ok;
int line = -1;
if ( data.indexLine>=0 ) line = re.cap(data.indexLine).stripWhiteSpace().toUInt(&ok) - 1;
if ( !ok ) line = -1;
- QString message;
+ TQString message;
if ( data.indexMessage>=0 ) message= re.cap(data.indexMessage).stripWhiteSpace();
Log::LineType type = data.defaultLineType;
if ( data.indexLogType>=0 ) {
- QString s = re.cap(data.indexLogType).stripWhiteSpace();
+ TQString s = re.cap(data.indexLogType).stripWhiteSpace();
if ( s.isEmpty() ) type = data.defaultLineType;
else type = filterType(s);
}
@@ -337,22 +337,22 @@ bool Compile::Process::parseErrorLine(const QString &s, const ParseErrorData &da
return true;
}
-void Compile::Process::doLog(const QString &type, const QString &message, const QString &surl, uint line)
+void Compile::Process::doLog(const TQString &type, const TQString &message, const TQString &surl, uint line)
{
doLog(filterType(type), message, surl, line);
}
-void Compile::Process::doLog(Log::LineType type, const QString &message, const QString &surl, uint line)
+void Compile::Process::doLog(Log::LineType type, const TQString &message, const TQString &surl, uint line)
{
if ( surl.isEmpty() ) {
_manager->log(type, message);
return;
}
PURL::Url url = PURL::Url::fromPathOrUrl(surl);
- QString s;
+ TQString s;
if ( !url.isEmpty() ) {
if ( !url.exists() && !url.isInto(directory()) ) url = PURL::Url(directory(), surl);
- s += url.filename() + ":" + QString::number(line+1) + ": ";
+ s += url.filename() + ":" + TQString::number(line+1) + ": ";
}
switch (type.type()) {
case Log::LineType::Warning: s += i18n("warning: "); break;
@@ -367,10 +367,10 @@ void Compile::Process::doLog(Log::LineType type, const QString &message, const Q
void Compile::CustomProcess::setupProcess()
{
_process->setUseShell(true);
- _process->setup(_command, QStringList(), false);
+ _process->setup(_command, TQStringList(), false);
}
-void Compile::CustomProcess::logStderrLine(const QString &line)
+void Compile::CustomProcess::logStderrLine(const TQString &line)
{
_manager->log(Log::LineType::Normal, line);
}