diff options
author | Slávek Banko <[email protected]> | 2013-06-29 12:56:53 +0200 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2013-07-04 03:11:35 +0200 |
commit | 5f5e7c5455d52826b0bd50f64fcffb7695ce970d (patch) | |
tree | c8ee8792d3fb139365abbf70c2255f1e69d2aa34 /src/fileimporterris.cpp | |
parent | 251c9a439759c830d34c70683d0fc9454d703010 (diff) | |
download | kbibtex-5f5e7c5455d52826b0bd50f64fcffb7695ce970d.tar.gz kbibtex-5f5e7c5455d52826b0bd50f64fcffb7695ce970d.zip |
Initial TQt conversion
Diffstat (limited to 'src/fileimporterris.cpp')
-rw-r--r-- | src/fileimporterris.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/fileimporterris.cpp b/src/fileimporterris.cpp index 0e5e3da..2970095 100644 --- a/src/fileimporterris.cpp +++ b/src/fileimporterris.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include <qapplication.h> -#include <qtextstream.h> -#include <qregexp.h> +#include <ntqapplication.h> +#include <ntqtextstream.h> +#include <ntqregexp.h> #include <entry.h> @@ -39,23 +39,23 @@ namespace BibTeX // TODO } - File* FileImporterRIS::load( QIODevice *iodevice ) + File* FileImporterRIS::load( TQIODevice *iodevice ) { m_mutex.lock(); cancelFlag = FALSE; m_refNr = 0; - QTextStream textStream( iodevice ); + TQTextStream textStream( iodevice ); File *result = new File(); - QIODevice *streamDevice = textStream.device(); + TQIODevice *streamDevice = textStream.device(); while ( !cancelFlag && !textStream.atEnd() ) { emit progress( streamDevice->at(), streamDevice->size() ); - qApp->processEvents(); + tqApp->processEvents(); Element * element = nextElement( textStream ); if ( element != NULL ) result->appendElement( element ); - qApp->processEvents(); + tqApp->processEvents(); } emit progress( streamDevice->size(), streamDevice->size() ); @@ -69,7 +69,7 @@ namespace BibTeX return result; } - bool FileImporterRIS::guessCanDecode( const QString & text ) + bool FileImporterRIS::guessCanDecode( const TQString & text ) { return text.find( "TY - " ) >= 0; } @@ -79,16 +79,16 @@ namespace BibTeX cancelFlag = TRUE; } - Element *FileImporterRIS::nextElement( QTextStream &textStream ) + Element *FileImporterRIS::nextElement( TQTextStream &textStream ) { RISitemList list = readElement( textStream ); if ( list.empty() ) return NULL; Entry::EntryType entryType = Entry::etMisc; - Entry *entry = new Entry( entryType, QString( "RIS_%1" ).arg( m_refNr++ ) ); - QStringList authorList, editorList, keywordList; - QString journalName, abstract, startPage, endPage, date; + Entry *entry = new Entry( entryType, TQString( "RIS_%1" ).arg( m_refNr++ ) ); + TQStringList authorList, editorList, keywordList; + TQString journalName, abstract, startPage, endPage, date; int fieldNr = 0; for ( RISitemList::iterator it = list.begin(); it != list.end(); ++it ) @@ -153,16 +153,16 @@ namespace BibTeX } else if (( *it ).key == "KW" ) { - QString text = ( *it ).value; - QRegExp splitRegExp; + TQString text = ( *it ).value; + TQRegExp splitRegExp; if ( text.contains( ";" ) ) - splitRegExp = QRegExp( "\\s*[;\\n]\\s*" ); + splitRegExp = TQRegExp( "\\s*[;\\n]\\s*" ); else if ( text.contains( "," ) ) - splitRegExp = QRegExp( "\\s*[,\\n]\\s*" ); + splitRegExp = TQRegExp( "\\s*[,\\n]\\s*" ); else - splitRegExp = QRegExp( "\\n" ); - QStringList newKeywords = QStringList::split( splitRegExp, text, FALSE ); - for ( QStringList::Iterator it = newKeywords.begin(); it != newKeywords.end(); + splitRegExp = TQRegExp( "\\n" ); + TQStringList newKeywords = TQStringList::split( splitRegExp, text, FALSE ); + for ( TQStringList::Iterator it = newKeywords.begin(); it != newKeywords.end(); ++it ) keywordList.append( *it ); } @@ -331,7 +331,7 @@ namespace BibTeX } else { - QString fieldName = QString( "RISfield_%1_%2" ).arg( fieldNr++ ).arg(( *it ).key.left( 2 ) ); + TQString fieldName = TQString( "RISfield_%1_%2" ).arg( fieldNr++ ).arg(( *it ).key.left( 2 ) ); BibTeX::EntryField * field = new BibTeX::EntryField( fieldName ); entry->addField( field ); BibTeX::Value *value = new BibTeX::Value(); @@ -351,7 +351,7 @@ namespace BibTeX BibTeX::Value *value = new BibTeX::Value(); BibTeX::PersonContainer *container = new BibTeX::PersonContainer(); value->items.append( container ); - for ( QStringList::Iterator pit = authorList.begin(); pit != authorList.end();++pit ) + for ( TQStringList::Iterator pit = authorList.begin(); pit != authorList.end();++pit ) container->persons.append( new BibTeX::Person( *pit ) ); field->setValue( value ); } @@ -367,7 +367,7 @@ namespace BibTeX BibTeX::Value *value = new BibTeX::Value(); BibTeX::PersonContainer *container = new BibTeX::PersonContainer(); value->items.append( container ); - for ( QStringList::Iterator pit = authorList.begin(); pit != authorList.end();++pit ) + for ( TQStringList::Iterator pit = authorList.begin(); pit != authorList.end();++pit ) container->persons.append( new BibTeX::Person( *pit ) ); field->setValue( value ); } @@ -383,7 +383,7 @@ namespace BibTeX BibTeX::Value *value = new BibTeX::Value(); BibTeX::KeywordContainer *container = new BibTeX::KeywordContainer(); value->items.append( container ); - for ( QStringList::Iterator pit = keywordList.begin(); pit != keywordList.end();++pit ) + for ( TQStringList::Iterator pit = keywordList.begin(); pit != keywordList.end();++pit ) container->keywords.append( new BibTeX::Keyword( *pit ) ); field->setValue( value ); } @@ -422,20 +422,20 @@ namespace BibTeX field = new BibTeX::EntryField( BibTeX::EntryField::ftPages ); entry->addField( field ); } - QString page; + TQString page; if ( startPage.isEmpty() ) page = endPage; else if ( endPage.isEmpty() ) page = startPage; else - page = startPage + QChar( 0x2013 ) + endPage; + page = startPage + TQChar( 0x2013 ) + endPage; BibTeX::Value *value = new BibTeX::Value(); value->items.append( new BibTeX::PlainText( page ) ); field->setValue( value ); } - QStringList dateFragments = QStringList::split( "/", date ); + TQStringList dateFragments = TQStringList::split( "/", date ); if ( dateFragments.count() > 0 ) { bool ok; @@ -449,7 +449,7 @@ namespace BibTeX entry->addField( field ); } BibTeX::Value *value = new BibTeX::Value(); - value->items.append( new BibTeX::PlainText( QString::number( year ) ) ); + value->items.append( new BibTeX::PlainText( TQString::number( year ) ) ); field->setValue( value ); } } @@ -466,7 +466,7 @@ namespace BibTeX entry->addField( field ); } BibTeX::Value *value = new BibTeX::Value(); - value->items.append( new BibTeX::PlainText( QString::number( month ) ) ); + value->items.append( new BibTeX::PlainText( TQString::number( month ) ) ); field->setValue( value ); } } @@ -474,16 +474,16 @@ namespace BibTeX return entry; } - FileImporterRIS::RISitemList FileImporterRIS::readElement( QTextStream &textStream ) + FileImporterRIS::RISitemList FileImporterRIS::readElement( TQTextStream &textStream ) { RISitemList result; - QString line = textStream.readLine(); + TQString line = textStream.readLine(); while ( !line.startsWith( "TY - " ) && !textStream.eof() ) line = textStream.readLine(); if ( textStream.eof() ) return result; - QString key, value; + TQString key, value; while ( !line.startsWith( "ER -" ) && !textStream.eof() ) { if ( line.mid( 2, 3 ) == " -" ) |