From 0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 30 Jun 2011 00:15:53 +0000 Subject: TQt4 port piklab This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1238822 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/piklab-test/base/device_test.cpp | 2 +- src/piklab-test/base/device_test.h | 2 +- src/piklab-test/base/generator_check.cpp | 54 ++++++++++++++++---------------- src/piklab-test/base/generator_check.h | 6 ++-- src/piklab-test/base/main_test.cpp | 2 +- src/piklab-test/base/main_test.h | 4 +-- 6 files changed, 35 insertions(+), 35 deletions(-) (limited to 'src/piklab-test/base') diff --git a/src/piklab-test/base/device_test.cpp b/src/piklab-test/base/device_test.cpp index 9346a13..07a5fdd 100644 --- a/src/piklab-test/base/device_test.cpp +++ b/src/piklab-test/base/device_test.cpp @@ -14,7 +14,7 @@ void DeviceTest::checkArguments() { if ( _args->count()==1 ) { - _device = QString(_args->arg(0)).upper(); + _device = TQString(_args->arg(0)).upper(); if ( !Device::lister().isSupported(_device) ) qFatal("Specified device \"%s\" not supported.", _device.latin1()); printf("Testing only %s\n", _device.latin1()); } diff --git a/src/piklab-test/base/device_test.h b/src/piklab-test/base/device_test.h index 24447ed..cd96edc 100644 --- a/src/piklab-test/base/device_test.h +++ b/src/piklab-test/base/device_test.h @@ -26,7 +26,7 @@ protected: virtual void checkArguments(); private: - QString _device; + TQString _device; }; #endif diff --git a/src/piklab-test/base/generator_check.cpp b/src/piklab-test/base/generator_check.cpp index 68ad2c5..5819188 100644 --- a/src/piklab-test/base/generator_check.cpp +++ b/src/piklab-test/base/generator_check.cpp @@ -92,21 +92,21 @@ bool GeneratorCheck::execute(const Device::Data &data) // run compiler Process::State state = Process::runSynchronously(*_helper->_cprocess, Process::Start, 2000); // 2s timeout if ( state!=Process::Exited ) TEST_FAILED_RETURN("Error while running compilation") - if ( _helper->_cprocess->exitCode()!=0 ) TEST_FAILED_RETURN(QString("Error in compilation for %1:\n%2%3").arg(data.name()).arg(_helper->_cprocess->sout()+_helper->_cprocess->serr()).arg(QString::null)) + if ( _helper->_cprocess->exitCode()!=0 ) TEST_FAILED_RETURN(TQString("Error in compilation for %1:\n%2%3").tqarg(data.name()).tqarg(_helper->_cprocess->sout()+_helper->_cprocess->serr()).tqarg(TQString())) // run linker if (_helper->_lprocess) { state = Process::runSynchronously(*_helper->_lprocess, Process::Start, 2000); // 2s timeout if ( state!=Process::Exited ) TEST_FAILED_RETURN("Error while running linking") - if ( _helper->_lprocess->exitCode()!=0 ) TEST_FAILED_RETURN(QString("Error in linking for %1:\n%2%3").arg(data.name()).arg(_helper->_lprocess->sout()+_helper->_lprocess->serr()).arg(QString::null)) + if ( _helper->_lprocess->exitCode()!=0 ) TEST_FAILED_RETURN(TQString("Error in linking for %1:\n%2%3").tqarg(data.name()).tqarg(_helper->_lprocess->sout()+_helper->_lprocess->serr()).tqarg(TQString())) } // load hex file if ( !_fhex->openForRead() ) TEST_FAILED_RETURN("") - QStringList errors, warnings; + TQStringList errors, warnings; Device::Memory::WarningTypes warningTypes; - if ( !_memory1->load(_fhex->stream(), errors, warningTypes, warnings) ) TEST_FAILED_RETURN(QString("Error loading hex into memory: %1").arg(errors.join(" "))) - //if ( warningTypes!=Device::Memory::NoWarning ) TEST_FAILED(QString("Warning loading hex into memory: %1").arg(warnings.join(" "))) + if ( !_memory1->load(_fhex->stream(), errors, warningTypes, warnings) ) TEST_FAILED_RETURN(TQString("Error loading hex into memory: %1").tqarg(errors.join(" "))) + //if ( warningTypes!=Device::Memory::NoWarning ) TEST_FAILED(TQString("Warning loading hex into memory: %1").tqarg(warnings.join(" "))) TEST_PASSED return true; @@ -129,11 +129,11 @@ bool ConfigGeneratorCheck::execute(const Device::Data &data) bool ok = false; for (uint i=0; isetConfigValue(cmask.name, cmask.values[l].name); + if ( !ctqmask.values[l].name.isEmpty() ) _memory2->setConfigValue(ctqmask.name, ctqmask.values[l].name); } } } @@ -157,23 +157,23 @@ bool ConfigGeneratorCheck::execute(const Device::Data &data) BitValue word1 = _memory1->word(Pic::MemoryRangeType::Config, i); BitValue word2 = _memory2->word(Pic::MemoryRangeType::Config, i); if ( word1==word2 ) continue; - for (uint k=0; kgenerator()->templateSourceFile(ttype, data, ok); _source = SourceLine::text(sfamily, lines, 2); - if (!ok) TEST_FAILED_RETURN(QString("Incomplete template generator for %1").arg(data.name())) + if (!ok) TEST_FAILED_RETURN(TQString("Incomplete template generator for %1").tqarg(data.name())) return true; } @@ -211,7 +211,7 @@ GPUtilsGeneratorCheckHelper::GPUtilsGeneratorCheckHelper() void GPUtilsGeneratorCheckHelper::initSupported() { Process::StringOutput p; - QStringList options; + TQStringList options; options += "-l"; p.setup("gpasm", options, false); Process::runSynchronously(p, Process::Start, 2000); // 2s timeout @@ -221,7 +221,7 @@ void GPUtilsGeneratorCheckHelper::initSupported() bool GPUtilsGeneratorCheckHelper::init(const Device::Data &data) { _cprocess = new Process::StringOutput; - QStringList options; + TQStringList options; options = "-c"; options += "-p" + GPUtils::toDeviceName(data.name()); options += "test.asm"; @@ -257,8 +257,8 @@ void SDCCGeneratorCheckHelper::initSupported() _supported.clear(); for (uint i=0; i _supported; + TQValueList _supported; Process::StringOutput *_cprocess, *_lprocess; Tool::SourceGenerator *_generator; @@ -54,7 +54,7 @@ protected: CLI::View *_view; PURL::File *_fdest, *_fhex; Pic::Memory *_memory1; - QString _source; + TQString _source; }; //---------------------------------------------------------------------------- diff --git a/src/piklab-test/base/main_test.cpp b/src/piklab-test/base/main_test.cpp index 10d0414..bfacdf8 100644 --- a/src/piklab-test/base/main_test.cpp +++ b/src/piklab-test/base/main_test.cpp @@ -23,7 +23,7 @@ void Test::runTest() printf("RESULTS: %i PASSED / %i FAILED / %i SKIPPED \n", _nbPassed, _nbFailed, _nbSkipped); } -void Test::failed(const QString &message, const char *file, int line) +void Test::failed(const TQString &message, const char *file, int line) { _nbFailed++; printf("\n"); diff --git a/src/piklab-test/base/main_test.h b/src/piklab-test/base/main_test.h index 601b779..4006bd9 100644 --- a/src/piklab-test/base/main_test.h +++ b/src/piklab-test/base/main_test.h @@ -36,10 +36,10 @@ public: protected: KCmdLineArgs *_args; - QString _message; + TQString _message; void passed() { _nbPassed++; } - void failed(const QString &message, const char *file, int line); + void failed(const TQString &message, const char *file, int line); void skipped() { _nbSkipped++; } virtual bool execute() = 0; // returns false if failed or skipped virtual void checkArguments() {} -- cgit v1.2.1