diff options
Diffstat (limited to 'examples/network/networkprotocol/nntp.cpp')
-rw-r--r-- | examples/network/networkprotocol/nntp.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/examples/network/networkprotocol/nntp.cpp b/examples/network/networkprotocol/nntp.cpp index 08c2c18c9..033ddcc24 100644 --- a/examples/network/networkprotocol/nntp.cpp +++ b/examples/network/networkprotocol/nntp.cpp @@ -15,8 +15,8 @@ #include <tqregexp.h> Nntp::Nntp() - : TQNetworkProtocol(), connectionReady( FALSE ), - readGroups( FALSE ), readArticle( FALSE ) + : TQNetworkProtocol(), connectionReady( false ), + readGroups( false ), readArticle( false ) { // create the command socket and connect to its signals commandSocket = new TQSocket( this ); @@ -56,7 +56,7 @@ void Nntp::operationListChildren( TQNetworkOperation * ) // write the command to the socket commandSocket->writeBlock( cmd.latin1(), cmd.length() ); - readGroups = TRUE; + readGroups = true; } void Nntp::operationGet( TQNetworkOperation *op ) @@ -75,28 +75,28 @@ void Nntp::operationGet( TQNetworkOperation *op ) // read the head of the article cmd = "article " + file + "\r\n"; commandSocket->writeBlock( cmd.latin1(), cmd.length() ); - readArticle = TRUE; + readArticle = true; } bool Nntp::checkConnection( TQNetworkOperation * ) { - // we are connected, return TRUE + // we are connected, return true if ( commandSocket->isOpen() && connectionReady ) - return TRUE; + return true; // seems that there is no chance to connect if ( commandSocket->isOpen() ) - return FALSE; + return false; // don't call connectToHost() if we are already trying to connect if ( commandSocket->state() == TQSocket::Connecting ) - return FALSE; + return false; // start connecting - connectionReady = FALSE; + connectionReady = false; commandSocket->connectToHost( url()->host(), url()->port() != -1 ? url()->port() : 119 ); - return FALSE; + return false; } void Nntp::close() @@ -165,7 +165,7 @@ void Nntp::readyRead() // of the code of the server response was 200, we know that the // server is ready to get commands from us now if ( s.left( 3 ) == "200" ) - connectionReady = TRUE; + connectionReady = true; } void Nntp::parseGroups() @@ -180,7 +180,7 @@ void Nntp::parseGroups() // if the line starts with a dot, all groups or articles have been listed, // so we finished processing the listChildren() command if ( s[ 0 ] == '.' ) { - readGroups = FALSE; + readGroups = false; operationInProgress()->setState( StDone ); emit finished( operationInProgress() ); return; @@ -203,10 +203,10 @@ void Nntp::parseGroups() inf.setName( group ); TQString path = url()->path(); inf.setDir( path.isEmpty() || path == "/" ); - inf.setSymLink( FALSE ); + inf.setSymLink( false ); inf.setFile( !inf.isDir() ); - inf.setWritable( FALSE ); - inf.setReadable( TRUE ); + inf.setWritable( false ); + inf.setReadable( true ); // let others know about our new child emit newChild( inf, operationInProgress() ); @@ -225,7 +225,7 @@ void Nntp::parseArticle() // if the line starts with a dot, we finished reading something if ( s[ 0 ] == '.' ) { - readArticle = FALSE; + readArticle = false; operationInProgress()->setState( StDone ); emit finished( operationInProgress() ); return; |