summaryrefslogtreecommitdiffstats
path: root/kdat/Tape.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdat/Tape.cpp')
-rw-r--r--kdat/Tape.cpp94
1 files changed, 47 insertions, 47 deletions
diff --git a/kdat/Tape.cpp b/kdat/Tape.cpp
index b015376..ff35d1a 100644
--- a/kdat/Tape.cpp
+++ b/kdat/Tape.cpp
@@ -22,7 +22,7 @@
#include <unistd.h>
#include <errno.h>
-#include <qfile.h>
+#include <tqfile.h>
#include <kmessagebox.h>
#include <klocale.h>
@@ -131,13 +131,13 @@ void Tape::read()
/* 2002-01-28 LEW */
// printf("Preparing to read tape data\n" );
- // QString filename1 = locateLocal( "appdata", _id);
+ // TQString filename1 = locateLocal( "appdata", _id);
// printf("The tape data are in \"%s\"\n", filename1.ascii() );
/* 2002-01-28 LEW */
if ( !_fptr ) {
- QString filename = locateLocal( "appdata", _id);
- _fptr = fopen( QFile::encodeName(filename), "r" );
+ TQString filename = locateLocal( "appdata", _id);
+ _fptr = fopen( TQFile::encodeName(filename), "r" );
/* 2002-01-28 LEW */
#ifdef DEBUG
@@ -226,7 +226,7 @@ void Tape::readAll( int version )
{
read();
- QPtrListIterator<Archive> i( _children );
+ TQPtrListIterator<Archive> i( _children );
for ( ; i.current(); ++i ) {
i.current()->readAll( version );
}
@@ -234,7 +234,7 @@ void Tape::readAll( int version )
void Tape::write()
{
- QString filename = locateLocal( "appdata", _id);
+ TQString filename = locateLocal( "appdata", _id);
/* 2002-01-28 LEW */
#ifdef DEBUG
@@ -244,7 +244,7 @@ void Tape::write()
/* 2002-01-28 LEW */
if ( !_fptr ) {
- _fptr = fopen( QFile::encodeName(filename), "w" );
+ _fptr = fopen( TQFile::encodeName(filename), "w" );
/* 2002-01-31 LEW */
#ifdef DEBUG
@@ -259,7 +259,7 @@ void Tape::write()
return;
}
} else {
- freopen( QFile::encodeName(filename), "w", _fptr );
+ freopen( TQFile::encodeName(filename), "w", _fptr );
/* 2002-01-31 LEW */
#ifdef DEBUG
// printf("Reopened new archive file \"%s\". %s %d\n",
@@ -292,7 +292,7 @@ void Tape::write()
}
//===== Write archives =====
- QPtrListIterator<Archive> i( _children );
+ TQPtrListIterator<Archive> i( _children );
int count = 0;
for ( ; i.current(); ++i, count++ ) {
// Fill in the file offset.
@@ -304,17 +304,17 @@ void Tape::write()
i.current()->write( _fptr );
}
- freopen( QFile::encodeName(filename), "r+", _fptr );
+ freopen( TQFile::encodeName(filename), "r+", _fptr );
}
-QString Tape::getID()
+TQString Tape::getID()
{
read();
return _id;
}
-QString Tape::getName()
+TQString Tape::getName()
{
read();
@@ -342,14 +342,14 @@ int Tape::getSize()
return _size;
}
-const QPtrList<Archive>& Tape::getChildren()
+const TQPtrList<Archive>& Tape::getChildren()
{
read();
return _children;
}
-void Tape::setName( const QString & name )
+void Tape::setName( const TQString & name )
{
/* 2002-01-31 LEW */
int i;
@@ -363,8 +363,8 @@ void Tape::setName( const QString & name )
}
// change file to read-write so we can update it 2002-01-31 LEW
- QString filename = locateLocal( "appdata", _id);
- freopen( QFile::encodeName(filename), "r+", _fptr );
+ TQString filename = locateLocal( "appdata", _id);
+ freopen( TQFile::encodeName(filename), "r+", _fptr );
_name = name;
@@ -377,7 +377,7 @@ void Tape::setName( const QString & name )
down a bug that turns out to be unrelated. The errors I'm looking
for here haven't happened in real use, so there is no rush to add
these checks in KDE 3.0. Thanks. - LW */
- QString msg = i18n("Error during fseek #1 while accessing archive: \"");
+ TQString msg = i18n("Error during fseek #1 while accessing archive: \"");
msg.append( getID() );
msg.append( "\": " );
msg.append( i18n(strerror( errno )) );
@@ -390,7 +390,7 @@ void Tape::setName( const QString & name )
{
clearerr( _fptr );
#ifdef DEBUG /* Can't create new i18n strings now, so we'll save this for KDE 3.1 */
- QString msg = i18n("Error while accessing string #1 in archive: \"");
+ TQString msg = i18n("Error while accessing string #1 in archive: \"");
msg.append( getID() );
msg.append( "\": " );
msg.append( i18n(strerror( errno )) );
@@ -403,7 +403,7 @@ void Tape::setName( const QString & name )
{
clearerr( _fptr );
#ifdef DEBUG /* Can't create new i18n strings now, so we'll save this for KDE 3.1 */
- QString msg = i18n("Error while accessing string #2 in archive: \"");
+ TQString msg = i18n("Error while accessing string #2 in archive: \"");
msg.append( getID() );
msg.append( "\": " );
msg.append( i18n(strerror( errno )) );
@@ -416,7 +416,7 @@ void Tape::setName( const QString & name )
{
clearerr( _fptr );
#ifdef DEBUG /* Can't create new i18n strings now, so we'll save this for KDE 3.1 */
- QString msg = i18n("Error during fseek #2 while accessing archive: \"");
+ TQString msg = i18n("Error during fseek #2 while accessing archive: \"");
msg.append( getID() );
msg.append( "\": " );
msg.append( i18n(strerror( errno )) );
@@ -433,7 +433,7 @@ void Tape::setName( const QString & name )
I fixed the bug that caused this error to occur. Thanks - LW */
if( ( i < 4096 ) || ( ferror( _fptr ) != 0 )){
clearerr( _fptr );
- QString msg = i18n("Error while updating archive name: ");
+ TQString msg = i18n("Error while updating archive name: ");
msg.append( i18n(strerror( errno )) );
printf("%s\n", msg.latin1());
KMessageBox::error(NULL, msg, i18n("File Access Error"));
@@ -451,7 +451,7 @@ void Tape::setName( const QString & name )
/* 2002-01-31 LEW */
// change back to read-only 2002-01-31 LEW
- freopen( QFile::encodeName(filename), "r", _fptr );
+ freopen( TQFile::encodeName(filename), "r", _fptr );
TapeManager::instance()->tapeModified( this );
}
@@ -466,8 +466,8 @@ void Tape::setMTime( int mtime )
}
// change file to read-write so we can update it 2002-01-31 LEW
- QString filename = locateLocal( "appdata", _id);
- freopen( QFile::encodeName(filename), "r+", _fptr );
+ TQString filename = locateLocal( "appdata", _id);
+ freopen( TQFile::encodeName(filename), "r+", _fptr );
_mtime = mtime;
@@ -480,7 +480,7 @@ void Tape::setMTime( int mtime )
fflush( _fptr );
// change back to read-only 2002-01-31 LEW
- freopen( QFile::encodeName(filename), "r", _fptr );
+ freopen( TQFile::encodeName(filename), "r", _fptr );
TapeManager::instance()->tapeModified( this );
}
@@ -497,8 +497,8 @@ void Tape::setSize( int size )
_size = size;
// change file to read-write so we can update it 2002-01-31 LEW
- QString filename = locateLocal( "appdata", _id);
- freopen( QFile::encodeName(filename), "r+", _fptr );
+ TQString filename = locateLocal( "appdata", _id);
+ freopen( TQFile::encodeName(filename), "r+", _fptr );
char buf[4096];
fseek( _fptr, 0, SEEK_SET );
@@ -509,7 +509,7 @@ void Tape::setSize( int size )
fflush( _fptr );
// change back to read-only 2002-01-31 LEW
- freopen( QFile::encodeName(filename), "r", _fptr );
+ freopen( TQFile::encodeName(filename), "r", _fptr );
TapeManager::instance()->tapeModified( this );
}
@@ -523,8 +523,8 @@ void Tape::addChild( Archive* archive )
read();
// change file to read-write so we can update it 2002-01-31 LEW
- QString filename = locateLocal( "appdata", _id);
- freopen( QFile::encodeName(filename), "r+", _fptr );
+ TQString filename = locateLocal( "appdata", _id);
+ freopen( TQFile::encodeName(filename), "r+", _fptr );
archive->calcRanges();
@@ -548,7 +548,7 @@ void Tape::addChild( Archive* archive )
setMTime( time( NULL ) );
// change back to read-only 2002-01-31 LEW
- freopen( QFile::encodeName(filename), "r", _fptr );
+ freopen( TQFile::encodeName(filename), "r", _fptr );
/* 2002-01-28 LEW */
// printf("Done adding archive to tape file\n" );
@@ -580,13 +580,13 @@ void Tape::removeChild( Archive* archive )
here = ftell( _fptr );
}
- QString filename = locateLocal( "appdata", _id);
- truncate( QFile::encodeName(filename), here );
- freopen( QFile::encodeName(filename), "r+", _fptr );
+ TQString filename = locateLocal( "appdata", _id);
+ truncate( TQFile::encodeName(filename), here );
+ freopen( TQFile::encodeName(filename), "r+", _fptr );
fflush( _fptr );
// change back to read-only 2002-01-31 LEW
- freopen( QFile::encodeName(filename), "r", _fptr );
+ freopen( TQFile::encodeName(filename), "r", _fptr );
setMTime( time( NULL ) );
}
@@ -612,13 +612,13 @@ void Tape::clear()
fseek( _fptr, MAX_NUM_ARCHIVES * 4, SEEK_CUR );
int here = ftell( _fptr );
- QString filename = locateLocal( "appdata", _id);
- truncate( QFile::encodeName(filename), here );
- freopen( QFile::encodeName(filename), "r+", _fptr );
+ TQString filename = locateLocal( "appdata", _id);
+ truncate( TQFile::encodeName(filename), here );
+ freopen( TQFile::encodeName(filename), "r+", _fptr );
fflush( _fptr );
// change back to read-only 2002-01-31 LEW
- freopen( QFile::encodeName(filename), "r", _fptr );
+ freopen( TQFile::encodeName(filename), "r", _fptr );
setMTime( time( NULL ) );
}
@@ -634,7 +634,7 @@ void Tape::readVersion1Index( FILE* fptr )
KMessageBox::error( KDatMainWindow::getInstance(), i18n( "Reading tape ID failed." ), i18n("Index File Error") );
return;
}
- QCString tapeID = buf;
+ TQCString tapeID = buf;
tapeID.truncate( tapeID.length() - 1 );
if ( tapeID !=_id ) {
KMessageBox::error( KDatMainWindow::getInstance(), i18n( "Tape ID on tape does not match tape ID in index file." ), i18n("Index File Error") );
@@ -683,7 +683,7 @@ void Tape::readVersion1Index( FILE* fptr )
KMessageBox::error( KDatMainWindow::getInstance(), i18n( "Reading archive name failed." ), i18n("Index File Error") );
return;
}
- QString archiveName = buf;
+ TQString archiveName = buf;
archiveName.truncate( archiveName.length() - 1 );
// Read archive time stamp.
@@ -720,7 +720,7 @@ void Tape::readVersion1Index( FILE* fptr )
}
int archiveNumFiles = atoi( buf );
- QString tmpFileName;
+ TQString tmpFileName;
int tmpFileSize = -1;
int tmpFileMTime = -1;
int tmpFileStartRecord = -1;
@@ -730,7 +730,7 @@ void Tape::readVersion1Index( FILE* fptr )
KMessageBox::error( KDatMainWindow::getInstance(), i18n( "Reading file name failed." ), i18n("Index File Error") );
return;
}
- QString fileName = buf;
+ TQString fileName = buf;
fileName.truncate( fileName.length() - 1 );
// Read file size.
@@ -781,7 +781,7 @@ void Tape::readVersion2Index( FILE* fptr )
KMessageBox::error( KDatMainWindow::getInstance(), i18n( "Reading tape ID failed." ), i18n("Index File Error") );
return;
}
- QCString tapeID = buf;
+ TQCString tapeID = buf;
tapeID.truncate( tapeID.length() - 1 );
if ( tapeID != _id ) {
KMessageBox::error( KDatMainWindow::getInstance(), i18n( "Tape ID on tape does not match tape ID in index file." ), i18n("Index File Error") );
@@ -843,7 +843,7 @@ void Tape::readVersion3Index( FILE* fptr )
KMessageBox::error( KDatMainWindow::getInstance(), i18n( "Reading tape ID failed." ), i18n("Index File Error") );
return;
}
- QCString tapeID = buf;
+ TQCString tapeID = buf;
tapeID.truncate( tapeID.length() - 1 );
if ( tapeID != _id ) {
KMessageBox::error( KDatMainWindow::getInstance(), i18n( "Tape ID on tape does not match tape ID in index file." ), i18n("Index File Error") );
@@ -886,7 +886,7 @@ void Tape::readVersion4Index( FILE* fptr )
KMessageBox::error( KDatMainWindow::getInstance(), i18n( "Reading tape ID failed." ), i18n("Index File Error") );
return;
}
- QCString tapeID = buf;
+ TQCString tapeID = buf;
tapeID.truncate( tapeID.length() - 1 );
if ( tapeID != _id ) {
KMessageBox::error( KDatMainWindow::getInstance(), i18n( "Tape ID on tape does not match tape ID in index file." ), i18n("Index File Error") );
@@ -926,7 +926,7 @@ void Tape::readVersion4Index( FILE* fptr )
void Tape::calcRanges()
{
- QPtrListIterator<Archive> it( getChildren() );
+ TQPtrListIterator<Archive> it( getChildren() );
for ( ; it.current(); ++it ) {
it.current()->calcRanges();
}