summaryrefslogtreecommitdiffstats
path: root/libkcal/incidenceformatter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libkcal/incidenceformatter.cpp')
-rw-r--r--libkcal/incidenceformatter.cpp146
1 files changed, 73 insertions, 73 deletions
diff --git a/libkcal/incidenceformatter.cpp b/libkcal/incidenceformatter.cpp
index ebfb68eab..d7dd97e4d 100644
--- a/libkcal/incidenceformatter.cpp
+++ b/libkcal/incidenceformatter.cpp
@@ -83,7 +83,7 @@ static TQString htmlAddTag( const TQString & tag, const TQString & text )
int pos = 0;
TQString tmp;
for( int i = 0; i <= numLineBreaks; i++ ) {
- pos = tmpText.find( "\n" );
+ pos = tmpText.tqfind( "\n" );
tmp = tmpText.left( pos );
tmpText = tmpText.right( tmpText.length() - pos - 1 );
tmpStr += tmp + "<br>";
@@ -184,7 +184,7 @@ static TQString displayViewLinkPerson( const TQString& email, TQString name, TQS
// and either name or uid is missing
if ( !email.isEmpty() && ( name.isEmpty() || uid.isEmpty() ) ) {
KABC::AddressBook *add_book = KABC::StdAddressBook::self( true );
- KABC::Addressee::List addressList = add_book->tqfindByEmail( email );
+ KABC::Addressee::List addressList = add_book->findByEmail( email );
if ( !addressList.isEmpty() ) {
KABC::Addressee o = addressList.first();
if ( !o.isEmpty() && addressList.size() < 2 ) {
@@ -195,7 +195,7 @@ static TQString displayViewLinkPerson( const TQString& email, TQString name, TQS
uid = o.uid();
} else {
// Email not found in the addressbook. Don't make a link
- uid = TQString::null;
+ uid = TQString();
}
}
}
@@ -275,7 +275,7 @@ static TQString displayViewFormatAttendees( Incidence *incidence )
tmpStr += "<td>" +
displayViewLinkPerson( incidence->organizer().email(),
incidence->organizer().name(),
- TQString::null ) +
+ TQString() ) +
"</td>";
tmpStr += "</tr>";
}
@@ -365,10 +365,10 @@ static TQString displayViewFormatCreationDate( Incidence *incidence )
static TQString displayViewFormatBirthday( Event *event )
{
if ( !event ) {
- return TQString::null;
+ return TQString();
}
if ( event->customProperty("KABC","BIRTHDAY") != "YES" ) {
- return TQString::null;
+ return TQString();
}
TQString uid = event->customProperty("KABC","UID-1");
@@ -452,7 +452,7 @@ static TQString displayViewFormatEvent( Calendar *calendar, Event *event,
const TQDate &date )
{
if ( !event ) {
- return TQString::null;
+ return TQString();
}
TQString tmpStr = displayViewFormatHeader( event );
@@ -625,7 +625,7 @@ static TQString displayViewFormatTodo( Calendar *calendar, Todo *todo,
const TQDate &date )
{
if ( !todo ) {
- return TQString::null;
+ return TQString();
}
TQString tmpStr = displayViewFormatHeader( todo );
@@ -775,7 +775,7 @@ static TQString displayViewFormatTodo( Calendar *calendar, Todo *todo,
static TQString displayViewFormatJournal( Calendar *calendar, Journal *journal )
{
if ( !journal ) {
- return TQString::null;
+ return TQString();
}
TQString tmpStr = displayViewFormatHeader( journal );
@@ -827,7 +827,7 @@ static TQString displayViewFormatJournal( Calendar *calendar, Journal *journal )
static TQString displayViewFormatFreeBusy( Calendar * /*calendar*/, FreeBusy *fb )
{
if ( !fb ) {
- return TQString::null;
+ return TQString();
}
TQString tmpStr = htmlAddTag( "h2",
@@ -934,14 +934,14 @@ TQString IncidenceFormatter::extensiveDisplayStr( Calendar *calendar,
const TQDate &date )
{
if ( !incidence ) {
- return TQString::null;
+ return TQString();
}
EventViewerVisitor v;
if ( v.act( calendar, incidence, date ) ) {
return v.result();
} else {
- return TQString::null;
+ return TQString();
}
}
@@ -1135,7 +1135,7 @@ static TQString invitationPerson( const TQString& email, TQString name, TQString
// and either name or uid is missing
if ( !email.isEmpty() && ( name.isEmpty() || uid.isEmpty() ) ) {
KABC::AddressBook *add_book = KABC::StdAddressBook::self( true );
- KABC::Addressee::List addressList = add_book->tqfindByEmail( email );
+ KABC::Addressee::List addressList = add_book->findByEmail( email );
if ( !addressList.isEmpty() ) {
KABC::Addressee o = addressList.first();
if ( !o.isEmpty() && addressList.size() < 2 ) {
@@ -1146,7 +1146,7 @@ static TQString invitationPerson( const TQString& email, TQString name, TQString
uid = o.uid();
} else {
// Email not found in the addressbook. Don't make a link
- uid = TQString::null;
+ uid = TQString();
}
}
}
@@ -1274,7 +1274,7 @@ static TQString invitationDetailsEvent( Event* event, bool noHtmlMode )
{
// Invitation details are formatted into an HTML table
if ( !event ) {
- return TQString::null;
+ return TQString();
}
TQString sSummary = i18n( "Summary unspecified" );
@@ -1347,7 +1347,7 @@ static TQString invitationDetailsEvent( Event* event, bool noHtmlMode )
// }
// Invitation Duration Row
- QString durStr = IncidenceFormatter::durationString( event );
+ TQString durStr = IncidenceFormatter::durationString( event );
if ( !durStr.isEmpty() ) {
html += invitationRow( i18n( "Duration:" ), durStr );
}
@@ -1385,7 +1385,7 @@ static TQString invitationDetailsTodo( Todo *todo, bool noHtmlMode )
{
// Task details are formatted into an HTML table
if ( !todo ) {
- return TQString::null;
+ return TQString();
}
TQString sSummary = i18n( "Summary unspecified" );
@@ -1449,7 +1449,7 @@ static TQString invitationDetailsTodo( Todo *todo, bool noHtmlMode )
static TQString invitationDetailsJournal( Journal *journal, bool noHtmlMode )
{
if ( !journal ) {
- return TQString::null;
+ return TQString();
}
TQString sSummary = i18n( "Summary unspecified" );
@@ -1480,7 +1480,7 @@ static TQString invitationDetailsJournal( Journal *journal, bool noHtmlMode )
static TQString invitationDetailsFreeBusy( FreeBusy *fb, bool /*noHtmlMode*/ )
{
if ( !fb )
- return TQString::null;
+ return TQString();
TQString html( "<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\">\n" );
html += invitationRow( i18n("Person:"), fb->organizer().fullName() );
@@ -1510,7 +1510,7 @@ static TQString invitationDetailsFreeBusy( FreeBusy *fb, bool /*noHtmlMode*/ )
if ( dur > 0 ) {
cont += i18n("1 second", "%n seconds", dur);
}
- html += invitationRow( TQString::null, i18n("startDate for duration", "%1 for %2")
+ html += invitationRow( TQString(), i18n("startDate for duration", "%1 for %2")
.arg( KGlobal::locale()->formatDateTime( per.start(), false ) )
.arg(cont) );
} else {
@@ -1526,7 +1526,7 @@ static TQString invitationDetailsFreeBusy( FreeBusy *fb, bool /*noHtmlMode*/ )
.arg( KGlobal::locale()->formatDateTime( per.end(), false ) );
}
- html += invitationRow( TQString::null, cont );
+ html += invitationRow( TQString(), cont );
}
}
@@ -1557,7 +1557,7 @@ static TQString invitationHeaderEvent( Event *event, Incidence *existingIncidenc
ScheduleMessage *msg, const TQString &sender )
{
if ( !msg || !event )
- return TQString::null;
+ return TQString();
switch ( msg->method() ) {
case Scheduler::Publish:
@@ -1608,7 +1608,7 @@ static TQString invitationHeaderEvent( Event *event, Incidence *existingIncidenc
Attendee::List attendees = event->attendees();
if( attendees.count() == 0 ) {
kdDebug(5850) << "No attendees in the iCal reply!" << endl;
- return TQString::null;
+ return TQString();
}
if( attendees.count() != 1 ) {
kdDebug(5850) << "Warning: attendeecount in the reply should be 1 "
@@ -1692,14 +1692,14 @@ static TQString invitationHeaderEvent( Event *event, Incidence *existingIncidenc
return i18n("Error: iMIP message with unknown method: '%1'").
arg( msg->method() );
}
- return TQString::null;
+ return TQString();
}
static TQString invitationHeaderTodo( Todo *todo, Incidence *existingIncidence,
ScheduleMessage *msg, const TQString &sender )
{
if ( !msg || !todo ) {
- return TQString::null;
+ return TQString();
}
switch ( msg->method() ) {
@@ -1752,7 +1752,7 @@ static TQString invitationHeaderTodo( Todo *todo, Incidence *existingIncidence,
Attendee::List attendees = todo->attendees();
if( attendees.count() == 0 ) {
kdDebug(5850) << "No attendees in the iCal reply!" << endl;
- return TQString::null;
+ return TQString();
}
if( attendees.count() != 1 ) {
kdDebug(5850) << "Warning: attendeecount in the reply should be 1 "
@@ -1845,13 +1845,13 @@ static TQString invitationHeaderTodo( Todo *todo, Incidence *existingIncidence,
return i18n( "Error: iMIP message with unknown method: '%1'" ).
arg( msg->method() );
}
- return TQString::null;
+ return TQString();
}
static TQString invitationHeaderJournal( Journal *journal, ScheduleMessage *msg )
{
if ( !msg || !journal ) {
- return TQString::null;
+ return TQString();
}
switch ( msg->method() ) {
@@ -1874,7 +1874,7 @@ static TQString invitationHeaderJournal( Journal *journal, ScheduleMessage *msg
Attendee::List attendees = journal->attendees();
if( attendees.count() == 0 ) {
kdDebug(5850) << "No attendees in the iCal reply!" << endl;
- return TQString::null;
+ return TQString();
}
if( attendees.count() != 1 ) {
kdDebug(5850) << "Warning: attendeecount in the reply should be 1 "
@@ -1910,13 +1910,13 @@ static TQString invitationHeaderJournal( Journal *journal, ScheduleMessage *msg
return i18n("Error: iMIP message with unknown method: '%1'").
arg( msg->method() );
}
- return TQString::null;
+ return TQString();
}
static TQString invitationHeaderFreeBusy( FreeBusy *fb, ScheduleMessage *msg )
{
if ( !msg || !fb ) {
- return TQString::null;
+ return TQString();
}
switch ( msg->method() ) {
@@ -1965,7 +1965,7 @@ static TQString invitationAttendees( Incidence *incidence )
}
tmpStr += "<tr>";
tmpStr += "<td>";
- tmpStr += invitationPerson( a->email(), a->name(), TQString::null );
+ tmpStr += invitationPerson( a->email(), a->name(), TQString() );
if ( !a->delegator().isEmpty() ) {
tmpStr += i18n(" (delegated by %1)" ).arg( a->delegator() );
}
@@ -2117,7 +2117,7 @@ class IncidenceFormatter::IncidenceCompareVisitor
TQString result() const
{
if ( mChanges.isEmpty() ) {
- return TQString::null;
+ return TQString();
}
TQString html = "<div align=\"left\"><ul><li>";
html += mChanges.join( "</li><li>" );
@@ -2388,7 +2388,7 @@ TQString IncidenceFormatter::formatICalInvitationHelper( TQString invitation,
const TQString &sender )
{
if ( invitation.isEmpty() ) {
- return TQString::null;
+ return TQString();
}
ICalFormat format;
@@ -2399,7 +2399,7 @@ TQString IncidenceFormatter::formatICalInvitationHelper( TQString invitation,
kdDebug( 5850 ) << "Failed to parse the scheduling message" << endl;
Q_ASSERT( format.exception() );
kdDebug( 5850 ) << format.exception()->message() << endl;
- return TQString::null;
+ return TQString();
}
IncidenceBase *incBase = msg->event();
@@ -2437,12 +2437,12 @@ TQString IncidenceFormatter::formatICalInvitationHelper( TQString invitation,
InvitationHeaderVisitor headerVisitor;
// The InvitationHeaderVisitor returns false if the incidence is somehow invalid, or not handled
if ( !headerVisitor.act( incBase, existingIncidence, msg, sender ) )
- return TQString::null;
+ return TQString();
html += "<b>" + headerVisitor.result() + "</b>";
InvitationBodyVisitor bodyVisitor( noHtmlMode );
if ( !bodyVisitor.act( incBase, existingIncidence, msg, sender ) )
- return TQString::null;
+ return TQString();
html += bodyVisitor.result();
if ( msg->method() == Scheduler::Request ) {
@@ -2702,14 +2702,14 @@ TQString IncidenceFormatter::formatICalInvitationNoHtml( TQString invitation,
//-----------------------------------------------------------------------------
static TQString stringProp( KTNEFMessage* tnefMsg, const TQ_UINT32& key,
- const TQString& fallback = TQString::null)
+ const TQString& fallback = TQString())
{
return tnefMsg->findProp( key < 0x10000 ? key & 0xFFFF : key >> 16,
fallback );
}
static TQString sNamedProp( KTNEFMessage* tnefMsg, const TQString& name,
- const TQString& fallback = TQString::null )
+ const TQString& fallback = TQString() )
{
return tnefMsg->findNamedProp( name, fallback );
}
@@ -2782,7 +2782,7 @@ static TQDateTime utc2Local( const TQDateTime& utcdt )
}
-static TQDateTime pureISOToLocalQDateTime( const TQString& dtStr,
+static TQDateTime pureISOToLocalTQDateTime( const TQString& dtStr,
bool bDateOnly = false )
{
TQDate tmpDate;
@@ -2843,7 +2843,7 @@ TQString IncidenceFormatter::msTNEFToVPart( const TQByteArray& tnef )
// Everything depends from property PR_MESSAGE_CLASS
// (this is added by KTNEFParser):
- TQString msgClass = tnefMsg->findProp( 0x001A, TQString::null, true )
+ TQString msgClass = tnefMsg->findProp( 0x001A, TQString(), true )
.upper();
if( !msgClass.isEmpty() ) {
// Match the old class names that might be used by Outlook for
@@ -2907,9 +2907,9 @@ TQString IncidenceFormatter::msTNEFToVPart( const TQByteArray& tnef )
TQString sSenderSearchKeyEmail( tnefMsg->findProp( 0x0C1D ) );
if( !sSenderSearchKeyEmail.isEmpty() ) {
- int colon = sSenderSearchKeyEmail.find( ':' );
+ int colon = sSenderSearchKeyEmail.tqfind( ':' );
// May be e.g. "SMTP:KHZ@KDE.ORG"
- if( sSenderSearchKeyEmail.find( ':' ) == -1 )
+ if( sSenderSearchKeyEmail.tqfind( ':' ) == -1 )
sSenderSearchKeyEmail.remove( 0, colon+1 );
}
@@ -2920,19 +2920,19 @@ TQString IncidenceFormatter::msTNEFToVPart( const TQByteArray& tnef )
it != attendees.end(); ++it ) {
// Skip all entries that have no '@' since these are
// no mail addresses
- if( (*it).find('@') == -1 ) {
+ if( (*it).tqfind('@') == -1 ) {
s = (*it).stripWhiteSpace();
Attendee *attendee = new Attendee( s, s, true );
if( bIsReply ) {
if( bCompatMethodAccepted )
- attendee->seStatus( Attendee::Accepted );
+ attendee->setqStatus( Attendee::Accepted );
if( bCompatMethodDeclined )
- attendee->seStatus( Attendee::Declined );
+ attendee->setqStatus( Attendee::Declined );
if( bCompatMethodAcceptedCond )
- attendee->seStatus(Attendee::Tentative);
+ attendee->setqStatus(Attendee::Tentative);
} else {
- attendee->seStatus( Attendee::NeedsAction );
+ attendee->setqStatus( Attendee::NeedsAction );
attendee->setRole( Attendee::ReqParticipant );
}
event->addAttendee(attendee);
@@ -2943,17 +2943,17 @@ TQString IncidenceFormatter::msTNEFToVPart( const TQByteArray& tnef )
// This must be old style, let us use the PR_SENDER_SEARCH_KEY.
s = sSenderSearchKeyEmail;
if( !s.isEmpty() ) {
- Attendee *attendee = new Attendee( TQString::null, TQString::null,
+ Attendee *attendee = new Attendee( TQString(), TQString(),
true );
if( bIsReply ) {
if( bCompatMethodAccepted )
- attendee->seStatus( Attendee::Accepted );
+ attendee->setqStatus( Attendee::Accepted );
if( bCompatMethodAcceptedCond )
- attendee->seStatus( Attendee::Declined );
+ attendee->setqStatus( Attendee::Declined );
if( bCompatMethodDeclined )
- attendee->seStatus( Attendee::Tentative );
+ attendee->setqStatus( Attendee::Tentative );
} else {
- attendee->seStatus(Attendee::NeedsAction);
+ attendee->setqStatus(Attendee::NeedsAction);
attendee->setRole(Attendee::ReqParticipant);
}
event->addAttendee(attendee);
@@ -2966,12 +2966,12 @@ TQString IncidenceFormatter::msTNEFToVPart( const TQByteArray& tnef )
if( !s.isEmpty() )
event->setOrganizer( s );
- s = tnefMsg->findProp( 0x8516 ).tqreplace( TQChar( '-' ), TQString::null )
- .tqreplace( TQChar( ':' ), TQString::null );
+ s = tnefMsg->findProp( 0x8516 ).tqreplace( TQChar( '-' ), TQString() )
+ .tqreplace( TQChar( ':' ), TQString() );
event->setDtStart( TQDateTime::fromString( s ) ); // ## Format??
- s = tnefMsg->findProp( 0x8517 ).tqreplace( TQChar( '-' ), TQString::null )
- .tqreplace( TQChar( ':' ), TQString::null );
+ s = tnefMsg->findProp( 0x8517 ).tqreplace( TQChar( '-' ), TQString() )
+ .tqreplace( TQChar( ':' ), TQString() );
event->setDtEnd( TQDateTime::fromString( s ) );
s = tnefMsg->findProp( 0x8208 );
@@ -2988,8 +2988,8 @@ TQString IncidenceFormatter::msTNEFToVPart( const TQByteArray& tnef )
// PENDING(khz): is this value in local timezone? Must it be
// adjusted? Most likely this is a bug in the server or in
// Outlook - we ignore it for now.
- s = tnefMsg->findProp( 0x8202 ).tqreplace( TQChar( '-' ), TQString::null )
- .tqreplace( TQChar( ':' ), TQString::null );
+ s = tnefMsg->findProp( 0x8202 ).tqreplace( TQChar( '-' ), TQString() )
+ .tqreplace( TQChar( ':' ), TQString() );
// ### libkcal always uses tqcurrentDateTime()
// event->setDtStamp(TQDateTime::fromString(s));
@@ -3009,11 +3009,11 @@ TQString IncidenceFormatter::msTNEFToVPart( const TQByteArray& tnef )
if(!tnefMsg->findProp(0x8503).isEmpty()) {
Alarm *alarm = new Alarm(event);
TQDateTime highNoonTime =
- pureISOToLocalQDateTime( tnefMsg->findProp( 0x8502 )
+ pureISOToLocalTQDateTime( tnefMsg->findProp( 0x8502 )
.tqreplace( TQChar( '-' ), "" )
.tqreplace( TQChar( ':' ), "" ) );
TQDateTime wakeMeUpTime =
- pureISOToLocalQDateTime( tnefMsg->findProp( 0x8560, "" )
+ pureISOToLocalTQDateTime( tnefMsg->findProp( 0x8560, "" )
.tqreplace( TQChar( '-' ), "" )
.tqreplace( TQChar( ':' ), "" ) );
alarm->setTime(wakeMeUpTime);
@@ -3047,8 +3047,8 @@ TQString IncidenceFormatter::msTNEFToVPart( const TQByteArray& tnef )
addressee.insertCustom( "KADDRESSBOOK", "X-Profession", stringProp( tnefMsg, MAPI_TAG_PR_PROFESSION ) );
TQString s = tnefMsg->findProp( MAPI_TAG_PR_WEDDING_ANNIVERSARY )
- .tqreplace( TQChar( '-' ), TQString::null )
- .tqreplace( TQChar( ':' ), TQString::null );
+ .tqreplace( TQChar( '-' ), TQString() )
+ .tqreplace( TQChar( ':' ), TQString() );
if( !s.isEmpty() )
addressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", s );
@@ -3114,8 +3114,8 @@ TQString IncidenceFormatter::msTNEFToVPart( const TQByteArray& tnef )
addressee.insertPhoneNumber( KABC::PhoneNumber( nr, KABC::PhoneNumber::Fax | KABC::PhoneNumber::Work ) );
s = tnefMsg->findProp( MAPI_TAG_PR_BIRTHDAY )
- .tqreplace( TQChar( '-' ), TQString::null )
- .tqreplace( TQChar( ':' ), TQString::null );
+ .tqreplace( TQChar( '-' ), TQString() )
+ .tqreplace( TQChar( ':' ), TQString() );
if( !s.isEmpty() )
addressee.setBirthday( TQDateTime::fromString( s ) );
@@ -3361,7 +3361,7 @@ static TQString tooltipPerson( const TQString& email, TQString name )
// and name is missing
if ( name.isEmpty() && !email.isEmpty() ) {
KABC::AddressBook *add_book = KABC::StdAddressBook::self( true );
- KABC::Addressee::List addressList = add_book->tqfindByEmail( email );
+ KABC::Addressee::List addressList = add_book->findByEmail( email );
if ( !addressList.isEmpty() ) {
KABC::Addressee o = addressList.first();
if ( !o.isEmpty() && addressList.size() < 2 ) {
@@ -3469,7 +3469,7 @@ TQString IncidenceFormatter::ToolTipVisitor::generateToolTip( Incidence* inciden
uint maxDescLen = 120; // maximum description chars to print (before elipsis)
if ( !incidence ) {
- return TQString::null;
+ return TQString();
}
TQString tmp = "<qt>";
@@ -3554,7 +3554,7 @@ TQString IncidenceFormatter::toolTipStr( Calendar *calendar,
if ( v.act( calendar, incidence, date, richText ) ) {
return v.result();
} else {
- return TQString::null;
+ return TQString();
}
}
@@ -3709,13 +3709,13 @@ bool IncidenceFormatter::MailBodyVisitor::visit( Journal *journal )
TQString IncidenceFormatter::mailBodyString( IncidenceBase *incidence )
{
if ( !incidence )
- return TQString::null;
+ return TQString();
MailBodyVisitor v;
if ( v.act( incidence ) ) {
return v.result();
}
- return TQString::null;
+ return TQString();
}
static TQString recurEnd( Incidence *incidence )
@@ -4039,12 +4039,12 @@ TQString IncidenceFormatter::dateTimeToString( const TQDateTime &date,
TQString IncidenceFormatter::resourceString( Calendar *calendar, Incidence *incidence )
{
if ( !calendar || !incidence ) {
- return TQString::null;
+ return TQString();
}
CalendarResources *calendarResource = dynamic_cast<CalendarResources*>( calendar );
if ( !calendarResource ) {
- return TQString::null;
+ return TQString();
}
ResourceCalendar *resourceCalendar = calendarResource->resource( incidence );
@@ -4060,7 +4060,7 @@ TQString IncidenceFormatter::resourceString( Calendar *calendar, Incidence *inci
return resourceCalendar->resourceName();
}
- return TQString::null;
+ return TQString();
}
static TQString secs2Duration( int secs )