summaryrefslogtreecommitdiffstats
path: root/kmail/mailinglist-magic.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
commit67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch)
tree5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /kmail/mailinglist-magic.cpp
parent2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff)
downloadtdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz
tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4, however Qt3 builds are OK. Any alterations this commit makes to kdepim behaviour under Qt3 are unintentional and should be fixed. git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/mailinglist-magic.cpp')
-rw-r--r--kmail/mailinglist-magic.cpp84
1 files changed, 42 insertions, 42 deletions
diff --git a/kmail/mailinglist-magic.cpp b/kmail/mailinglist-magic.cpp
index 4483323de..3c9efd147 100644
--- a/kmail/mailinglist-magic.cpp
+++ b/kmail/mailinglist-magic.cpp
@@ -25,18 +25,18 @@ static TQString check_sender(const KMMessage *message,
TQString header = message->headerField( "Sender" );
if ( header.isEmpty() )
- return TQString::null;
+ return TQString();
if ( header.left( 6 ) == "owner-" )
{
header_name = "Sender";
header_value = header;
- header = header.mid( 6, header.find( '@' ) - 6 );
+ header = header.mid( 6, header.tqfind( '@' ) - 6 );
} else {
- int index = header.find( "-owner@ " );
+ int index = header.tqfind( "-owner@ " );
if ( index == -1 )
- return TQString::null;
+ return TQString();
header.truncate( index );
header_name = "Sender";
@@ -52,12 +52,12 @@ static TQString check_x_beenthere(const KMMessage *message,
TQString &header_value )
{
TQString header = message->headerField( "X-BeenThere" );
- if ( header.isNull() || header.find( '@' ) == -1 )
- return TQString::null;
+ if ( header.isNull() || header.tqfind( '@' ) == -1 )
+ return TQString();
header_name = "X-BeenThere";
header_value = header;
- header.truncate( header.find( '@' ) );
+ header.truncate( header.tqfind( '@' ) );
return header;
}
@@ -68,13 +68,13 @@ static TQString check_delivered_to(const KMMessage *message,
{
TQString header = message->headerField( "Delivered-To" );
if ( header.isNull() || header.left(13 ) != "mailing list"
- || header.find( '@' ) == -1 )
- return TQString::null;
+ || header.tqfind( '@' ) == -1 )
+ return TQString();
header_name = "Delivered-To";
header_value = header;
- return header.mid( 13, header.find( '@' ) - 13 );
+ return header.mid( 13, header.tqfind( '@' ) - 13 );
}
/* X-Mailing-List: <?([^@]+) */
@@ -84,17 +84,17 @@ static TQString check_x_mailing_list(const KMMessage *message,
{
TQString header = message->headerField( "X-Mailing-List");
if ( header.isEmpty() )
- return TQString::null;
+ return TQString();
- if ( header.find( '@' ) < 1 )
- return TQString::null;
+ if ( header.tqfind( '@' ) < 1 )
+ return TQString();
header_name = "X-Mailing-List";
header_value = header;
if ( header[0] == '<' )
- header = header.mid(1, header.find( '@' ) - 1);
+ header = header.mid(1, header.tqfind( '@' ) - 1);
else
- header.truncate( header.find( '@' ) );
+ header.truncate( header.tqfind( '@' ) );
return header;
}
@@ -106,15 +106,15 @@ static TQString check_list_id(const KMMessage *message,
int lAnglePos, firstDotPos;
TQString header = message->headerField( "List-Id" );
if ( header.isEmpty() )
- return TQString::null;
+ return TQString();
- lAnglePos = header.find( '<' );
+ lAnglePos = header.tqfind( '<' );
if ( lAnglePos < 0 )
- return TQString::null;
+ return TQString();
- firstDotPos = header.find( '.', lAnglePos );
+ firstDotPos = header.tqfind( '.', lAnglePos );
if ( firstDotPos < 0 )
- return TQString::null;
+ return TQString();
header_name = "List-Id";
header_value = header.mid( lAnglePos );
@@ -130,16 +130,16 @@ static TQString check_list_post(const KMMessage *message,
{
TQString header = message->headerField( "List-Post" );
if ( header.isEmpty() )
- return TQString::null;
+ return TQString();
- int lAnglePos = header.find( "<mailto:" );
+ int lAnglePos = header.tqfind( "<mailto:" );
if ( lAnglePos < 0 )
- return TQString::null;
+ return TQString();
header_name = "List-Post";
header_value = header;
header = header.mid( lAnglePos + 8, header.length());
- header.truncate( header.find('@') );
+ header.truncate( header.tqfind('@') );
return header;
}
@@ -150,14 +150,14 @@ static TQString check_mailing_list(const KMMessage *message,
{
TQString header = message->headerField( "Mailing-List");
if ( header.isEmpty() )
- return TQString::null;
+ return TQString();
- if (header.left( 5 ) != "list " || header.find( '@' ) < 5 )
- return TQString::null;
+ if (header.left( 5 ) != "list " || header.tqfind( '@' ) < 5 )
+ return TQString();
header_name = "Mailing-List";
header_value = header;
- header = header.mid(5, header.find( '@' ) - 5);
+ header = header.mid(5, header.tqfind( '@' ) - 5);
return header;
}
@@ -168,14 +168,14 @@ static TQString check_x_loop(const KMMessage *message,
TQString &header_value ){
TQString header = message->headerField( "X-Loop");
if ( header.isEmpty() )
- return TQString::null;
+ return TQString();
- if (header.find( '@' ) < 2 )
- return TQString::null;
+ if (header.tqfind( '@' ) < 2 )
+ return TQString();
header_name = "X-Loop";
header_value = header;
- header.truncate(header.find( '@' ));
+ header.truncate(header.tqfind( '@' ));
return header;
}
@@ -185,11 +185,11 @@ static TQString check_x_ml_name(const KMMessage *message,
TQString &header_value ){
TQString header = message->headerField( "X-ML-Name");
if ( header.isEmpty() )
- return TQString::null;
+ return TQString();
header_name = "X-ML-Name";
header_value = header;
- header.truncate(header.find( '@' ));
+ header.truncate(header.tqfind( '@' ));
return header;
}
@@ -208,7 +208,7 @@ MagicDetectorFunc magic_detector[] =
static const int num_detectors = sizeof (magic_detector) / sizeof (magic_detector[0]);
-static QStringList
+static TQStringList
headerToAddress( const TQString& header )
{
TQStringList addr;
@@ -218,8 +218,8 @@ headerToAddress( const TQString& header )
if ( header.isEmpty() )
return addr;
- while ( (start = header.find( "<", start )) != -1 ) {
- if ( (end = header.find( ">", ++start ) ) == -1 ) {
+ while ( (start = header.tqfind( "<", start )) != -1 ) {
+ if ( (end = header.tqfind( ">", ++start ) ) == -1 ) {
kdDebug(5006)<<k_funcinfo<<"Serious mailing list header parsing error !"<<endl;
return addr;
}
@@ -249,16 +249,16 @@ MailingList::detect( const KMMessage *message )
return mlist;
}
-QString
+TQString
MailingList::name( const KMMessage *message, TQCString &header_name,
TQString &header_value )
{
TQString mlist;
header_name = TQCString();
- header_value = TQString::null;
+ header_value = TQString();
if ( !message )
- return TQString::null;
+ return TQString();
for (int i = 0; i < num_detectors; i++) {
mlist = magic_detector[i] (message, header_name, header_value);
@@ -266,7 +266,7 @@ MailingList::name( const KMMessage *message, TQCString &header_name,
return mlist;
}
- return TQString::null;
+ return TQString();
}
MailingList::MailingList()
@@ -379,7 +379,7 @@ MailingList::setId( const TQString& str )
mId = str;
}
-QString
+TQString
MailingList::id() const
{
return mId;