summaryrefslogtreecommitdiffstats
path: root/src/tools/tqdatetime.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2025-12-22 12:05:18 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-12-22 12:13:05 +0900
commita4ebd73f48610ed351c9c53f3646d0597f8ea7bc (patch)
tree2edd219eef4cb8f35bb3844d06902ae8b2fcb565 /src/tools/tqdatetime.cpp
parent7d612f7c91d55501276a385a30dbadb121e7bd9f (diff)
downloadtqt-rename/true-false-9.tar.gz
tqt-rename/true-false-9.zip
Replace TRUE/FALSE with boolean values true/false - part 9rename/true-false-9
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/tools/tqdatetime.cpp')
-rw-r--r--src/tools/tqdatetime.cpp154
1 files changed, 77 insertions, 77 deletions
diff --git a/src/tools/tqdatetime.cpp b/src/tools/tqdatetime.cpp
index 49ae68bb4..87529851a 100644
--- a/src/tools/tqdatetime.cpp
+++ b/src/tools/tqdatetime.cpp
@@ -75,7 +75,7 @@ static const char * const qt_shortMonthNames[] = {
*****************************************************************************/
// Replaces tokens by their value. See TQDateTime::toString() for a list of valid tokens
-static TQString getFmtString( const TQString& f, const TQTime* dt = 0, const TQDate* dd = 0, bool am_pm = FALSE )
+static TQString getFmtString( const TQString& f, const TQTime* dt = 0, const TQDate* dd = 0, bool am_pm = false )
{
if ( f.isEmpty() )
return TQString::null;
@@ -92,23 +92,23 @@ static TQString getFmtString( const TQString& f, const TQTime* dt = 0, const TQD
buf = TQString::number( dt->hour() );
} else if ( f == "hh" ) {
if ( ( am_pm ) && ( dt->hour() > 12 ) )
- buf = TQString::number( dt->hour() - 12 ).rightJustify( 2, '0', TRUE );
+ buf = TQString::number( dt->hour() - 12 ).rightJustify( 2, '0', true );
else if ( ( am_pm ) && ( dt->hour() == 0 ) )
buf = "12";
else
- buf = TQString::number( dt->hour() ).rightJustify( 2, '0', TRUE );
+ buf = TQString::number( dt->hour() ).rightJustify( 2, '0', true );
} else if ( f == "m" ) {
buf = TQString::number( dt->minute() );
} else if ( f == "mm" ) {
- buf = TQString::number( dt->minute() ).rightJustify( 2, '0', TRUE );
+ buf = TQString::number( dt->minute() ).rightJustify( 2, '0', true );
} else if ( f == "s" ) {
buf = TQString::number( dt->second() );
} else if ( f == "ss" ) {
- buf = TQString::number( dt->second() ).rightJustify( 2, '0', TRUE );
+ buf = TQString::number( dt->second() ).rightJustify( 2, '0', true );
} else if ( f == "z" ) {
buf = TQString::number( dt->msec() );
} else if ( f == "zzz" ) {
- buf = TQString::number( dt->msec() ).rightJustify( 3, '0', TRUE );
+ buf = TQString::number( dt->msec() ).rightJustify( 3, '0', true );
} else if ( f == "ap" ) {
buf = dt->hour() < 12 ? "am" : "pm";
} else if ( f == "AP" ) {
@@ -120,11 +120,11 @@ static TQString getFmtString( const TQString& f, const TQTime* dt = 0, const TQD
if ( f == "d" ) {
buf = TQString::number( dd->day() );
} else if ( f == "dd" ) {
- buf = TQString::number( dd->day() ).rightJustify( 2, '0', TRUE );
+ buf = TQString::number( dd->day() ).rightJustify( 2, '0', true );
} else if ( f == "M" ) {
buf = TQString::number( dd->month() );
} else if ( f == "MM" ) {
- buf = TQString::number( dd->month() ).rightJustify( 2, '0', TRUE );
+ buf = TQString::number( dd->month() ).rightJustify( 2, '0', true );
#ifndef TQT_NO_TEXTDATE
} else if ( f == "ddd" ) {
buf = dd->shortDayName( dd->dayOfWeek() );
@@ -300,7 +300,7 @@ TQDate::TQDate( int y, int m, int d )
/*!
\fn bool TQDate::isNull() const
- Returns TRUE if the date is null; otherwise returns FALSE. A null
+ Returns true if the date is null; otherwise returns false. A null
date is invalid.
\sa isValid()
@@ -308,7 +308,7 @@ TQDate::TQDate( int y, int m, int d )
/*!
- Returns TRUE if this date is valid; otherwise returns FALSE.
+ Returns true if this date is valid; otherwise returns false.
\sa isNull()
*/
@@ -841,7 +841,7 @@ TQString TQDate::toString( const TQString& format ) const
\warning If \a y is in the range 0..99, it is interpreted as
1900..1999.
- Returns TRUE if the date is valid; otherwise returns FALSE.
+ Returns true if the date is valid; otherwise returns false.
*/
bool TQDate::setYMD( int y, int m, int d )
@@ -852,10 +852,10 @@ bool TQDate::setYMD( int y, int m, int d )
#if defined(QT_CHECK_RANGE)
tqWarning( "TQDate::setYMD: Invalid date %04d-%02d-%02d", y, m, d );
#endif
- return FALSE;
+ return false;
}
jd = gregorianToJulian( y, m, d );
- return TRUE;
+ return true;
}
/*!
@@ -969,39 +969,39 @@ int TQDate::daysTo( const TQDate &d ) const
/*!
\fn bool TQDate::operator==( const TQDate &d ) const
- Returns TRUE if this date is equal to \a d; otherwise returns FALSE.
+ Returns true if this date is equal to \a d; otherwise returns false.
*/
/*!
\fn bool TQDate::operator!=( const TQDate &d ) const
- Returns TRUE if this date is different from \a d; otherwise returns FALSE.
+ Returns true if this date is different from \a d; otherwise returns false.
*/
/*!
\fn bool TQDate::operator<( const TQDate &d ) const
- Returns TRUE if this date is earlier than \a d, otherwise returns FALSE.
+ Returns true if this date is earlier than \a d, otherwise returns false.
*/
/*!
\fn bool TQDate::operator<=( const TQDate &d ) const
- Returns TRUE if this date is earlier than or equal to \a d,
- otherwise returns FALSE.
+ Returns true if this date is earlier than or equal to \a d,
+ otherwise returns false.
*/
/*!
\fn bool TQDate::operator>( const TQDate &d ) const
- Returns TRUE if this date is later than \a d, otherwise returns FALSE.
+ Returns true if this date is later than \a d, otherwise returns false.
*/
/*!
\fn bool TQDate::operator>=( const TQDate &d ) const
- Returns TRUE if this date is later than or equal to \a d,
- otherwise returns FALSE.
+ Returns true if this date is later than or equal to \a d,
+ otherwise returns false.
*/
/*!
@@ -1143,15 +1143,15 @@ TQDate TQDate::fromString( const TQString& s, TQt::DateFormat f )
/*!
\overload
- Returns TRUE if the specified date (year \a y, month \a m and day
- \a d) is valid; otherwise returns FALSE.
+ Returns true if the specified date (year \a y, month \a m and day
+ \a d) is valid; otherwise returns false.
Example:
\code
- TQDate::isValid( 2002, 5, 17 ); // TRUE May 17th 2002 is valid
- TQDate::isValid( 2002, 2, 30 ); // FALSE Feb 30th does not exist
- TQDate::isValid( 2004, 2, 29 ); // TRUE 2004 is a leap year
- TQDate::isValid( 1202, 6, 6 ); // FALSE 1202 is pre-Gregorian
+ TQDate::isValid( 2002, 5, 17 ); // true May 17th 2002 is valid
+ TQDate::isValid( 2002, 2, 30 ); // false Feb 30th does not exist
+ TQDate::isValid( 2004, 2, 29 ); // true 2004 is a leap year
+ TQDate::isValid( 1202, 6, 6 ); // false 1202 is pre-Gregorian
\endcode
\warning A \a y value in the range 00..99 is interpreted as
@@ -1166,14 +1166,14 @@ bool TQDate::isValid( int y, int m, int d )
y += 1900;
else if ( y < FIRST_YEAR || (y == FIRST_YEAR && (m < 9 ||
(m == 9 && d < 14))) )
- return FALSE;
+ return false;
return (d > 0 && m > 0 && m <= 12) &&
(d <= monthDays[m] || (d == 29 && m == 2 && leapYear(y)));
}
/*!
- Returns TRUE if the specified year \a y is a leap year; otherwise
- returns FALSE.
+ Returns true if the specified year \a y is a leap year; otherwise
+ returns false.
*/
bool TQDate::leapYear( int y )
@@ -1313,14 +1313,14 @@ TQTime::TQTime( int h, int m, int s, int ms )
/*!
\fn bool TQTime::isNull() const
- Returns TRUE if the time is equal to 00:00:00.000; otherwise
- returns FALSE. A null time is valid.
+ Returns true if the time is equal to 00:00:00.000; otherwise
+ returns false. A null time is valid.
\sa isValid()
*/
/*!
- Returns TRUE if the time is valid; otherwise returns FALSE. The
+ Returns true if the time is valid; otherwise returns false. The
time 23:30:55.746 is valid, whereas 24:12:30 is invalid.
\sa isNull()
@@ -1483,8 +1483,8 @@ TQString TQTime::toString( const TQString& format ) const
milliseconds \a ms.
\a h must be in the range 0..23, \a m and \a s must be in the
- range 0..59, and \a ms must be in the range 0..999. Returns TRUE
- if the set time is valid; otherwise returns FALSE.
+ range 0..59, and \a ms must be in the range 0..999. Returns true
+ if the set time is valid; otherwise returns false.
\sa isValid()
*/
@@ -1497,10 +1497,10 @@ bool TQTime::setHMS( int h, int m, int s, int ms )
ms );
#endif
ds = MSECS_PER_DAY; // make this invalid
- return FALSE;
+ return false;
}
ds = (h*SECS_PER_HOUR + m*SECS_PER_MIN + s)*1000 + ms;
- return TRUE;
+ return true;
}
/*!
@@ -1586,39 +1586,39 @@ int TQTime::msecsTo( const TQTime &t ) const
/*!
\fn bool TQTime::operator==( const TQTime &t ) const
- Returns TRUE if this time is equal to \a t; otherwise returns FALSE.
+ Returns true if this time is equal to \a t; otherwise returns false.
*/
/*!
\fn bool TQTime::operator!=( const TQTime &t ) const
- Returns TRUE if this time is different from \a t; otherwise returns FALSE.
+ Returns true if this time is different from \a t; otherwise returns false.
*/
/*!
\fn bool TQTime::operator<( const TQTime &t ) const
- Returns TRUE if this time is earlier than \a t; otherwise returns FALSE.
+ Returns true if this time is earlier than \a t; otherwise returns false.
*/
/*!
\fn bool TQTime::operator<=( const TQTime &t ) const
- Returns TRUE if this time is earlier than or equal to \a t;
- otherwise returns FALSE.
+ Returns true if this time is earlier than or equal to \a t;
+ otherwise returns false.
*/
/*!
\fn bool TQTime::operator>( const TQTime &t ) const
- Returns TRUE if this time is later than \a t; otherwise returns FALSE.
+ Returns true if this time is later than \a t; otherwise returns false.
*/
/*!
\fn bool TQTime::operator>=( const TQTime &t ) const
- Returns TRUE if this time is later than or equal to \a t;
- otherwise returns FALSE.
+ Returns true if this time is later than or equal to \a t;
+ otherwise returns false.
*/
@@ -1683,8 +1683,8 @@ TQTime TQTime::fromString( const TQString& s, TQt::DateFormat f )
\internal
\obsolete
- Fetches the current time and returns TRUE if the time is within one
- minute after midnight, otherwise FALSE. The return value is used by
+ Fetches the current time and returns true if the time is within one
+ minute after midnight, otherwise false. The return value is used by
TQDateTime::currentDateTime() to ensure that the date there is correct.
*/
@@ -1697,8 +1697,8 @@ bool TQTime::currentTime( TQTime *ct )
/*!
\internal
- Fetches the current time, for the TimeSpec \a ts, and returns TRUE
- if the time is within one minute after midnight, otherwise FALSE. The
+ Fetches the current time, for the TimeSpec \a ts, and returns true
+ if the time is within one minute after midnight, otherwise false. The
return value is used by TQDateTime::currentDateTime() to ensure that
the date there is correct. The default TimeSpec is LocalTime.
@@ -1710,7 +1710,7 @@ bool TQTime::currentTime( TQTime *ct, TQt::TimeSpec ts )
#if defined(QT_CHECK_NULL)
tqWarning( "TQTime::currentTime(TQTime *): Null pointer not allowed" );
#endif
- return FALSE;
+ return false;
}
#if defined(Q_OS_WIN32)
@@ -1763,16 +1763,16 @@ bool TQTime::currentTime( TQTime *ct, TQt::TimeSpec ts )
/*!
\overload
- Returns TRUE if the specified time is valid; otherwise returns
- FALSE.
+ Returns true if the specified time is valid; otherwise returns
+ false.
The time is valid if \a h is in the range 0..23, \a m and \a s are
in the range 0..59, and \a ms is in the range 0..999.
Example:
\code
- TQTime::isValid(21, 10, 30); // returns TRUE
- TQTime::isValid(22, 5, 62); // returns FALSE
+ TQTime::isValid(21, 10, 30); // returns true
+ TQTime::isValid(22, 5, 62); // returns false
\endcode
*/
@@ -1939,8 +1939,8 @@ TQDateTime::TQDateTime( const TQDate &date, const TQTime &time )
/*!
\fn bool TQDateTime::isNull() const
- Returns TRUE if both the date and the time are null; otherwise
- returns FALSE. A null datetime is invalid.
+ Returns true if both the date and the time are null; otherwise
+ returns false. A null datetime is invalid.
\sa TQDate::isNull(), TQTime::isNull()
*/
@@ -1948,8 +1948,8 @@ TQDateTime::TQDateTime( const TQDate &date, const TQTime &time )
/*!
\fn bool TQDateTime::isValid() const
- Returns TRUE if both the date and the time are valid; otherwise
- returns FALSE.
+ Returns true if both the date and the time are valid; otherwise
+ returns false.
\sa TQDate::isValid(), TQTime::isValid()
*/
@@ -2333,7 +2333,7 @@ int TQDateTime::secsTo( const TQDateTime &dt ) const
/*!
- Returns TRUE if this datetime is equal to \a dt; otherwise returns FALSE.
+ Returns true if this datetime is equal to \a dt; otherwise returns false.
\sa operator!=()
*/
@@ -2344,8 +2344,8 @@ bool TQDateTime::operator==( const TQDateTime &dt ) const
}
/*!
- Returns TRUE if this datetime is different from \a dt; otherwise
- returns FALSE.
+ Returns true if this datetime is different from \a dt; otherwise
+ returns false.
\sa operator==()
*/
@@ -2356,51 +2356,51 @@ bool TQDateTime::operator!=( const TQDateTime &dt ) const
}
/*!
- Returns TRUE if this datetime is earlier than \a dt; otherwise
- returns FALSE.
+ Returns true if this datetime is earlier than \a dt; otherwise
+ returns false.
*/
bool TQDateTime::operator<( const TQDateTime &dt ) const
{
if ( d < dt.d )
- return TRUE;
- return d == dt.d ? t < dt.t : FALSE;
+ return true;
+ return d == dt.d ? t < dt.t : false;
}
/*!
- Returns TRUE if this datetime is earlier than or equal to \a dt;
- otherwise returns FALSE.
+ Returns true if this datetime is earlier than or equal to \a dt;
+ otherwise returns false.
*/
bool TQDateTime::operator<=( const TQDateTime &dt ) const
{
if ( d < dt.d )
- return TRUE;
- return d == dt.d ? t <= dt.t : FALSE;
+ return true;
+ return d == dt.d ? t <= dt.t : false;
}
/*!
- Returns TRUE if this datetime is later than \a dt; otherwise
- returns FALSE.
+ Returns true if this datetime is later than \a dt; otherwise
+ returns false.
*/
bool TQDateTime::operator>( const TQDateTime &dt ) const
{
if ( d > dt.d )
- return TRUE;
- return d == dt.d ? t > dt.t : FALSE;
+ return true;
+ return d == dt.d ? t > dt.t : false;
}
/*!
- Returns TRUE if this datetime is later than or equal to \a dt;
- otherwise returns FALSE.
+ Returns true if this datetime is later than or equal to \a dt;
+ otherwise returns false.
*/
bool TQDateTime::operator>=( const TQDateTime &dt ) const
{
if ( d > dt.d )
- return TRUE;
- return d == dt.d ? t >= dt.t : FALSE;
+ return true;
+ return d == dt.d ? t >= dt.t : false;
}
/*!