Enhance warning verbosity in TQFile (unix)

pull/1/head
François Andriot 10 years ago committed by Slávek Banko
parent 9a892fcab0
commit c86b8f17bf

@ -168,7 +168,7 @@ bool TQFile::open( int m )
{ {
if ( isOpen() ) { // file already open if ( isOpen() ) { // file already open
#if defined(QT_CHECK_STATE) #if defined(QT_CHECK_STATE)
tqWarning( "TQFile::open: File already open" ); tqWarning( "TQFile::open: File (%s) already open", fn.latin1() );
#endif #endif
return FALSE; return FALSE;
} }
@ -182,7 +182,7 @@ bool TQFile::open( int m )
setMode( m ); setMode( m );
if ( !(isReadable() || isWritable()) ) { if ( !(isReadable() || isWritable()) ) {
#if defined(QT_CHECK_RANGE) #if defined(QT_CHECK_RANGE)
tqWarning( "TQFile::open: File access not specified" ); tqWarning( "TQFile::open: File access (%s) not specified", fn.latin1() );
#endif #endif
return FALSE; return FALSE;
} }
@ -340,7 +340,7 @@ bool TQFile::open( int m, FILE *f )
{ {
if ( isOpen() ) { if ( isOpen() ) {
#if defined(QT_CHECK_RANGE) #if defined(QT_CHECK_RANGE)
tqWarning( "TQFile::open: File already open" ); tqWarning( "TQFile::open: File (%s) already open", fn.latin1() );
#endif #endif
return FALSE; return FALSE;
} }
@ -412,7 +412,7 @@ bool TQFile::open( int m, int f )
{ {
if ( isOpen() ) { if ( isOpen() ) {
#if defined(QT_CHECK_RANGE) #if defined(QT_CHECK_RANGE)
tqWarning( "TQFile::open: File already open" ); tqWarning( "TQFile::open: File (%s) already open", fn.latin1() );
#endif #endif
return FALSE; return FALSE;
} }
@ -508,7 +508,7 @@ bool TQFile::at( Offset pos )
{ {
if ( !isOpen() ) { if ( !isOpen() ) {
#if defined(QT_CHECK_STATE) #if defined(QT_CHECK_STATE)
tqWarning( "TQFile::at: File is not open" ); tqWarning( "TQFile::at: File (%s) is not open", fn.latin1() );
#endif #endif
return FALSE; return FALSE;
} }
@ -564,11 +564,11 @@ TQ_LONG TQFile::readBlock( char *p, TQ_ULONG len )
#endif #endif
#if defined(QT_CHECK_STATE) #if defined(QT_CHECK_STATE)
if ( !isOpen() ) { if ( !isOpen() ) {
tqWarning( "TQFile::readBlock: File not open" ); tqWarning( "TQFile::readBlock: File (%s) not open", fn.latin1() );
return -1; return -1;
} }
if ( !isReadable() ) { if ( !isReadable() ) {
tqWarning( "TQFile::readBlock: Read operation not permitted" ); tqWarning( "TQFile::readBlock: Read operation not permitted in file %s ", fn.latin1() );
return -1; return -1;
} }
#endif #endif
@ -633,11 +633,11 @@ TQ_LONG TQFile::writeBlock( const char *p, TQ_ULONG len )
#endif #endif
#if defined(QT_CHECK_STATE) #if defined(QT_CHECK_STATE)
if ( !isOpen() ) { // file not open if ( !isOpen() ) { // file not open
tqWarning( "TQFile::writeBlock: File not open" ); tqWarning( "TQFile::writeBlock: File (%s) not open", fn.latin1() );
return -1; return -1;
} }
if ( !isWritable() ) { // writing not permitted if ( !isWritable() ) { // writing not permitted
tqWarning( "TQFile::writeBlock: Write operation not permitted" ); tqWarning( "TQFile::writeBlock: Write operation not permitted in file %s ", fn.latin1() );
return -1; return -1;
} }
#endif #endif

Loading…
Cancel
Save