diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2013-06-29 12:56:53 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2013-07-04 03:11:35 +0200 |
commit | 5f5e7c5455d52826b0bd50f64fcffb7695ce970d (patch) | |
tree | c8ee8792d3fb139365abbf70c2255f1e69d2aa34 /src/fileexporterpdf.cpp | |
parent | 251c9a439759c830d34c70683d0fc9454d703010 (diff) | |
download | kbibtex-5f5e7c5455d52826b0bd50f64fcffb7695ce970d.tar.gz kbibtex-5f5e7c5455d52826b0bd50f64fcffb7695ce970d.zip |
Initial TQt conversion
Diffstat (limited to 'src/fileexporterpdf.cpp')
-rw-r--r-- | src/fileexporterpdf.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/src/fileexporterpdf.cpp b/src/fileexporterpdf.cpp index 47b8dad..9fff4b3 100644 --- a/src/fileexporterpdf.cpp +++ b/src/fileexporterpdf.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include <qfile.h> -#include <qstringlist.h> -#include <qurl.h> +#include <ntqfile.h> +#include <ntqstringlist.h> +#include <ntqurl.h> #include <settings.h> #include <element.h> @@ -33,9 +33,9 @@ namespace BibTeX FileExporterPDF::FileExporterPDF( bool embedFiles ) : FileExporterToolchain(), m_latexLanguage( "english" ), m_latexBibStyle( "plain" ), m_embedFiles( embedFiles ) { - laTeXFilename = QString( workingDir ).append( "/bibtex-to-pdf.tex" ); - bibTeXFilename = QString( workingDir ).append( "/bibtex-to-pdf.bib" ); - outputFilename = QString( workingDir ).append( "/bibtex-to-pdf.pdf" ); + laTeXFilename = TQString( workingDir ).append( "/bibtex-to-pdf.tex" ); + bibTeXFilename = TQString( workingDir ).append( "/bibtex-to-pdf.bib" ); + outputFilename = TQString( workingDir ).append( "/bibtex-to-pdf.pdf" ); } FileExporterPDF::~FileExporterPDF() @@ -43,18 +43,18 @@ namespace BibTeX // nothing } - bool FileExporterPDF::save( QIODevice* iodevice, const File* bibtexfile, QStringList *errorLog ) + bool FileExporterPDF::save( TQIODevice* iodevice, const File* bibtexfile, TQStringList *errorLog ) { m_mutex.lock(); bool result = FALSE; m_embeddedFileList.clear(); if ( m_embedFiles ) { - m_embeddedFileList.append( QString( "%1|%2" ).arg( "BibTeX source" ).arg( bibTeXFilename ) ); + m_embeddedFileList.append( TQString( "%1|%2" ).arg( "BibTeX source" ).arg( bibTeXFilename ) ); fillEmbeddedFileList( bibtexfile ); } - QFile bibtexFile( bibTeXFilename ); + TQFile bibtexFile( bibTeXFilename ); if ( bibtexFile.open( IO_WriteOnly ) ) { FileExporter * bibtexExporter = new FileExporterBibTeX(); @@ -70,7 +70,7 @@ namespace BibTeX return result; } - bool FileExporterPDF::save( QIODevice* iodevice, const Element* element, QStringList *errorLog ) + bool FileExporterPDF::save( TQIODevice* iodevice, const Element* element, TQStringList *errorLog ) { m_mutex.lock(); bool result = FALSE; @@ -78,7 +78,7 @@ namespace BibTeX if ( m_embedFiles ) fillEmbeddedFileList( element ); - QFile bibtexFile( bibTeXFilename ); + TQFile bibtexFile( bibTeXFilename ); if ( bibtexFile.open( IO_WriteOnly ) ) { FileExporter * bibtexExporter = new FileExporterBibTeX(); @@ -94,24 +94,24 @@ namespace BibTeX return result; } - void FileExporterPDF::setLaTeXLanguage( const QString& language ) + void FileExporterPDF::setLaTeXLanguage( const TQString& language ) { m_latexLanguage = language; } - void FileExporterPDF::setLaTeXBibliographyStyle( const QString& bibStyle ) + void FileExporterPDF::setLaTeXBibliographyStyle( const TQString& bibStyle ) { m_latexBibStyle = bibStyle; } - void FileExporterPDF::setDocumentSearchPaths( const QStringList& searchPaths ) + void FileExporterPDF::setDocumentSearchPaths( const TQStringList& searchPaths ) { m_searchPaths = searchPaths; } - bool FileExporterPDF::generatePDF( QIODevice* iodevice, QStringList *errorLog ) + bool FileExporterPDF::generatePDF( TQIODevice* iodevice, TQStringList *errorLog ) { - QStringList cmdLines = QStringList::split( '|', "pdflatex -halt-on-error bibtex-to-pdf.tex|bibtex bibtex-to-pdf|pdflatex -halt-on-error bibtex-to-pdf.tex|pdflatex -halt-on-error bibtex-to-pdf.tex" ); + TQStringList cmdLines = TQStringList::split( '|', "pdflatex -halt-on-error bibtex-to-pdf.tex|bibtex bibtex-to-pdf|pdflatex -halt-on-error bibtex-to-pdf.tex|pdflatex -halt-on-error bibtex-to-pdf.tex" ); if ( writeLatexFile( laTeXFilename ) && runProcesses( cmdLines, errorLog ) && writeFileToIODevice( outputFilename, iodevice ) ) return TRUE; @@ -119,14 +119,14 @@ namespace BibTeX return FALSE; } - bool FileExporterPDF::writeLatexFile( const QString &filename ) + bool FileExporterPDF::writeLatexFile( const TQString &filename ) { - QFile latexFile( filename ); + TQFile latexFile( filename ); if ( latexFile.open( IO_WriteOnly ) ) { m_embedFiles &= kpsewhich( "embedfile.sty" ); - QTextStream ts( &latexFile ); - ts.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream ts( &latexFile ); + ts.setEncoding( TQTextStream::UnicodeUTF8 ); ts << "\\documentclass{article}\n"; if ( kpsewhich( "t1enc.dfu" ) ) ts << "\\usepackage[T1]{fontenc}\n"; @@ -144,10 +144,10 @@ namespace BibTeX ts << "\\begin{document}\n"; if ( m_embedFiles ) - for ( QStringList::ConstIterator it = m_embeddedFileList.begin(); it != m_embeddedFileList.end(); ++it ) + for ( TQStringList::ConstIterator it = m_embeddedFileList.begin(); it != m_embeddedFileList.end(); ++it ) { - QStringList param = QStringList::split( "|", *it ); - QFile file( param[1] ); + TQStringList param = TQStringList::split( "|", *it ); + TQFile file( param[1] ); if ( file.exists() ) ts << "\\embedfile[desc={" << param[0] << "}]{" << param[1] << "}\n"; } @@ -173,20 +173,20 @@ namespace BibTeX const Entry *entry = dynamic_cast<const Entry*>( element ); if ( entry != NULL ) { - QString id = entry->id(); - QStringList urls = entry->urls(); - for ( QStringList::Iterator it = urls.begin(); it != urls.end(); ++it ) + TQString id = entry->id(); + TQStringList urls = entry->urls(); + for ( TQStringList::Iterator it = urls.begin(); it != urls.end(); ++it ) { - QUrl url = QUrl( *it ); - if ( url.isValid() && url.isLocalFile() && !( *it ).endsWith( "/" ) && QFile( url.path() ).exists() ) - m_embeddedFileList.append( QString( "%1|%2" ).arg( id ).arg( url.path() ) ); + TQUrl url = TQUrl( *it ); + if ( url.isValid() && url.isLocalFile() && !( *it ).endsWith( "/" ) && TQFile( url.path() ).exists() ) + m_embeddedFileList.append( TQString( "%1|%2" ).arg( id ).arg( url.path() ) ); else - for ( QStringList::Iterator path_it = m_searchPaths.begin(); path_it != m_searchPaths.end(); ++path_it ) + for ( TQStringList::Iterator path_it = m_searchPaths.begin(); path_it != m_searchPaths.end(); ++path_it ) { - url = QUrl( QString( *path_it ).append( "/" ).append( *it ) ); - if ( url.isValid() && url.isLocalFile() && !( *it ).endsWith( "/" ) && QFile( url.path() ).exists() ) + url = TQUrl( TQString( *path_it ).append( "/" ).append( *it ) ); + if ( url.isValid() && url.isLocalFile() && !( *it ).endsWith( "/" ) && TQFile( url.path() ).exists() ) { - m_embeddedFileList.append( QString( "%1|%2" ).arg( id ).arg( url.path() ) ); + m_embeddedFileList.append( TQString( "%1|%2" ).arg( id ).arg( url.path() ) ); break; } } |