summaryrefslogtreecommitdiffstats
path: root/src/fileexporterbibutils.cpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2013-06-29 12:56:53 +0200
committerSlávek Banko <slavek.banko@axis.cz>2013-07-04 03:11:35 +0200
commit5f5e7c5455d52826b0bd50f64fcffb7695ce970d (patch)
treec8ee8792d3fb139365abbf70c2255f1e69d2aa34 /src/fileexporterbibutils.cpp
parent251c9a439759c830d34c70683d0fc9454d703010 (diff)
downloadkbibtex-5f5e7c5455d52826b0bd50f64fcffb7695ce970d.tar.gz
kbibtex-5f5e7c5455d52826b0bd50f64fcffb7695ce970d.zip
Initial TQt conversion
Diffstat (limited to 'src/fileexporterbibutils.cpp')
-rw-r--r--src/fileexporterbibutils.cpp76
1 files changed, 38 insertions, 38 deletions
diff --git a/src/fileexporterbibutils.cpp b/src/fileexporterbibutils.cpp
index 4de7aeb..c9bb51a 100644
--- a/src/fileexporterbibutils.cpp
+++ b/src/fileexporterbibutils.cpp
@@ -17,13 +17,13 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#include <qfile.h>
-#include <qdir.h>
-#include <qstringlist.h>
-#include <qapplication.h>
-#include <qbuffer.h>
-#include <qprocess.h>
-#include <qwaitcondition.h>
+#include <ntqfile.h>
+#include <ntqdir.h>
+#include <ntqstringlist.h>
+#include <ntqapplication.h>
+#include <ntqbuffer.h>
+#include <ntqprocess.h>
+#include <ntqwaitcondition.h>
#include <fileexporterbibtex.h>
#include "fileexporterbibutils.h"
@@ -35,7 +35,7 @@ namespace BibTeX
: FileExporter(), m_outputFormat( outputFormat ), m_bibTeXExporter( new FileExporterBibTeX() )
{
m_bibTeXExporter->setEncoding( "utf-8" );
- m_processBuffer = new QBuffer();
+ m_processBuffer = new TQBuffer();
}
FileExporterBibUtils::~FileExporterBibUtils()
@@ -44,10 +44,10 @@ namespace BibTeX
delete m_bibTeXExporter;
}
- bool FileExporterBibUtils::save( QIODevice* iodevice, const Element* element, QStringList* errorLog )
+ bool FileExporterBibUtils::save( TQIODevice* iodevice, const Element* element, TQStringList* errorLog )
{
m_cancelFlag = false;
- QBuffer bibBuffer;
+ TQBuffer bibBuffer;
if ( !toBuffer( element, &bibBuffer, errorLog ) )
return false;
if ( !bufferToXMLbuffer( &bibBuffer ) || m_cancelFlag )
@@ -55,11 +55,11 @@ namespace BibTeX
return !m_cancelFlag && xmlBufferToIOdevice( iodevice );
}
- bool FileExporterBibUtils::save( QIODevice* iodevice, const File* bibtexfile, QStringList* errorLog )
+ bool FileExporterBibUtils::save( TQIODevice* iodevice, const File* bibtexfile, TQStringList* errorLog )
{
emit progress( 0, 3 );
m_cancelFlag = false;
- QBuffer bibBuffer;
+ TQBuffer bibBuffer;
if ( !toBuffer( bibtexfile, &bibBuffer, errorLog ) )
return false;
emit progress( 1, 3 );
@@ -78,7 +78,7 @@ namespace BibTeX
m_cancelFlag = true;
}
- bool FileExporterBibUtils::toBuffer( const File *bibFile, QBuffer *buffer, QStringList* errorLog )
+ bool FileExporterBibUtils::toBuffer( const File *bibFile, TQBuffer *buffer, TQStringList* errorLog )
{
buffer->open( IO_WriteOnly );
bool result = m_bibTeXExporter->save( buffer, bibFile, errorLog );
@@ -86,7 +86,7 @@ namespace BibTeX
return result;
}
- bool FileExporterBibUtils::toBuffer( const Element *bibElement, QBuffer *buffer, QStringList* errorLog )
+ bool FileExporterBibUtils::toBuffer( const Element *bibElement, TQBuffer *buffer, TQStringList* errorLog )
{
buffer->open( IO_WriteOnly );
bool result = m_bibTeXExporter->save( buffer, bibElement, errorLog );
@@ -94,13 +94,13 @@ namespace BibTeX
return result;
}
- bool FileExporterBibUtils::bufferToXMLbuffer( QBuffer *bibBuffer )
+ bool FileExporterBibUtils::bufferToXMLbuffer( TQBuffer *bibBuffer )
{
- QWaitCondition wc;
+ TQWaitCondition wc;
m_processBuffer->open( IO_WriteOnly );
m_waiting = true;
- m_process = new QProcess( QStringList::split( ' ', "bib2xml -i utf8" ) );
+ m_process = new TQProcess( TQStringList::split( ' ', "bib2xml -i utf8" ) );
connect( m_process, SIGNAL( processExited() ), this, SLOT( wakeUp() ) );
connect( m_process, SIGNAL( readyReadStdout() ), this, SLOT( slotReadyStdout() ) );
connect( m_process, SIGNAL( readyReadStderr() ), this, SLOT( slotReadyStderr() ) );
@@ -110,7 +110,7 @@ namespace BibTeX
{
bibBuffer->open( IO_ReadOnly );
m_process->writeToStdin( bibBuffer->readAll() );
- qApp->processEvents();
+ tqApp->processEvents();
m_process->closeStdin();
bibBuffer->close();
@@ -118,7 +118,7 @@ namespace BibTeX
while ( m_waiting )
{
wc.wait( 250 );
- qApp->processEvents();
+ tqApp->processEvents();
--nothingHappens;
}
@@ -127,14 +127,14 @@ namespace BibTeX
if ( !m_process->normalExit() )
{
- qDebug( "%s did not exit in a clean fashion", m_process->arguments()[0].latin1() );
+ tqDebug( "%s did not exit in a clean fashion", m_process->arguments()[0].latin1() );
delete m_process;
return false;
}
}
else
{
- qDebug( "%s did not start", m_process->arguments()[0].latin1() );
+ tqDebug( "%s did not start", m_process->arguments()[0].latin1() );
delete m_process;
return false;
}
@@ -145,34 +145,34 @@ namespace BibTeX
return true;
}
- bool FileExporterBibUtils::xmlBufferToIOdevice( QIODevice *iodevice )
+ bool FileExporterBibUtils::xmlBufferToIOdevice( TQIODevice *iodevice )
{
- QWaitCondition wc;
+ TQWaitCondition wc;
m_waiting = true;
m_process = NULL;
switch ( m_outputFormat )
{
case BibTeX::File::formatISI:
- m_process = new QProcess( QStringList::split( ' ', "xml2isi" ) );
+ m_process = new TQProcess( TQStringList::split( ' ', "xml2isi" ) );
break;
case BibTeX::File::formatWordBib:
- m_process = new QProcess( QStringList::split( ' ', "xml2wordbib" ) );
+ m_process = new TQProcess( TQStringList::split( ' ', "xml2wordbib" ) );
break;
case BibTeX::File::formatAds:
- m_process = new QProcess( QStringList::split( ' ', "xml2ads" ) );
+ m_process = new TQProcess( TQStringList::split( ' ', "xml2ads" ) );
break;
case BibTeX::File::formatEndNote:
- m_process = new QProcess( QStringList::split( ' ', "xml2end" ) );
+ m_process = new TQProcess( TQStringList::split( ' ', "xml2end" ) );
break;
case BibTeX::File::formatRIS:
- m_process = new QProcess( QStringList::split( ' ', "xml2ris" ) );
+ m_process = new TQProcess( TQStringList::split( ' ', "xml2ris" ) );
break;
case BibTeX::File::formatMODS:
/* m_process = NULL; */
break;
default:
- qDebug( "Cannot handle output format %i", m_outputFormat );
+ tqDebug( "Cannot handle output format %i", m_outputFormat );
return false;
}
@@ -184,12 +184,12 @@ namespace BibTeX
if ( m_process->start() )
{
- QBuffer *tempBuffer = m_processBuffer;
- m_processBuffer = new QBuffer();
+ TQBuffer *tempBuffer = m_processBuffer;
+ m_processBuffer = new TQBuffer();
tempBuffer->open( IO_ReadOnly );
m_process->writeToStdin( tempBuffer->readAll() );
- qApp->processEvents();
+ tqApp->processEvents();
m_process->closeStdin();
tempBuffer->close();
@@ -198,7 +198,7 @@ namespace BibTeX
while ( m_waiting )
{
wc.wait( 250 );
- qApp->processEvents();
+ tqApp->processEvents();
--nothingHappens;
}
m_processBuffer->close();
@@ -222,7 +222,7 @@ namespace BibTeX
}
else
{
- qDebug( "%s did not start", m_process->arguments()[0].latin1() );
+ tqDebug( "%s did not start", m_process->arguments()[0].latin1() );
delete m_process;
return false;
}
@@ -249,10 +249,10 @@ namespace BibTeX
void FileExporterBibUtils::slotReadyStderr()
{
- QByteArray ba = m_process->readStderr();
- QTextStream bats( ba, IO_ReadOnly );
- bats.setEncoding( QTextStream::UnicodeUTF8 );
- qDebug( "%s", bats.read().latin1() );
+ TQByteArray ba = m_process->readStderr();
+ TQTextStream bats( ba, IO_ReadOnly );
+ bats.setEncoding( TQTextStream::UnicodeUTF8 );
+ tqDebug( "%s", bats.read().latin1() );
}
}