summaryrefslogtreecommitdiffstats
path: root/src/fileexportertoolchain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fileexportertoolchain.cpp')
-rw-r--r--src/fileexportertoolchain.cpp90
1 files changed, 45 insertions, 45 deletions
diff --git a/src/fileexportertoolchain.cpp b/src/fileexportertoolchain.cpp
index 8e51431..0883e60 100644
--- a/src/fileexportertoolchain.cpp
+++ b/src/fileexportertoolchain.cpp
@@ -18,10 +18,10 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#include <qprocess.h>
-#include <qwaitcondition.h>
-#include <qapplication.h>
-#include <qstringlist.h>
+#include <ntqprocess.h>
+#include <ntqwaitcondition.h>
+#include <ntqapplication.h>
+#include <ntqstringlist.h>
#include "fileexportertoolchain.h"
@@ -31,7 +31,7 @@ namespace BibTeX
FileExporterToolchain::FileExporterToolchain()
: FileExporter(), m_errorLog( NULL )
{
- m_waitCond = new QWaitCondition();
+ m_waitCond = new TQWaitCondition();
workingDir = createTempDir();
}
@@ -41,29 +41,29 @@ namespace BibTeX
deleteTempDir( workingDir );
}
- bool FileExporterToolchain::runProcesses( const QStringList &progs, QStringList *errorLog )
+ bool FileExporterToolchain::runProcesses( const TQStringList &progs, TQStringList *errorLog )
{
bool result = TRUE;
int i = 0;
emit progress( 0, progs.size() );
- for ( QStringList::ConstIterator it = progs.begin(); result && it != progs.end(); it++ )
+ for ( TQStringList::ConstIterator it = progs.begin(); result && it != progs.end(); it++ )
{
- qApp->processEvents();
- QStringList args = QStringList::split( ' ', *it );
+ tqApp->processEvents();
+ TQStringList args = TQStringList::split( ' ', *it );
result &= runProcess( args, errorLog );
emit progress( i++, progs.size() );
}
- qApp->processEvents();
+ tqApp->processEvents();
return result;
}
- bool FileExporterToolchain::runProcess( const QStringList &args, QStringList *errorLog )
+ bool FileExporterToolchain::runProcess( const TQStringList &args, TQStringList *errorLog )
{
bool result = FALSE;
- QApplication::setOverrideCursor( Qt::waitCursor );
+ TQApplication::setOverrideCursor( TQt::waitCursor );
- m_process = new QProcess( args );
+ m_process = new TQProcess( args );
m_process->setWorkingDirectory( workingDir );
connect( m_process, SIGNAL( processExited() ), this, SLOT( slotProcessExited() ) );
connect( m_process, SIGNAL( readyReadStdout() ), this, SLOT( slotReadProcessOutput() ) );
@@ -73,11 +73,11 @@ namespace BibTeX
{
m_errorLog = errorLog;
int counter = 0;
- qApp->processEvents();
+ tqApp->processEvents();
while ( m_process->isRunning() )
{
m_waitCond->wait( 250 );
- qApp->processEvents();
+ tqApp->processEvents();
counter++;
if ( counter > 400 )
@@ -86,10 +86,10 @@ namespace BibTeX
result = m_process->normalExit() && counter < 400;
if ( !result )
- errorLog->append( QString( "Process '%1' failed." ).arg( args.join( " " ) ) );
+ errorLog->append( TQString( "Process '%1' failed." ).arg( args.join( " " ) ) );
}
else
- errorLog->append( QString( "Process '%1' was not started." ).arg( args.join( " " ) ) );
+ errorLog->append( TQString( "Process '%1' was not started." ).arg( args.join( " " ) ) );
disconnect( m_process, SIGNAL( readyReadStdout() ), this, SLOT( slotReadProcessOutput() ) );
@@ -98,18 +98,18 @@ namespace BibTeX
delete( m_process );
m_process = NULL;
- QApplication::restoreOverrideCursor();
+ TQApplication::restoreOverrideCursor();
return result;
}
- bool FileExporterToolchain::writeFileToIODevice( const QString &filename, QIODevice *device )
+ bool FileExporterToolchain::writeFileToIODevice( const TQString &filename, TQIODevice *device )
{
- QFile file( filename );
+ TQFile file( filename );
if ( file.open( IO_ReadOnly ) )
{
bool result = TRUE;
- Q_ULONG buffersize = 0x10000;
- Q_LONG amount = 0;
+ TQ_ULONG buffersize = 0x10000;
+ TQ_LONG amount = 0;
char* buffer = new char[ buffersize ];
do
{
@@ -125,20 +125,20 @@ namespace BibTeX
return FALSE;
}
- QString FileExporterToolchain::createTempDir()
+ TQString FileExporterToolchain::createTempDir()
{
- QString result = QString::null;
- QFile *devrandom = new QFile( "/dev/random" );
+ TQString result = TQString::null;
+ TQFile *devrandom = new TQFile( "/dev/random" );
if ( devrandom->open( IO_ReadOnly ) )
{
- Q_UINT32 randomNumber;
+ TQ_UINT32 randomNumber;
if ( devrandom->readBlock(( char* ) & randomNumber, sizeof( randomNumber ) ) > 0 )
{
randomNumber |= 0x10000000;
- result = QString( "/tmp/bibtex-%1" ).arg( randomNumber, sizeof( randomNumber ) * 2, 16 );
- if ( !QDir().mkdir( result ) )
- result = QString::null;
+ result = TQString( "/tmp/bibtex-%1" ).arg( randomNumber, sizeof( randomNumber ) * 2, 16 );
+ if ( !TQDir().mkdir( result ) )
+ result = TQString::null;
}
devrandom->close();
}
@@ -148,20 +148,20 @@ namespace BibTeX
return result;
}
- void FileExporterToolchain::deleteTempDir( const QString& directory )
+ void FileExporterToolchain::deleteTempDir( const TQString& directory )
{
- QDir dir = QDir( directory );
- QStringList subDirs = dir.entryList( QDir::Dirs );
- for ( QStringList::Iterator it = subDirs.begin(); it != subDirs.end(); it++ )
+ TQDir dir = TQDir( directory );
+ TQStringList subDirs = dir.entryList( TQDir::Dirs );
+ for ( TQStringList::Iterator it = subDirs.begin(); it != subDirs.end(); it++ )
{
- if (( QString::compare( *it, "." ) != 0 ) && ( QString::compare( *it, ".." ) != 0 ) )
+ if (( TQString::compare( *it, "." ) != 0 ) && ( TQString::compare( *it, ".." ) != 0 ) )
deleteTempDir( *it );
}
- QStringList allEntries = dir.entryList( QDir::All );
- for ( QStringList::Iterator it = allEntries.begin(); it != allEntries.end(); it++ )
+ TQStringList allEntries = dir.entryList( TQDir::All );
+ for ( TQStringList::Iterator it = allEntries.begin(); it != allEntries.end(); it++ )
dir.remove( *it );
- QDir().rmdir( directory );
+ TQDir().rmdir( directory );
}
void FileExporterToolchain::slotProcessExited()
@@ -173,7 +173,7 @@ namespace BibTeX
{
if ( m_process != NULL )
{
- qDebug( "Canceling process" );
+ tqDebug( "Canceling process" );
m_process->tryTerminate();
m_process->kill();
m_waitCond->wakeAll();
@@ -186,35 +186,35 @@ namespace BibTeX
{
while ( m_process->canReadLineStdout() )
{
- QString line = m_process->readLineStdout();
+ TQString line = m_process->readLineStdout();
if ( m_errorLog != NULL )
m_errorLog->append( line );
}
while ( m_process->canReadLineStderr() )
{
- QString line = m_process->readLineStderr();
+ TQString line = m_process->readLineStderr();
if ( m_errorLog != NULL )
m_errorLog->append( line );
}
}
}
- bool FileExporterToolchain::kpsewhich( const QString& filename )
+ bool FileExporterToolchain::kpsewhich( const TQString& filename )
{
bool result = FALSE;
int counter = 0;
- QWaitCondition waitCond;
- QProcess kpsewhich;
+ TQWaitCondition waitCond;
+ TQProcess kpsewhich;
kpsewhich.addArgument( "kpsewhich" );
kpsewhich.addArgument( filename );
if ( kpsewhich.start() )
{
- qApp->processEvents();
+ tqApp->processEvents();
while ( kpsewhich.isRunning() )
{
waitCond.wait( 250 );
- qApp->processEvents();
+ tqApp->processEvents();
counter++;
if ( counter > 50 )