From 7be55ffa061c026e35e2d6a0effe1161ddb0d41f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:53:50 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- libkcal/htmlexport.cpp | 124 ++++++++++++++++++++++++------------------------- 1 file changed, 62 insertions(+), 62 deletions(-) (limited to 'libkcal/htmlexport.cpp') diff --git a/libkcal/htmlexport.cpp b/libkcal/htmlexport.cpp index 8d1570159..fd994fca2 100644 --- a/libkcal/htmlexport.cpp +++ b/libkcal/htmlexport.cpp @@ -20,11 +20,11 @@ Boston, MA 02110-1301, USA. */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -49,29 +49,29 @@ HtmlExport::HtmlExport( Calendar *calendar, HTMLExportSettings *settings ) : { } -bool HtmlExport::save( const QString &fileName ) +bool HtmlExport::save( const TQString &fileName ) { - QString fn( fileName ); + TQString fn( fileName ); if ( fn.isEmpty() && mSettings ) { fn = mSettings->outputFile(); } if ( !mSettings || fn.isEmpty() ) { return false; } - QFile f( fileName ); + TQFile f( fileName ); if ( !f.open(IO_WriteOnly)) { return false; } - QTextStream ts(&f); + TQTextStream ts(&f); bool success = save(&ts); f.close(); return success; } -bool HtmlExport::save(QTextStream *ts) +bool HtmlExport::save(TQTextStream *ts) { if ( !mSettings ) return false; - ts->setEncoding( QTextStream::UnicodeUTF8 ); + ts->setEncoding( TQTextStream::UnicodeUTF8 ); // Write HTML header *ts << "" << QString::number(start.day()); + *ts << ">" << TQString::number(start.day()); if (mHolidayMap.contains(start)) { *ts << " " << mHolidayMap[start] << ""; @@ -216,7 +216,7 @@ void HtmlExport::createMonthView(QTextStream *ts) } } -void HtmlExport::createEventList (QTextStream *ts) +void HtmlExport::createEventList (TQTextStream *ts) { int columns = 3; *ts << "\n"; @@ -239,7 +239,7 @@ void HtmlExport::createEventList (QTextStream *ts) *ts << " \n"; - for ( QDate dt = fromDate(); dt <= toDate(); dt = dt.addDays(1) ) { + for ( TQDate dt = fromDate(); dt <= toDate(); dt = dt.addDays(1) ) { kdDebug(5850) << "Getting events for " << dt.toString() << endl; Event::List events = mCalendar->events(dt, EventSortStartDate, @@ -250,7 +250,7 @@ void HtmlExport::createEventList (QTextStream *ts) for( it = events.begin(); it != events.end(); ++it ) { if ( checkSecrecy( *it ) ) { if ( first ) { - *ts << " \n"; @@ -265,8 +265,8 @@ void HtmlExport::createEventList (QTextStream *ts) *ts << "
" << KGlobal::locale()->formatDate(dt) << "
\n"; } -void HtmlExport::createEvent (QTextStream *ts, Event *event, - QDate date,bool withDescription) +void HtmlExport::createEvent (TQTextStream *ts, Event *event, + TQDate date,bool withDescription) { kdDebug(5850) << "HtmlExport::createEvent(): " << event->summary() << endl; *ts << " \n"; @@ -314,7 +314,7 @@ void HtmlExport::createEvent (QTextStream *ts, Event *event, *ts << " \n"; } -void HtmlExport::createTodoList ( QTextStream *ts ) +void HtmlExport::createTodoList ( TQTextStream *ts ) { Todo::List rawTodoList = mCalendar->todos(); @@ -386,7 +386,7 @@ void HtmlExport::createTodoList ( QTextStream *ts ) // Generate sub-task list of event ev *ts << " \n"; *ts << " uid() << "\">" << i18n("Sub-Tasks of: ") << "uid() << "\">" << cleanChars( (*it)->summary()) @@ -419,7 +419,7 @@ void HtmlExport::createTodoList ( QTextStream *ts ) *ts << "\n"; } -void HtmlExport::createTodo (QTextStream *ts,Todo *todo) +void HtmlExport::createTodo (TQTextStream *ts,Todo *todo) { kdDebug(5850) << "HtmlExport::createTodo()" << endl; @@ -493,18 +493,18 @@ void HtmlExport::createTodo (QTextStream *ts,Todo *todo) *ts << "\n"; } -void HtmlExport::createWeekView( QTextStream */*ts*/ ) +void HtmlExport::createWeekView( TQTextStream */*ts*/ ) { // FIXME: Implement this! } -void HtmlExport::createJournalView( QTextStream */*ts*/ ) +void HtmlExport::createJournalView( TQTextStream */*ts*/ ) { // Journal::List rawJournalList = mCalendar->journals(); // FIXME: Implement this! } -void HtmlExport::createFreeBusyView( QTextStream */*ts*/ ) +void HtmlExport::createFreeBusyView( TQTextStream */*ts*/ ) { // FIXME: Implement this! } @@ -525,7 +525,7 @@ bool HtmlExport::checkSecrecy( Incidence *incidence ) return false; } -void HtmlExport::formatLocation (QTextStream *ts,Incidence *event) +void HtmlExport::formatLocation (TQTextStream *ts,Incidence *event) { if (!event->location().isEmpty()) { *ts << " " << cleanChars(event->location()) << "\n"; @@ -534,7 +534,7 @@ void HtmlExport::formatLocation (QTextStream *ts,Incidence *event) } } -void HtmlExport::formatCategories (QTextStream *ts,Incidence *event) +void HtmlExport::formatCategories (TQTextStream *ts,Incidence *event) { if (!event->categoriesStr().isEmpty()) { *ts << " " << cleanChars(event->categoriesStr()) << "\n"; @@ -543,7 +543,7 @@ void HtmlExport::formatCategories (QTextStream *ts,Incidence *event) } } -void HtmlExport::formatAttendees( QTextStream *ts, Incidence *event ) +void HtmlExport::formatAttendees( TQTextStream *ts, Incidence *event ) { Attendee::List attendees = event->attendees(); if (attendees.count()) { @@ -579,16 +579,16 @@ void HtmlExport::formatAttendees( QTextStream *ts, Incidence *event ) } } -QString HtmlExport::breakString(const QString &text) +TQString HtmlExport::breakString(const TQString &text) { int number = text.contains("\n"); if(number < 0) { return text; } else { - QString out; - QString tmpText = text; + TQString out; + TQString tmpText = text; int pos = 0; - QString tmp; + TQString tmp; for(int i=0;i<=number;i++) { pos = tmpText.find("\n"); tmp = tmpText.left(pos); @@ -599,15 +599,15 @@ QString HtmlExport::breakString(const QString &text) } } -void HtmlExport::createFooter( QTextStream *ts ) +void HtmlExport::createFooter( TQTextStream *ts ) { // FIXME: Implement this in a translatable way! - QString trailer = i18n("This page was created "); + TQString trailer = i18n("This page was created "); /* bool hasPerson = false; bool hasCredit = false; bool hasCreditURL = false; - QString mail, name, credit, creditURL;*/ + TQString mail, name, credit, creditURL;*/ if (!mSettings->eMail().isEmpty()) { if (!mSettings->name().isEmpty()) trailer += i18n("by %2 ").arg( mSettings->eMail() ).arg( mSettings->name() ); @@ -629,43 +629,43 @@ void HtmlExport::createFooter( QTextStream *ts ) } -QString HtmlExport::cleanChars(const QString &text) +TQString HtmlExport::cleanChars(const TQString &text) { - QString txt = text; + TQString txt = text; txt = txt.replace( "&", "&" ); txt = txt.replace( "<", "<" ); txt = txt.replace( ">", ">" ); txt = txt.replace( "\"", """ ); - txt = txt.replace( QString::fromUtf8("ä"), "ä" ); - txt = txt.replace( QString::fromUtf8("á"), "á" ); - txt = txt.replace( QString::fromUtf8("à"), "à" ); - txt = txt.replace( QString::fromUtf8("â"), "â" ); - txt = txt.replace( QString::fromUtf8("Ä"), "Ä" ); - txt = txt.replace( QString::fromUtf8("ó"), "ó" ); - txt = txt.replace( QString::fromUtf8("ô"), "ô" ); - txt = txt.replace( QString::fromUtf8("ö"), "ö" ); - txt = txt.replace( QString::fromUtf8("Ö"), "Ö" ); - txt = txt.replace( QString::fromUtf8("ü"), "ü" ); - txt = txt.replace( QString::fromUtf8("Ü"), "Ü" ); - txt = txt.replace( QString::fromUtf8("ß"), "ß" ); - txt = txt.replace( QString::fromUtf8("€"), "€" ); - txt = txt.replace( QString::fromUtf8("é"), "é" ); - txt = txt.replace( QString::fromUtf8("ë"), "ë" ); - txt = txt.replace( QString::fromUtf8("è"), "è" ); - txt = txt.replace( QString::fromUtf8("ñ"), "ñ" ); - txt = txt.replace( QString::fromUtf8("ç"), "ç" ); + txt = txt.replace( TQString::fromUtf8("ä"), "ä" ); + txt = txt.replace( TQString::fromUtf8("á"), "á" ); + txt = txt.replace( TQString::fromUtf8("à"), "à" ); + txt = txt.replace( TQString::fromUtf8("â"), "â" ); + txt = txt.replace( TQString::fromUtf8("Ä"), "Ä" ); + txt = txt.replace( TQString::fromUtf8("ó"), "ó" ); + txt = txt.replace( TQString::fromUtf8("ô"), "ô" ); + txt = txt.replace( TQString::fromUtf8("ö"), "ö" ); + txt = txt.replace( TQString::fromUtf8("Ö"), "Ö" ); + txt = txt.replace( TQString::fromUtf8("ü"), "ü" ); + txt = txt.replace( TQString::fromUtf8("Ü"), "Ü" ); + txt = txt.replace( TQString::fromUtf8("ß"), "ß" ); + txt = txt.replace( TQString::fromUtf8("€"), "€" ); + txt = txt.replace( TQString::fromUtf8("é"), "é" ); + txt = txt.replace( TQString::fromUtf8("ë"), "ë" ); + txt = txt.replace( TQString::fromUtf8("è"), "è" ); + txt = txt.replace( TQString::fromUtf8("ñ"), "ñ" ); + txt = txt.replace( TQString::fromUtf8("ç"), "ç" ); return txt; } -QString HtmlExport::styleSheet() const +TQString HtmlExport::styleSheet() const { if ( !mSettings->styleSheet().isEmpty() ) return mSettings->styleSheet(); - QString css; + TQString css; - if ( QApplication::reverseLayout() ) { + if ( TQApplication::reverseLayout() ) { css += " body { background-color:white; color:black; direction: rtl }\n"; css += " td { text-align:center; background-color:#eee }\n"; css += " th { text-align:center; background-color:#228; color:white }\n"; @@ -693,7 +693,7 @@ QString HtmlExport::styleSheet() const } -void HtmlExport::addHoliday( const QDate &date, const QString &name) +void HtmlExport::addHoliday( const TQDate &date, const TQString &name) { if ( mHolidayMap[date].isEmpty() ) { mHolidayMap[date] = name; @@ -702,12 +702,12 @@ void HtmlExport::addHoliday( const QDate &date, const QString &name) } } -QDate HtmlExport::fromDate() const +TQDate HtmlExport::fromDate() const { return mSettings->dateStart().date(); } -QDate HtmlExport::toDate() const +TQDate HtmlExport::toDate() const { return mSettings->dateEnd().date(); } -- cgit v1.2.1