diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-29 00:55:34 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-29 00:55:34 +0000 |
commit | c4189d200e71c7ef82e9a6e34935ad225154d658 (patch) | |
tree | f7f29a1159e0402472ff2ab22617a8113f66263c /kbarcode/csvfile.cpp | |
parent | 2f888b1578e65ec1bc514996eb509fcaf34462d6 (diff) | |
download | kbarcode-c4189d200e71c7ef82e9a6e34935ad225154d658.tar.gz kbarcode-c4189d200e71c7ef82e9a6e34935ad225154d658.zip |
TQt4 port kbarcode
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kbarcode@1233956 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbarcode/csvfile.cpp')
-rw-r--r-- | kbarcode/csvfile.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/kbarcode/csvfile.cpp b/kbarcode/csvfile.cpp index f8cc81f..880898f 100644 --- a/kbarcode/csvfile.cpp +++ b/kbarcode/csvfile.cpp @@ -19,10 +19,10 @@ #include "printersettings.h" -#include <qbuffer.h> -#include <qtextcodec.h> +#include <tqbuffer.h> +#include <tqtextcodec.h> -CSVFile::CSVFile( const QString & filename ) +CSVFile::CSVFile( const TQString & filename ) { m_eof = false; m_csv = true; @@ -35,10 +35,10 @@ CSVFile::CSVFile( const QString & filename ) m_file.open( IO_ReadOnly ); if( m_file.isOpen() ) - m_stream.setDevice( &m_file ); + m_stream.setDevice( TQT_TQIODEVICE(&m_file) ); } -CSVFile::CSVFile( QBuffer & buf ) +CSVFile::CSVFile( TQBuffer & buf ) { m_eof = false; m_csv = true; @@ -50,24 +50,24 @@ CSVFile::CSVFile( QBuffer & buf ) buf.open( IO_ReadOnly ); if( buf.isOpen() ) - m_stream.setDevice( &buf ); + m_stream.setDevice( TQT_TQIODEVICE(&buf) ); } CSVFile::~CSVFile() { - if( m_stream.device() && m_stream.device()->isOpen() ) - m_stream.device()->close(); + if( m_stream.tqdevice() && m_stream.tqdevice()->isOpen() ) + m_stream.tqdevice()->close(); } -QStringList CSVFile::readNextLine() +TQStringList CSVFile::readNextLine() { - QString line; + TQString line; - if( !m_stream.device() ) - return QStringList(); + if( !m_stream.tqdevice() ) + return TQStringList(); - if( !m_stream.device()->isOpen() ) - return QStringList(); + if( !m_stream.tqdevice()->isOpen() ) + return TQStringList(); // walk through the lines until a line containing valid data for( ;; ) @@ -79,7 +79,7 @@ QStringList CSVFile::readNextLine() if( line.isNull() ) { m_eof = true; - return QStringList(); + return TQStringList(); } // ignore comments and empty lines @@ -92,10 +92,10 @@ QStringList CSVFile::readNextLine() return m_csv ? readCsvLine( line ) : readFixedLine( line ); } -QStringList CSVFile::readCsvLine( const QString & l ) +TQStringList CSVFile::readCsvLine( const TQString & l ) { - QString line( l ); - QStringList sections; + TQString line( l ); + TQStringList sections; unsigned int start = 0; unsigned int end = 0; unsigned int len; @@ -131,10 +131,10 @@ QStringList CSVFile::readCsvLine( const QString & l ) return sections; } -QStringList CSVFile::readFixedLine( const QString & line ) +TQStringList CSVFile::readFixedLine( const TQString & line ) { - QString data( line ); - QStringList list; + TQString data( line ); + TQStringList list; for( unsigned int i=0;i<m_width.count();i++ ) { @@ -145,9 +145,9 @@ QStringList CSVFile::readFixedLine( const QString & line ) return list; } -QString CSVFile::removeQuote( const QString & text ) +TQString CSVFile::removeQuote( const TQString & text ) { - QString line = text.stripWhiteSpace(); + TQString line = text.stripWhiteSpace(); if( m_quote.isEmpty() ) return text; @@ -161,8 +161,8 @@ QString CSVFile::removeQuote( const QString & text ) return line; } -void CSVFile::setEncoding( const QString & enc ) +void CSVFile::setEncoding( const TQString & enc ) { - m_stream.setCodec( QTextCodec::codecForName( enc.latin1() ) ); + m_stream.setCodec( TQTextCodec::codecForName( enc.latin1() ) ); } |