diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-07-01 22:09:14 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-07-08 08:53:47 +0900 |
commit | c03a4800879ab62692e017e01c825ba12a421ad0 (patch) | |
tree | 57aeff4300eb9fa64d193569f56b2d98305b49a2 /examples/network/networkprotocol/nntp.cpp | |
parent | 030b165ac197ce4c2eb62c7700dc4c10604637aa (diff) | |
download | tqt-c03a4800879ab62692e017e01c825ba12a421ad0.tar.gz tqt-c03a4800879ab62692e017e01c825ba12a421ad0.zip |
Replace TRUE/FALSE with boolean values true/false - part 2
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
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; |