summaryrefslogtreecommitdiffstats
path: root/src/kernel/tqurl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/tqurl.cpp')
-rw-r--r--src/kernel/tqurl.cpp120
1 files changed, 60 insertions, 60 deletions
diff --git a/src/kernel/tqurl.cpp b/src/kernel/tqurl.cpp
index 7d0066f0c..ae5d7c992 100644
--- a/src/kernel/tqurl.cpp
+++ b/src/kernel/tqurl.cpp
@@ -63,12 +63,12 @@ public:
/*!
Replaces backslashes with slashes and removes multiple occurrences
- of slashes or backslashes if \c allowMultiple is FALSE.
+ of slashes or backslashes if \c allowMultiple is false.
*/
-static void slashify( TQString& s, bool allowMultiple = TRUE )
+static void slashify( TQString& s, bool allowMultiple = true )
{
- bool justHadSlash = FALSE;
+ bool justHadSlash = false;
for ( int i = 0; i < (int)s.length(); i++ ) {
if ( !allowMultiple && justHadSlash &&
( s[ i ] == '/' || s[ i ] == '\\' ) ) {
@@ -83,9 +83,9 @@ static void slashify( TQString& s, bool allowMultiple = TRUE )
s[ i ] = '/';
#endif
if ( s[ i ] == '/' )
- justHadSlash = TRUE;
+ justHadSlash = true;
else
- justHadSlash = FALSE;
+ justHadSlash = false;
}
}
@@ -170,7 +170,7 @@ static void slashify( TQString& s, bool allowMultiple = TRUE )
Use the static functions, encode() and decode() to encode or
decode a URL in a string. (They operate on the string in-place.)
- The isRelativeUrl() static function returns TRUE if the given
+ The isRelativeUrl() static function returns true if the given
string is a relative URL.
If you want to use a URL to work on a hierarchical structure (e.g.
@@ -188,9 +188,9 @@ static void slashify( TQString& s, bool allowMultiple = TRUE )
TQUrl::TQUrl()
{
d = new TQUrlPrivate;
- d->isValid = FALSE;
+ d->isValid = false;
d->port = -1;
- d->cleanPathDirty = TRUE;
+ d->cleanPathDirty = true;
}
/*!
@@ -219,7 +219,7 @@ TQUrl::TQUrl( const TQUrl& url )
}
/*!
- Returns TRUE if \a url is relative; otherwise returns FALSE.
+ Returns true if \a url is relative; otherwise returns false.
*/
bool TQUrl::isRelativeUrl( const TQString &url )
@@ -260,7 +260,7 @@ bool TQUrl::isRelativeUrl( const TQString &url )
want the constructor to handle the last part of the path as a file
name if there is no slash at the end, and to let it be replaced by
the file name of \a relUrl (if it contains one), set \a checkSlash
- to TRUE.
+ to true.
*/
TQUrl::TQUrl( const TQUrl& url, const TQString& relUrl, bool checkSlash )
@@ -303,7 +303,7 @@ TQUrl::TQUrl( const TQUrl& url, const TQString& relUrl, bool checkSlash )
p += "/";
p += rel;
d->path = p;
- d->cleanPathDirty = TRUE;
+ d->cleanPathDirty = true;
}
}
} else {
@@ -349,7 +349,7 @@ void TQUrl::setProtocol( const TQString& protocol )
{
d->protocol = protocol;
if ( hasHost() )
- d->isValid = TRUE;
+ d->isValid = true;
}
/*!
@@ -375,8 +375,8 @@ void TQUrl::setUser( const TQString& user )
}
/*!
- Returns TRUE if the URL contains a username; otherwise returns
- FALSE.
+ Returns true if the URL contains a username; otherwise returns
+ false.
\sa setUser() setPassword()
*/
@@ -415,8 +415,8 @@ void TQUrl::setPassword( const TQString& pass )
}
/*!
- Returns TRUE if the URL contains a password; otherwise returns
- FALSE.
+ Returns true if the URL contains a password; otherwise returns
+ false.
\warning Passwords passed in URLs are normally \e insecure; this
is due to the mechanism, not because of TQt.
@@ -450,12 +450,12 @@ void TQUrl::setHost( const TQString& host )
{
d->host = host;
if ( !d->protocol.isNull() && d->protocol != "file" )
- d->isValid = TRUE;
+ d->isValid = true;
}
/*!
- Returns TRUE if the URL contains a hostname; otherwise returns
- FALSE.
+ Returns true if the URL contains a hostname; otherwise returns
+ false.
\sa setHost()
*/
@@ -488,7 +488,7 @@ void TQUrl::setPort( int port )
}
/*!
- Returns TRUE if the URL contains a port; otherwise returns FALSE.
+ Returns true if the URL contains a port; otherwise returns false.
\sa setPort()
*/
@@ -508,12 +508,12 @@ void TQUrl::setPath( const TQString& path )
{
d->path = path;
slashify( d->path );
- d->cleanPathDirty = TRUE;
- d->isValid = TRUE;
+ d->cleanPathDirty = true;
+ d->isValid = true;
}
/*!
- Returns TRUE if the URL contains a path; otherwise returns FALSE.
+ Returns true if the URL contains a path; otherwise returns false.
\sa path() setPath()
*/
@@ -568,7 +568,7 @@ void TQUrl::setRef( const TQString& txt )
}
/*!
- Returns TRUE if the URL has a reference; otherwise returns FALSE.
+ Returns true if the URL has a reference; otherwise returns false.
\sa setRef()
*/
@@ -579,7 +579,7 @@ bool TQUrl::hasRef() const
}
/*!
- Returns TRUE if the URL is valid; otherwise returns FALSE. A URL
+ Returns true if the URL is valid; otherwise returns false. A URL
is invalid if it cannot be parsed, for example.
*/
@@ -602,9 +602,9 @@ void TQUrl::reset()
d->path = "";
d->queryEncoded = "";
d->refEncoded = "";
- d->isValid = TRUE;
+ d->isValid = true;
d->port = -1;
- d->cleanPathDirty = TRUE;
+ d->cleanPathDirty = true;
}
/*!
@@ -617,12 +617,12 @@ bool TQUrl::parse( const TQString& url )
slashify( url_ );
if ( url_.isEmpty() ) {
- d->isValid = FALSE;
- return FALSE;
+ d->isValid = false;
+ return false;
}
- d->cleanPathDirty = TRUE;
- d->isValid = TRUE;
+ d->cleanPathDirty = true;
+ d->isValid = true;
TQString oldProtocol = d->protocol;
d->protocol = TQString::null;
@@ -664,15 +664,15 @@ bool TQUrl::parse( const TQString& url )
{ 0, 0, Port, Path, 0, 0, 0, 0, } // Port
};
- bool relPath = FALSE;
+ bool relPath = false;
- relPath = FALSE;
- bool forceRel = FALSE;
+ relPath = false;
+ bool forceRel = false;
// If ':' is at pos 1, we have only one letter
// before that separator => that's a drive letter!
if ( url_.length() >= 2 && url_[1] == ':' )
- relPath = forceRel = TRUE;
+ relPath = forceRel = true;
int hasNoHost = -1;
int cs = url_.find( ":/" );
@@ -688,7 +688,7 @@ bool TQUrl::parse( const TQString& url )
} else {
table[ 0 ][ 1 ] = Protocol;
}
- relPath = TRUE;
+ relPath = true;
} else { // some checking
table[ 0 ][ 1 ] = Protocol;
@@ -799,8 +799,8 @@ bool TQUrl::parse( const TQString& url )
// error
if ( i < (int)url_.length() - 1 ) {
- d->isValid = FALSE;
- return FALSE;
+ d->isValid = false;
+ return false;
}
@@ -846,7 +846,7 @@ bool TQUrl::parse( const TQString& url )
#endif
decode( d->path );
- d->cleanPathDirty = TRUE;
+ d->cleanPathDirty = true;
#if 0
tqDebug( "URL: %s", url.latin1() );
@@ -860,7 +860,7 @@ bool TQUrl::parse( const TQString& url )
tqDebug( "port: %d\n\n----------------------------\n\n", d->port );
#endif
- return TRUE;
+ return true;
}
/*!
@@ -891,14 +891,14 @@ TQUrl& TQUrl::operator=( const TQUrl& url )
}
/*!
- Compares this URL with \a url and returns TRUE if they are equal;
- otherwise returns FALSE.
+ Compares this URL with \a url and returns true if they are equal;
+ otherwise returns false.
*/
bool TQUrl::operator==( const TQUrl& url ) const
{
if ( !isValid() || !url.isValid() )
- return FALSE;
+ return false;
if ( d->protocol == url.d->protocol &&
d->user == url.d->user &&
@@ -909,16 +909,16 @@ bool TQUrl::operator==( const TQUrl& url ) const
d->refEncoded == url.d->refEncoded &&
d->isValid == url.d->isValid &&
d->port == url.d->port )
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
/*!
\overload
Compares this URL with \a url. \a url is parsed first. Returns
- TRUE if \a url is equal to this url; otherwise returns FALSE.
+ true if \a url is equal to this url; otherwise returns false.
*/
bool TQUrl::operator==( const TQString& url ) const
@@ -996,7 +996,7 @@ TQString TQUrl::encodedPathAndQuery()
void TQUrl::setEncodedPathAndQuery( const TQString& pathAndQuery )
{
- d->cleanPathDirty = TRUE;
+ d->cleanPathDirty = true;
int pos = pathAndQuery.find( '?' );
if ( pos == -1 ) {
d->path = pathAndQuery;
@@ -1007,13 +1007,13 @@ void TQUrl::setEncodedPathAndQuery( const TQString& pathAndQuery )
}
decode( d->path );
- d->cleanPathDirty = TRUE;
+ d->cleanPathDirty = true;
}
extern bool tqt_resolve_symlinks; // defined in tqapplication.cpp
/*!
- Returns the path of the URL. If \a correct is TRUE, the path is
+ Returns the path of the URL. If \a correct is true, the path is
cleaned (deals with too many or too few slashes, cleans things
like "/../..", etc). Otherwise path() returns exactly the path
that was parsed or set.
@@ -1026,7 +1026,7 @@ TQString TQUrl::path( bool correct ) const
return d->path;
if ( d->cleanPathDirty ) {
- bool check = TRUE;
+ bool check = true;
if ( TQDir::isRelativePath( d->path ) ) {
d->cleanPath = d->path;
} else if ( isLocalFile() ) {
@@ -1037,10 +1037,10 @@ TQString TQUrl::path( bool correct ) const
d->cleanPath = d->path;
bool share = (d->cleanPath[0] == '\\' && d->cleanPath[1] == '\\') ||
(d->cleanPath[0] == '/' && d->cleanPath[1] == '/');
- slashify( d->cleanPath, FALSE );
+ slashify( d->cleanPath, false );
d->cleanPath = TQDir::cleanDirPath( d->cleanPath );
if ( share ) {
- check = FALSE;
+ check = false;
while (d->cleanPath.at(0) != '/' || d->cleanPath.at(1) != '/')
d->cleanPath.prepend("/");
}
@@ -1078,15 +1078,15 @@ TQString TQUrl::path( bool correct ) const
}
if ( check )
- slashify( d->cleanPath, FALSE );
- d->cleanPathDirty = FALSE;
+ slashify( d->cleanPath, false );
+ d->cleanPathDirty = false;
}
return d->cleanPath;
}
/*!
- Returns TRUE if the URL is a local file; otherwise returns FALSE.
+ Returns true if the URL is a local file; otherwise returns false.
*/
bool TQUrl::isLocalFile() const
@@ -1140,7 +1140,7 @@ void TQUrl::addPath( const TQString& pa )
else
d->path += p;
}
- d->cleanPathDirty = TRUE;
+ d->cleanPathDirty = true;
}
/*!
@@ -1264,8 +1264,8 @@ void TQUrl::decode( TQString& url )
/*!
Composes a string version of the URL and returns it. If \a
- encodedPath is TRUE the path in the returned string is encoded. If
- \a forcePrependProtocol is TRUE and \a encodedPath looks like a
+ encodedPath is true the path in the returned string is encoded. If
+ \a forcePrependProtocol is true and \a encodedPath looks like a
local filename, the "file:/" protocol is also prepended.
\sa encode() decode()
@@ -1338,8 +1338,8 @@ TQUrl::operator TQString() const
bool TQUrl::cdUp()
{
d->path += "/..";
- d->cleanPathDirty = TRUE;
- return TRUE;
+ d->cleanPathDirty = true;
+ return true;
}
#endif // TQT_NO_URL