summaryrefslogtreecommitdiffstats
path: root/libtdepim
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2025-04-27 16:55:48 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-04-27 16:55:48 +0900
commit8f878546e0a859e78dfc2c6ff7f08507347a76ea (patch)
treef95c1e5a2f97a2e200be23cd5d6ffde91487bd1d /libtdepim
parent625d3c38cd3a49d07b6e1f511fe06d0792440791 (diff)
downloadtdepim-8f878546e0a859e78dfc2c6ff7f08507347a76ea.tar.gz
tdepim-8f878546e0a859e78dfc2c6ff7f08507347a76ea.zip
Replace TRUE/FALSE with boolean values true/false
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'libtdepim')
-rw-r--r--libtdepim/kpixmapregionselectorwidget.cpp12
-rw-r--r--libtdepim/kregexp3.h10
-rw-r--r--libtdepim/kwidgetlister.cpp2
-rw-r--r--libtdepim/ldapsearchdialog.cpp2
-rw-r--r--libtdepim/maillistdrag.cpp12
-rw-r--r--libtdepim/maillistdrag.h10
-rw-r--r--libtdepim/qutf7codec.cpp50
-rw-r--r--libtdepim/tdefileio.cpp16
-rw-r--r--libtdepim/tdefileio.h12
-rw-r--r--libtdepim/tests/testutf7encoder.cpp16
10 files changed, 71 insertions, 71 deletions
diff --git a/libtdepim/kpixmapregionselectorwidget.cpp b/libtdepim/kpixmapregionselectorwidget.cpp
index 9cfe8f00..6c9e09a0 100644
--- a/libtdepim/kpixmapregionselectorwidget.cpp
+++ b/libtdepim/kpixmapregionselectorwidget.cpp
@@ -223,7 +223,7 @@ bool KPixmapRegionSelectorWidget::eventFilter(TQObject *obj, TQEvent *ev)
TDEPopupMenu *popup = createPopupMenu( );
popup->exec( mev->globalPos() );
delete popup;
- return TRUE;
+ return true;
};
TQCursor cursor;
@@ -242,7 +242,7 @@ bool KPixmapRegionSelectorWidget::eventFilter(TQObject *obj, TQEvent *ev)
m_tempFirstClick=mev->pos();
- return TRUE;
+ return true;
}
if ( ev->type() == TQEvent::MouseMove )
@@ -281,7 +281,7 @@ bool KPixmapRegionSelectorWidget::eventFilter(TQObject *obj, TQEvent *ev)
m_selectedRegion.moveBy(0,m_originalPixmap.height()-m_selectedRegion.height()-m_selectedRegion.y());
mouseOutside=true;
}
- if (mouseOutside) { updatePixmap(); return TRUE; };
+ if (mouseOutside) { updatePixmap(); return true; };
m_selectedRegion.moveBy( mev->x()-m_tempFirstClick.x(),
mev->y()-m_tempFirstClick.y() );
@@ -300,7 +300,7 @@ bool KPixmapRegionSelectorWidget::eventFilter(TQObject *obj, TQEvent *ev)
m_tempFirstClick=mev->pos();
updatePixmap();
}
- return TRUE;
+ return true;
}
if ( ev->type() == TQEvent::MouseButtonRelease )
@@ -313,11 +313,11 @@ bool KPixmapRegionSelectorWidget::eventFilter(TQObject *obj, TQEvent *ev)
m_state=None;
TQApplication::restoreOverrideCursor();
- return TRUE;
+ return true;
}
TQWidget::eventFilter(obj, ev);
- return FALSE;
+ return false;
}
TQRect KPixmapRegionSelectorWidget::calcSelectionRectangle( const TQPoint & startPoint, const TQPoint & _endPoint )
diff --git a/libtdepim/kregexp3.h b/libtdepim/kregexp3.h
index 1bb3ac21..85c94d77 100644
--- a/libtdepim/kregexp3.h
+++ b/libtdepim/kregexp3.h
@@ -82,8 +82,8 @@ public:
KRegExp3()
: TQRegExp() {}
KRegExp3( const TQString & pattern,
- bool caseSensitive = TRUE,
- bool wildcard = FALSE )
+ bool caseSensitive = true,
+ bool wildcard = false )
: TQRegExp( pattern, caseSensitive, wildcard ) {}
KRegExp3( const TQRegExp & rx )
: TQRegExp( rx ) {}
@@ -99,13 +99,13 @@ public:
@param start Start position for the search.
If @p start is negative, starts @p -(start) positions
from the end of @p str.
- @param global If @p TRUE, requests to replace all occurrences
- of the regexp with @p replacementStr; if @p FALSE,
+ @param global If @p true, requests to replace all occurrences
+ of the regexp with @p replacementStr; if @p false,
only the first occurrence will be replaced.
Equivalent to the /g switch to perl's s/// operator.
@return The modified string.
*/
TQString replace( const TQString & str,
const TQString & replacementStr,
- int start=0, bool global=TRUE );
+ int start=0, bool global=true );
};
diff --git a/libtdepim/kwidgetlister.cpp b/libtdepim/kwidgetlister.cpp
index 0ad66de7..5ece6d4e 100644
--- a/libtdepim/kwidgetlister.cpp
+++ b/libtdepim/kwidgetlister.cpp
@@ -46,7 +46,7 @@
KWidgetLister::KWidgetLister( int minWidgets, int maxWidgets, TQWidget *parent, const char* name )
: TQWidget( parent, name )
{
- mWidgetList.setAutoDelete(TRUE);
+ mWidgetList.setAutoDelete(true);
mMinWidgets = TQMAX( minWidgets, 1 );
mMaxWidgets = TQMAX( maxWidgets, mMinWidgets + 1 );
diff --git a/libtdepim/ldapsearchdialog.cpp b/libtdepim/ldapsearchdialog.cpp
index 920b5a35..57f38862 100644
--- a/libtdepim/ldapsearchdialog.cpp
+++ b/libtdepim/ldapsearchdialog.cpp
@@ -62,7 +62,7 @@ static TQString join( const KPIM::LdapAttrValue& lst, const TQString& sep )
for ( KPIM::LdapAttrValue::ConstIterator it = lst.begin(); it != lst.end(); ++it ) {
if ( alredy )
res += sep;
- alredy = TRUE;
+ alredy = true;
res += asUtf8( *it );
}
return res;
diff --git a/libtdepim/maillistdrag.cpp b/libtdepim/maillistdrag.cpp
index adc7962a..f8932d12 100644
--- a/libtdepim/maillistdrag.cpp
+++ b/libtdepim/maillistdrag.cpp
@@ -155,9 +155,9 @@ bool MailListDrag::decode( TQDropEvent* e, MailList& mailList )
if ( payload.size() ) {
e->accept();
buffer >> mailList;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
bool MailListDrag::decode( TQByteArray& payload, MailList& mailList )
@@ -165,9 +165,9 @@ bool MailListDrag::decode( TQByteArray& payload, MailList& mailList )
TQDataStream stream( payload, IO_ReadOnly );
if ( payload.size() ) {
stream >> mailList;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
bool MailListDrag::decode( TQDropEvent* e, TQByteArray &a )
@@ -183,9 +183,9 @@ bool MailListDrag::decode( TQDropEvent* e, TQByteArray &a )
stream << mailDrag.serialNumber();
}
buffer.close();
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void MailListDrag::setMailList( MailList mailList )
diff --git a/libtdepim/maillistdrag.h b/libtdepim/maillistdrag.h
index 1e9e9681..496d6fb7 100644
--- a/libtdepim/maillistdrag.h
+++ b/libtdepim/maillistdrag.h
@@ -111,20 +111,20 @@ public:
/* The format for this drag - "x-kmail-drag/message-list" */
static const char* format();
- /* Returns TRUE if the information in e can be decoded into a TQString;
- otherwsie returns FALSE */
+ /* Returns true if the information in e can be decoded into a TQString;
+ otherwsie returns false */
static bool canDecode( TQMimeSource* e );
/* Attempts to decode the dropped information;
- Returns TRUE if successful; otherwise return false */
+ Returns true if successful; otherwise return false */
static bool decode( TQDropEvent* e, MailList& s );
/* Attempts to decode the serialNumbers of the dropped information;
- Returns TRUE if successful; otherwise return false */
+ Returns true if successful; otherwise return false */
static bool decode( TQDropEvent* e, TQByteArray& a );
/* Attempts to decode the encoded MailList;
- Returns TRUE if successful; otherwise return false */
+ Returns true if successful; otherwise return false */
static bool decode( TQByteArray& a, MailList& s );
private:
diff --git a/libtdepim/qutf7codec.cpp b/libtdepim/qutf7codec.cpp
index 78d709df..8624f2a1 100644
--- a/libtdepim/qutf7codec.cpp
+++ b/libtdepim/qutf7codec.cpp
@@ -48,11 +48,11 @@ const char* TQUtf7Codec::mimeName() const {
}
bool TQUtf7Codec::canEncode( TQChar ) const {
- return TRUE;
+ return true;
}
bool TQUtf7Codec::canEncode( const TQString & ) const {
- return TRUE;
+ return true;
}
static uchar base64Set[] = {
@@ -91,9 +91,9 @@ int TQUtf7Codec::heuristicContentMatch(const char* chars, int len) const
{
int stepNo = 0;
int i;
- bool shifted = FALSE;
- bool rightAfterEscape = FALSE;
- bool onlyNullBitsSinceLastBoundary = TRUE;
+ bool shifted = false;
+ bool rightAfterEscape = false;
+ bool onlyNullBitsSinceLastBoundary = true;
for ( i = 0; i < len ; i++ ) {
if ((unsigned char)chars[i] >= 128) // 8bit chars not allowed.
break;
@@ -101,7 +101,7 @@ int TQUtf7Codec::heuristicContentMatch(const char* chars, int len) const
if ( isOfSet(chars[i],base64Set) ) {
switch (stepNo) {
case 0:
- onlyNullBitsSinceLastBoundary = TRUE;
+ onlyNullBitsSinceLastBoundary = true;
break;
case 3:
onlyNullBitsSinceLastBoundary
@@ -117,19 +117,19 @@ int TQUtf7Codec::heuristicContentMatch(const char* chars, int len) const
= onlyNullBitsSinceLastBoundary && (chars[i] == 'A');
}
stepNo = (stepNo + 1) % 8;
- rightAfterEscape = FALSE;
+ rightAfterEscape = false;
} else {
if (rightAfterEscape && chars[i] != '-')
break; // a '+' must be followed by '-' or a base64 char
if (!onlyNullBitsSinceLastBoundary)
break; // non-zero bits in the tail of the base64 encoding
- shifted = FALSE;
+ shifted = false;
stepNo = 0;
}
} else {
if (chars[i] == '+') {
- shifted = TRUE;
- rightAfterEscape = TRUE;
+ shifted = true;
+ rightAfterEscape = true;
}
}
}
@@ -156,7 +156,7 @@ class TQUtf7Decoder : public TQTextDecoder {
// of a shifted-sequence.
bool rightAfterEscape;
public:
- TQUtf7Decoder() : uc(0), stepNo(0), shifted(FALSE), rightAfterEscape(FALSE)
+ TQUtf7Decoder() : uc(0), stepNo(0), shifted(false), rightAfterEscape(false)
{
}
@@ -165,8 +165,8 @@ private:
{
uc = 0;
stepNo = 0;
- shifted = FALSE;
- rightAfterEscape = FALSE;
+ shifted = false;
+ rightAfterEscape = false;
}
public:
@@ -279,7 +279,7 @@ public:
// increase the step counter
stepNo++;
stepNo %= 8;
- rightAfterEscape = FALSE;
+ rightAfterEscape = false;
// and look at the next char.
continue;
} // fi (still) shifted
@@ -295,11 +295,11 @@ public:
if ( ch == '+' ) {
// '+' is the escape char for entering a
// shifted sequence:
- shifted = TRUE;
+ shifted = true;
stepNo = 0;
// also, we're right at the beginning where
// special rules apply:
- rightAfterEscape = TRUE;
+ rightAfterEscape = true;
} else {
// US-ASCII values are directly used
result += TQChar(ch);
@@ -327,7 +327,7 @@ class TQUtf7Encoder : public TQTextEncoder {
public:
TQUtf7Encoder(bool encOpt, bool encLwsp)
: outbits(0), stepNo(0),
- shifted(FALSE), mayContinueShiftedSequence(FALSE)
+ shifted(false), mayContinueShiftedSequence(false)
{
for ( int i = 0; i < 16 ; i++) {
dontNeedEncodingSet[i] = directSet[i];
@@ -429,13 +429,13 @@ private:
} else if (mayContinueShiftedSequence) {
// if mayContinue is set, this means the
// shifted-sequence needs a lead-out.
- mayContinueShiftedSequence = FALSE;
+ mayContinueShiftedSequence = false;
if (isOfSet(ch,base64Set) || ch == '-' ) {
*t++ = '-';
}
}
*t++ = (uchar)ch;
- shifted = FALSE;
+ shifted = false;
stepNo = 0;
}
@@ -494,8 +494,8 @@ public:
// 24bits ("-+-") + some from ending the shifted-sequence
// with 21,33 bits
addToShiftedSequence(t,ch);
- mayContinueShiftedSequence = FALSE;
- shifted = TRUE;
+ mayContinueShiftedSequence = false;
+ shifted = true;
} else {
// shortcut encoding of '+':
*t++ = '+';
@@ -512,15 +512,15 @@ public:
stepNo = 0;
}
addToShiftedSequence(t,ch);
- shifted = TRUE;
- mayContinueShiftedSequence = FALSE;
+ shifted = true;
+ mayContinueShiftedSequence = false;
}
if ( shifted ) {
endShiftedSequence(t);
- mayContinueShiftedSequence = TRUE;
+ mayContinueShiftedSequence = true;
};
- shifted = FALSE;
+ shifted = false;
}
*t = '\0';
diff --git a/libtdepim/tdefileio.cpp b/libtdepim/tdefileio.cpp
index ce2e8068..7e423dc0 100644
--- a/libtdepim/tdefileio.cpp
+++ b/libtdepim/tdefileio.cpp
@@ -183,7 +183,7 @@ TDE_EXPORT bool kBytesToFile(const char* aBuffer, int len,
//assert(aFileName!=0);
if(aFileName.isEmpty())
- return FALSE;
+ return false;
if (file.exists())
{
@@ -194,7 +194,7 @@ TDE_EXPORT bool kBytesToFile(const char* aBuffer, int len,
.arg(aFileName);
rc = KMessageBox::warningContinueCancel(0,
str, i18n("Save to File"), i18n("&Replace"));
- if (rc != KMessageBox::Continue) return FALSE;
+ if (rc != KMessageBox::Continue) return false;
}
if (aBackup)
{
@@ -206,12 +206,12 @@ TDE_EXPORT bool kBytesToFile(const char* aBuffer, int len,
if( !TQDir::current().rename(aFileName, bakName) )
{
// failed to rename file
- if (!aVerbose) return FALSE;
+ if (!aVerbose) return false;
rc = KMessageBox::warningContinueCancel(0,
i18n("Failed to make a backup copy of %1.\nContinue anyway?")
.arg(aFileName),
i18n("Save to File"), KStdGuiItem::save() );
- if (rc != KMessageBox::Continue) return FALSE;
+ if (rc != KMessageBox::Continue) return false;
}
}
}
@@ -230,7 +230,7 @@ TDE_EXPORT bool kBytesToFile(const char* aBuffer, int len,
default:
msgDialog(i18n("Error while writing file:\n%1").arg(aFileName));
}
- return FALSE;
+ return false;
}
writeLen = file.writeBlock(aBuffer, len);
@@ -239,7 +239,7 @@ TDE_EXPORT bool kBytesToFile(const char* aBuffer, int len,
{
if (aVerbose)
msgDialog(i18n("Could not write to file:\n%1").arg(aFileName));
- return FALSE;
+ return false;
}
else if (writeLen < len)
{
@@ -247,10 +247,10 @@ TDE_EXPORT bool kBytesToFile(const char* aBuffer, int len,
.arg(writeLen).arg(len);
if (aVerbose)
msgDialog(msg);
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
TDE_EXPORT bool kCStringToFile(const TQCString& aBuffer, const TQString &aFileName,
diff --git a/libtdepim/tdefileio.h b/libtdepim/tdefileio.h
index baadf027..02a6f49f 100644
--- a/libtdepim/tdefileio.h
+++ b/libtdepim/tdefileio.h
@@ -19,11 +19,11 @@ namespace KPIM {
/** Load a file. Returns a pointer to the memory-block that contains
* the loaded file. Returns a null string if the file could not be loaded.
- * If withDialogs is FALSE no warning dialogs are opened if there are
+ * If withDialogs is false no warning dialogs are opened if there are
* problems.
* The string returned is always zero-terminated and therefore one
* byte longer than the file itself.
- * If ensureNewline is TRUE the string will always have a trailing newline.
+ * If ensureNewline is true the string will always have a trailing newline.
*/
TQCString kFileToString(const TQString &fileName, bool ensureNewline=true,
bool withDialogs=true) TDE_EXPORT;
@@ -32,10 +32,10 @@ TQCString kFileToString(const TQString &fileName, bool ensureNewline=true,
//TQByteArray kFileToBytes(const TQString &fileName, bool withDialogs=true);
-/** Save a file. If withDialogs is FALSE no warning dialogs are opened if
- * there are problems. Returns TRUE on success and FALSE on failure.
- * Replaces existing files without warning if askIfExists==FALSE.
- * Makes a copy if the file exists to filename~ if createBackup==TRUE.
+/** Save a file. If withDialogs is false no warning dialogs are opened if
+ * there are problems. Returns true on success and false on failure.
+ * Replaces existing files without warning if askIfExists==false.
+ * Makes a copy if the file exists to filename~ if createBackup==true.
*/
bool kBytesToFile(const char* aBuffer, int len,
const TQString &aFileName,
diff --git a/libtdepim/tests/testutf7encoder.cpp b/libtdepim/tests/testutf7encoder.cpp
index 46fbd4d8..6c67afb2 100644
--- a/libtdepim/tests/testutf7encoder.cpp
+++ b/libtdepim/tests/testutf7encoder.cpp
@@ -16,8 +16,8 @@ void main( int argc, char * argv[] ) {
<< "\"" << argv[1] << "\"\n" << endl;
cout << "Encode optional direct set and whitespace:\n" << endl;
- codec->setEncodeWhitespace(TRUE);
- codec->setEncodeOptionalDirect(TRUE);
+ codec->setEncodeWhitespace(true);
+ codec->setEncodeOptionalDirect(true);
enc = codec->makeEncoder();
len = arg.length();
@@ -40,8 +40,8 @@ void main( int argc, char * argv[] ) {
delete enc;
cout << "Encode optional direct set and not whitespace:\n" << endl;
- codec->setEncodeWhitespace(FALSE);
- codec->setEncodeOptionalDirect(TRUE);
+ codec->setEncodeWhitespace(false);
+ codec->setEncodeOptionalDirect(true);
enc = codec->makeEncoder();
len = arg.length();
@@ -52,8 +52,8 @@ void main( int argc, char * argv[] ) {
cout << "Don't encode optional direct set, but whitespace:\n" << endl;
- codec->setEncodeWhitespace(TRUE);
- codec->setEncodeOptionalDirect(FALSE);
+ codec->setEncodeWhitespace(true);
+ codec->setEncodeOptionalDirect(false);
enc = codec->makeEncoder();
len = arg.length();
@@ -64,8 +64,8 @@ void main( int argc, char * argv[] ) {
cout << "Encode neither optional direct set, nor whitespace:\n" << endl;
- codec->setEncodeWhitespace(FALSE);
- codec->setEncodeOptionalDirect(FALSE);
+ codec->setEncodeWhitespace(false);
+ codec->setEncodeOptionalDirect(false);
enc = codec->makeEncoder();
len = arg.length();