diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /libkcal/calendarlocal.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkcal/calendarlocal.cpp')
-rw-r--r-- | libkcal/calendarlocal.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index a37488f6f..39c48ae4b 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp @@ -21,9 +21,9 @@ Boston, MA 02110-1301, USA. */ -#include <qdatetime.h> -#include <qstring.h> -#include <qptrlist.h> +#include <tqdatetime.h> +#include <tqstring.h> +#include <tqptrlist.h> #include <kdebug.h> #include <klocale.h> @@ -41,7 +41,7 @@ using namespace KCal; -CalendarLocal::CalendarLocal( const QString &timeZoneId ) +CalendarLocal::CalendarLocal( const TQString &timeZoneId ) : Calendar( timeZoneId ), mEvents( 47 ) { init(); @@ -50,7 +50,7 @@ CalendarLocal::CalendarLocal( const QString &timeZoneId ) void CalendarLocal::init() { mDeletedIncidences.setAutoDelete( true ); - mFileName = QString::null; + mFileName = TQString::null; } @@ -59,16 +59,16 @@ CalendarLocal::~CalendarLocal() close(); } -bool CalendarLocal::load( const QString &fileName, CalFormat *format ) +bool CalendarLocal::load( const TQString &fileName, CalFormat *format ) { mFileName = fileName; FileStorage storage( this, fileName, format ); return storage.load(); } -bool CalendarLocal::reload( const QString &tz ) +bool CalendarLocal::reload( const TQString &tz ) { - const QString filename = mFileName; + const TQString filename = mFileName; save(); close(); mFileName = filename; @@ -77,7 +77,7 @@ bool CalendarLocal::reload( const QString &tz ) return storage.load(); } -bool CalendarLocal::save( const QString &fileName, CalFormat *format ) +bool CalendarLocal::save( const TQString &fileName, CalFormat *format ) { // Save only if the calendar is either modified, or saved to a // different file than it was loaded from @@ -92,7 +92,7 @@ bool CalendarLocal::save( const QString &fileName, CalFormat *format ) void CalendarLocal::close() { setObserversEnabled( false ); - mFileName = QString::null; + mFileName = TQString::null; deleteAllEvents(); deleteAllTodos(); @@ -136,7 +136,7 @@ bool CalendarLocal::deleteEvent( Event *event ) void CalendarLocal::deleteAllEvents() { // kdDebug(5800) << "CalendarLocal::deleteAllEvents" << endl; - QDictIterator<Event> it( mEvents ); + TQDictIterator<Event> it( mEvents ); while( it.current() ) { notifyIncidenceDeleted( it.current() ); ++it; @@ -147,7 +147,7 @@ void CalendarLocal::deleteAllEvents() mEvents.setAutoDelete( false ); } -Event *CalendarLocal::event( const QString &uid ) +Event *CalendarLocal::event( const TQString &uid ) { // kdDebug(5800) << "CalendarLocal::event(): " << uid << endl; return mEvents[ uid ]; @@ -204,7 +204,7 @@ Todo::List CalendarLocal::rawTodos( TodoSortField sortField, return sortTodos( &mTodoList, sortField, sortDirection ); } -Todo *CalendarLocal::todo( const QString &uid ) +Todo *CalendarLocal::todo( const TQString &uid ) { Todo::List::ConstIterator it; for ( it = mTodoList.begin(); it != mTodoList.end(); ++it ) { @@ -214,7 +214,7 @@ Todo *CalendarLocal::todo( const QString &uid ) return 0; } -Todo::List CalendarLocal::rawTodosForDate( const QDate &date ) +Todo::List CalendarLocal::rawTodosForDate( const TQDate &date ) { Todo::List todos; @@ -229,12 +229,12 @@ Todo::List CalendarLocal::rawTodosForDate( const QDate &date ) return todos; } -Alarm::List CalendarLocal::alarmsTo( const QDateTime &to ) +Alarm::List CalendarLocal::alarmsTo( const TQDateTime &to ) { - return alarms( QDateTime( QDate( 1900, 1, 1 ) ), to ); + return alarms( TQDateTime( TQDate( 1900, 1, 1 ) ), to ); } -Alarm::List CalendarLocal::alarms( const QDateTime &from, const QDateTime &to ) +Alarm::List CalendarLocal::alarms( const TQDateTime &from, const TQDateTime &to ) { // kdDebug(5800) << "CalendarLocal::alarms(" << from.toString() << " - " // << to.toString() << ")" << endl; @@ -257,14 +257,14 @@ Alarm::List CalendarLocal::alarms( const QDateTime &from, const QDateTime &to ) } void CalendarLocal::appendAlarms( Alarm::List &alarms, Incidence *incidence, - const QDateTime &from, const QDateTime &to ) + const TQDateTime &from, const TQDateTime &to ) { - QDateTime preTime = from.addSecs(-1); + TQDateTime preTime = from.addSecs(-1); Alarm::List::ConstIterator it; for( it = incidence->alarms().begin(); it != incidence->alarms().end(); ++it ) { if ( (*it)->enabled() ) { - QDateTime dt = (*it)->nextRepetition(preTime); + TQDateTime dt = (*it)->nextRepetition(preTime); if ( dt.isValid() && dt <= to ) { kdDebug(5800) << "CalendarLocal::appendAlarms() '" << incidence->summary() << "': " @@ -277,10 +277,10 @@ void CalendarLocal::appendAlarms( Alarm::List &alarms, Incidence *incidence, void CalendarLocal::appendRecurringAlarms( Alarm::List &alarms, Incidence *incidence, - const QDateTime &from, - const QDateTime &to ) + const TQDateTime &from, + const TQDateTime &to ) { - QDateTime qdt; + TQDateTime qdt; int endOffset = 0; bool endOffsetValid = false; int period = from.secsTo(to); @@ -353,7 +353,7 @@ void CalendarLocal::appendRecurringAlarms( Alarm::List &alarms, void CalendarLocal::incidenceUpdated( IncidenceBase *incidence ) { incidence->setSyncStatusSilent( Event::SYNCMOD ); - incidence->setLastModified( QDateTime::currentDateTime() ); + incidence->setLastModified( TQDateTime::currentDateTime() ); // we should probably update the revision number here, // or internally in the Event itself when certain things change. // need to verify with ical documentation. @@ -366,7 +366,7 @@ void CalendarLocal::incidenceUpdated( IncidenceBase *incidence ) void CalendarLocal::insertEvent( Event *event ) { - QString uid = event->uid(); + TQString uid = event->uid(); if ( mEvents[ uid ] == 0 ) { mEvents.insert( uid, event ); } @@ -377,7 +377,7 @@ void CalendarLocal::insertEvent( Event *event ) #endif } -Event::List CalendarLocal::rawEventsForDate( const QDate &qd, +Event::List CalendarLocal::rawEventsForDate( const TQDate &qd, EventSortField sortField, SortDirection sortDirection ) { @@ -411,18 +411,18 @@ Event::List CalendarLocal::rawEventsForDate( const QDate &qd, return sortEvents( &eventList, sortField, sortDirection ); } -Event::List CalendarLocal::rawEvents( const QDate &start, const QDate &end, +Event::List CalendarLocal::rawEvents( const TQDate &start, const TQDate &end, bool inclusive ) { Event::List eventList; - QDate yesterStart = start.addDays(-1); + TQDate yesterStart = start.addDays(-1); // Get non-recurring events EventDictIterator it( mEvents ); for( ; it.current(); ++it ) { Event *event = *it; - QDate rStart = event->dtStart().date(); + TQDate rStart = event->dtStart().date(); if (end < rStart) { // kdDebug(5800) << "Skipping event starting after TOI" << endl; continue; @@ -433,7 +433,7 @@ Event::List CalendarLocal::rawEvents( const QDate &start, const QDate &end, } if ( ! event->doesRecur() ) { // non-recurring events - QDate rEnd = event->dtEnd().date(); + TQDate rEnd = event->dtEnd().date(); if (rEnd < start) { // kdDebug(5800) << "Skipping event ending before TOI" << endl; continue; @@ -452,7 +452,7 @@ Event::List CalendarLocal::rawEvents( const QDate &start, const QDate &end, break; case 0: // end date given default: // count given - QDate rEnd = event->recurrence()->endDate(); + TQDate rEnd = event->recurrence()->endDate(); if ( ! rEnd.isValid() ) { // kdDebug(5800) << "Skipping recurring event without occurences" << endl; continue; @@ -465,10 +465,10 @@ Event::List CalendarLocal::rawEvents( const QDate &start, const QDate &end, // kdDebug(5800) << "Skipping recurring event ending after TOI while inclusive" << endl; continue; } - /* FIXME: too much conversion between QDate and QDateTime makes this useless: - * freebusy(end=QDateTime(day, "00:00:00")) -> - * rawEvents(end=QDate(day)) -> - * durationTo(QDateTime(day, "23:59:59")) + /* FIXME: too much conversion between TQDate and TQDateTime makes this useless: + * freebusy(end=TQDateTime(day, "00:00:00")) -> + * rawEvents(end=TQDate(day)) -> + * durationTo(TQDateTime(day, "23:59:59")) * so events repeating at the end day match and are included. */ #if 0 @@ -489,7 +489,7 @@ Event::List CalendarLocal::rawEvents( const QDate &start, const QDate &end, return eventList; } -Event::List CalendarLocal::rawEventsForDate( const QDateTime &qdt ) +Event::List CalendarLocal::rawEventsForDate( const TQDateTime &qdt ) { return rawEventsForDate( qdt.date() ); } @@ -546,7 +546,7 @@ void CalendarLocal::deleteAllJournals() mJournalList.setAutoDelete( false ); } -Journal *CalendarLocal::journal( const QString &uid ) +Journal *CalendarLocal::journal( const TQString &uid ) { Journal::List::ConstIterator it; for ( it = mJournalList.begin(); it != mJournalList.end(); ++it ) @@ -561,7 +561,7 @@ Journal::List CalendarLocal::rawJournals( JournalSortField sortField, SortDirect return sortJournals( &mJournalList, sortField, sortDirection ); } -Journal::List CalendarLocal::rawJournalsForDate( const QDate &date ) +Journal::List CalendarLocal::rawJournalsForDate( const TQDate &date ) { Journal::List journals; @@ -576,9 +576,9 @@ Journal::List CalendarLocal::rawJournalsForDate( const QDate &date ) return journals; } -void CalendarLocal::setTimeZoneIdViewOnly( const QString& tz ) +void CalendarLocal::setTimeZoneIdViewOnly( const TQString& tz ) { - const QString question( i18n("The timezone setting was changed. In order to display the calendar " + const TQString question( i18n("The timezone setting was changed. In order to display the calendar " "you are looking at in the new timezone, it needs to be saved. Do you want to save the pending " "changes or rather wait and apply the new timezone on the next reload?" ) ); int rc = KMessageBox::Yes; |