summaryrefslogtreecommitdiffstats
path: root/src/logger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/logger.cpp')
-rwxr-xr-xsrc/logger.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/logger.cpp b/src/logger.cpp
index 7b19fff..27438b7 100755
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -17,15 +17,15 @@ LoggerItem::~LoggerItem()
Logger::Logger()
{
- QValueList<LoggerItem*>::Iterator item = processes.append( new LoggerItem() );
+ TQValueList<LoggerItem*>::Iterator item = processes.append( new LoggerItem() );
(*item)->filename = "soundKonverter";
(*item)->id = 1000;
(*item)->completed = true;
(*item)->state = 1;
- (*item)->file.setName( locateLocal("data",QString("soundkonverter/log/%1.log").arg((*item)->id)) );
+ (*item)->file.setName( locateLocal("data",TQString("soundkonverter/log/%1.log").tqarg((*item)->id)) );
// TODO error handling
(*item)->file.open( IO_WriteOnly );
- (*item)->textStream.setDevice( &((*item)->file) );
+ (*item)->textStream.setDevice( TQT_TQIODEVICE(&((*item)->file)) );
srand( (unsigned)time(NULL) );
}
@@ -34,7 +34,7 @@ Logger::~Logger()
void Logger::cleanUp()
{
- for( QValueList<LoggerItem*>::Iterator it = processes.begin(); it != processes.end(); ++it ) {
+ for( TQValueList<LoggerItem*>::Iterator it = processes.begin(); it != processes.end(); ++it ) {
if( (*it)->id != 1000 ) {
emit removedProcess( (*it)->id );
(*it)->file.close();
@@ -45,26 +45,26 @@ void Logger::cleanUp()
processes.clear();
}
-int Logger::registerProcess( const QString& filename )
+int Logger::registerProcess( const TQString& filename )
{
// NOTE ok, it works now, but why prepend() and not append()?
- QValueList<LoggerItem*>::Iterator item = processes.append( new LoggerItem() );
+ TQValueList<LoggerItem*>::Iterator item = processes.append( new LoggerItem() );
(*item)->filename = filename;
(*item)->id = getNewID();
(*item)->completed = false;
- (*item)->file.setName( locateLocal("data",QString("soundkonverter/log/%1.log").arg((*item)->id)) );
+ (*item)->file.setName( locateLocal("data",TQString("soundkonverter/log/%1.log").tqarg((*item)->id)) );
// TODO error handling
(*item)->file.open( IO_WriteOnly );
- (*item)->textStream.setDevice( &((*item)->file) );
+ (*item)->textStream.setDevice( TQT_TQIODEVICE(&((*item)->file)) );
emit updateProcess( (*item)->id );
return (*item)->id;
}
-void Logger::log( int id, const QString& data )
+void Logger::log( int id, const TQString& data )
{
- for( QValueList<LoggerItem*>::Iterator it = processes.begin(); it != processes.end(); ++it ) {
+ for( TQValueList<LoggerItem*>::Iterator it = processes.begin(); it != processes.end(); ++it ) {
if( (*it)->id == id ) {
(*it)->data.append( data );
if( (*it)->data.count() > 100000 ) (*it)->data.erase( (*it)->data.at(0) );
@@ -86,7 +86,7 @@ int Logger::getNewID()
id = rand();
ok = true;
- for( QValueList<LoggerItem*>::Iterator it = processes.begin(); it != processes.end(); ++it ) {
+ for( TQValueList<LoggerItem*>::Iterator it = processes.begin(); it != processes.end(); ++it ) {
if( (*it)->id == id ) ok = false;
}
@@ -97,18 +97,18 @@ int Logger::getNewID()
LoggerItem* Logger::getLog( int id )
{
- for( QValueList<LoggerItem*>::Iterator it = processes.begin(); it != processes.end(); ++it ) {
+ for( TQValueList<LoggerItem*>::Iterator it = processes.begin(); it != processes.end(); ++it ) {
if( (*it)->id == id ) return *it;
}
return 0;
}
-QValueList<LoggerItem*> Logger::getLogs()
+TQValueList<LoggerItem*> Logger::getLogs()
{
-/* QValueList<LoggerItem*> items;
+/* TQValueList<LoggerItem*> items;
- for( QValueList<LoggerItem*>::Iterator it = processes.begin(); it != processes.end(); ++it ) {
+ for( TQValueList<LoggerItem*>::Iterator it = processes.begin(); it != processes.end(); ++it ) {
if( (*it)->completed ) items.append( *it );
}
@@ -119,10 +119,10 @@ QValueList<LoggerItem*> Logger::getLogs()
void Logger::processCompleted( int id, int state )
{
LoggerItem* item = 0;
- QTime time = QTime::currentTime();
+ TQTime time = TQTime::currentTime();
bool remove = false;
- for( QValueList<LoggerItem*>::Iterator it = processes.begin(); it != processes.end(); ++it ) {
+ for( TQValueList<LoggerItem*>::Iterator it = processes.begin(); it != processes.end(); ++it ) {
// TODO test
if( time >= (*it)->time && (*it)->completed && (*it)->state == 0 ) {
time = (*it)->time;