diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
commit | 67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch) | |
tree | 5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /kresources/exchange | |
parent | 2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff) | |
download | tdepim-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 'kresources/exchange')
-rw-r--r-- | kresources/exchange/dateset.cpp | 48 | ||||
-rw-r--r-- | kresources/exchange/dateset.h | 8 | ||||
-rw-r--r-- | kresources/exchange/resourceexchange.cpp | 6 | ||||
-rw-r--r-- | kresources/exchange/resourceexchange.h | 1 | ||||
-rw-r--r-- | kresources/exchange/resourceexchangeconfig.cpp | 6 | ||||
-rw-r--r-- | kresources/exchange/resourceexchangeconfig.h | 3 |
6 files changed, 37 insertions, 35 deletions
diff --git a/kresources/exchange/dateset.cpp b/kresources/exchange/dateset.cpp index 2fed82af6..d28409a9c 100644 --- a/kresources/exchange/dateset.cpp +++ b/kresources/exchange/dateset.cpp @@ -45,11 +45,11 @@ DateSet::~DateSet() void DateSet::add( TQDate const& date ) { if (mDates->isEmpty()) { - mDates->insert( 0, new QPair<TQDate,TQDate>( date, date ) ); + mDates->insert( 0, new TQPair<TQDate,TQDate>( date, date ) ); return; } - int i = find( date ); - mDates->insert( i, new QPair<TQDate,TQDate>( date, date ) ); + int i = tqfind( date ); + mDates->insert( i, new TQPair<TQDate,TQDate>( date, date ) ); tryMerge( i ); tryMerge( i-1 ); } @@ -57,19 +57,19 @@ void DateSet::add( TQDate const& date ) void DateSet::add( TQDate const& from, TQDate const& to ) { if (mDates->isEmpty()) { - mDates->insert( 0, new QPair<TQDate,TQDate>( from, to ) ); + mDates->insert( 0, new TQPair<TQDate,TQDate>( from, to ) ); return; } - uint i = find( from ); + uint i = tqfind( from ); kdDebug() << "Adding range at position " << i << endl; - mDates->insert( i, new QPair<TQDate,TQDate>( from, to ) ); + mDates->insert( i, new TQPair<TQDate,TQDate>( from, to ) ); do { } while ( tryMerge( i ) ); do { } while ( tryMerge( i-1 ) ); /* - QPair<TQDate,TQDate>* item = mDates->at( i ); + TQPair<TQDate,TQDate>* item = mDates->at( i ); if (to >= item->first) return; @@ -77,7 +77,7 @@ void DateSet::add( TQDate const& from, TQDate const& to ) if (to.daysTo( item->first ) == 1 ) item->first = from; else - mDates->insert( i, new QPair<TQDate,TQDate>( from, to ) ); + mDates->insert( i, new TQPair<TQDate,TQDate>( from, to ) ); */ } @@ -87,11 +87,11 @@ void DateSet::remove( TQDate const& date ) return; } - uint i = find( date ); + uint i = tqfind( date ); if ( i == mDates->count() ) return; - QPair<TQDate,TQDate>* item = mDates->at( i ); + TQPair<TQDate,TQDate>* item = mDates->at( i ); if ( date < item->first ) return; if ( date == item->first ) { @@ -106,7 +106,7 @@ void DateSet::remove( TQDate const& date ) if ( date == item->second ) { item->second = item->second.addDays( -1 ); } else { - mDates->insert( i, new QPair<TQDate,TQDate>(item->first, date.addDays( -1 ) ) ); + mDates->insert( i, new TQPair<TQDate,TQDate>(item->first, date.addDays( -1 ) ) ); item->first = date.addDays( 1 ); } } @@ -117,12 +117,12 @@ void DateSet::remove( TQDate const& from, TQDate const& to ) return; } - uint i = find( from ); + uint i = tqfind( from ); if ( i == mDates->count() ) return; while( i < mDates->count() ) { - QPair<TQDate,TQDate>* item = mDates->at( i ); + TQPair<TQDate,TQDate>* item = mDates->at( i ); // Check if we're done: next item is later dan removal period if ( to < item->first ) break; @@ -136,7 +136,7 @@ void DateSet::remove( TQDate const& from, TQDate const& to ) // Check if we should take a slice out of the middle of the item if ( from > item->first && to < item->second ) { - mDates->insert( i, new QPair<TQDate,TQDate>( item->first, from.addDays( -1 ) ) ); + mDates->insert( i, new TQPair<TQDate,TQDate>( item->first, from.addDays( -1 ) ) ); item->first = to.addDays( 1 ); break; // We're done } @@ -161,13 +161,13 @@ bool DateSet::tqcontains( TQDate const& date ) return false; } - uint i = find( date ); -// kdDebug() << "tqcontains looking for " << date.toString() << " at range " << i << endl; + uint i = tqfind( date ); +// kdDebug() << "contains looking for " << date.toString() << " at range " << i << endl; if ( i == mDates->count() ) return false; - QPair<TQDate,TQDate>* item = mDates->at( i ); - // kdDebug() << "tqcontains looking at range " << item->first.toString() << " -- " << item->second.toString() << endl; + TQPair<TQDate,TQDate>* item = mDates->at( i ); + // kdDebug() << "contains looking at range " << item->first.toString() << " -- " << item->second.toString() << endl; return ( item->first <= date ); } @@ -178,11 +178,11 @@ bool DateSet::tqcontains( TQDate const& from, TQDate const& to ) return false; } - uint i = find( from ); + uint i = tqfind( from ); if ( i == mDates->count() ) return false; - QPair<TQDate,TQDate>* item = mDates->at( i ); + TQPair<TQDate,TQDate>* item = mDates->at( i ); return ( from >= item->first && to <= item->second ); } @@ -192,7 +192,7 @@ bool DateSet::tqcontains( TQDate const& from, TQDate const& to ) // If mDates is empty, return 0. // If date is later than the last item in mDates, return mDates->count() -int DateSet::find( TQDate const& date ) +int DateSet::tqfind( TQDate const& date ) { if ( mDates->isEmpty() ) return 0; @@ -202,7 +202,7 @@ int DateSet::find( TQDate const& date ) while ( start < end ) { int i = start + (end-start) / 2; // kdDebug() << start << ", " << i << ", " << end << endl; - QPair<TQDate,TQDate> *item = mDates->at( i ); + TQPair<TQDate,TQDate> *item = mDates->at( i ); if ( item->first <= date && date <= item->second ) return i; if ( date > item->second ) { @@ -246,8 +246,8 @@ bool DateSet::tryMerge( int i ) if ( i < 0 || i+1 >= (int)(mDates->count()) ) return false; - QPair<TQDate,TQDate>* item1 = mDates->at( i ); - QPair<TQDate,TQDate>* item2 = mDates->at( i+1 ); + TQPair<TQDate,TQDate>* item1 = mDates->at( i ); + TQPair<TQDate,TQDate>* item2 = mDates->at( i+1 ); // First case: item1 starts before or on the same date as item2 if ( item1->first <= item2->first ) { diff --git a/kresources/exchange/dateset.h b/kresources/exchange/dateset.h index d4e9a9fef..99c02a5c7 100644 --- a/kresources/exchange/dateset.h +++ b/kresources/exchange/dateset.h @@ -46,11 +46,11 @@ class DateRange { } */ -class RangeList : public TQPtrList< QPair<TQDate, TQDate> > { +class RangeList : public TQPtrList< TQPair<TQDate, TQDate> > { protected: virtual int compareItems(TQPtrCollection::Item item1, TQPtrCollection::Item item2) { - QPair<TQDate,TQDate> *i1 = static_cast<QPair<TQDate,TQDate> *> (item1); - QPair<TQDate,TQDate> *i2 = static_cast<QPair<TQDate,TQDate> *> (item2); + TQPair<TQDate,TQDate> *i1 = static_cast<TQPair<TQDate,TQDate> *> (item1); + TQPair<TQDate,TQDate> *i2 = static_cast<TQPair<TQDate,TQDate> *> (item2); if ( *i1 < *i2 ) return -1; if ( *i2 < *i1 ) return 1; return 0; @@ -72,7 +72,7 @@ class DateSet { // returns true if and only if the whole range is in the set bool tqcontains( TQDate const& from, TQDate const& to ); - int find( TQDate const &date ); + int tqfind( TQDate const &date ); void print(); protected: diff --git a/kresources/exchange/resourceexchange.cpp b/kresources/exchange/resourceexchange.cpp index ec203b9cd..234907fcb 100644 --- a/kresources/exchange/resourceexchange.cpp +++ b/kresources/exchange/resourceexchange.cpp @@ -233,7 +233,7 @@ void ResourceExchange::slotMonitorNotify( const TQValueList<long>& IDs, const TQ * 3. Event modified that we have in cache * 4. Something else happened that isn't relevant to us * Update cache, then notify whoever's watching us - * We may be able to find (1) and (3) by looking at the + * We may be able to tqfind (1) and (3) by looking at the * DAV:getlastmodified property * (2) is trickier: we might have to resort to checking * all uids in the cache @@ -298,7 +298,7 @@ void ResourceExchange::changeIncidence( Incidence *incidence ) kdDebug() << "ResourceExchange::changeIncidence(): " << incidence->summary() << endl; - if ( mChangedIncidences.find( incidence ) == mChangedIncidences.end() ) { + if ( mChangedIncidences.tqfind( incidence ) == mChangedIncidences.end() ) { mChangedIncidences.append( incidence ); } } @@ -505,7 +505,7 @@ Event::List ResourceExchange::rawEventsForDate( const TQDate &qd, // are really new. Event::List eventsAfter = mCache->rawEvents(); for ( it = eventsAfter.begin(); it != eventsAfter.end(); ++it ) { - if ( eventsBefore.find( *it ) == eventsBefore.end() ) { + if ( eventsBefore.tqfind( *it ) == eventsBefore.end() ) { // it's a new event downloaded by downloadSynchronous -> install observer (*it)->registerObserver( this ); } diff --git a/kresources/exchange/resourceexchange.h b/kresources/exchange/resourceexchange.h index 7328a27b0..d6a092f2c 100644 --- a/kresources/exchange/resourceexchange.h +++ b/kresources/exchange/resourceexchange.h @@ -48,6 +48,7 @@ class CalFormat; class ResourceExchange : public ResourceCalendar, public IncidenceBase::Observer { Q_OBJECT + TQ_OBJECT public: ResourceExchange( const KConfig * ); diff --git a/kresources/exchange/resourceexchangeconfig.cpp b/kresources/exchange/resourceexchangeconfig.cpp index 5bb9677b6..5a20dba0f 100644 --- a/kresources/exchange/resourceexchangeconfig.cpp +++ b/kresources/exchange/resourceexchangeconfig.cpp @@ -33,8 +33,8 @@ using namespace KCal; -ResourceExchangeConfig::ResourceExchangeConfig( TQWidget* parent, const char* name ) - : KRES::ConfigWidget( parent, name ) +ResourceExchangeConfig::ResourceExchangeConfig( TQWidget* tqparent, const char* name ) + : KRES::ConfigWidget( tqparent, name ) { resize( 245, 115 ); TQGridLayout *mainLayout = new TQGridLayout( this, 8, 3 ); @@ -101,7 +101,7 @@ void ResourceExchangeConfig::saveSettings( KRES::Resource *resource ) ResourceExchange* res = dynamic_cast<ResourceExchange*>( resource ); if (res) { if ( mAutoMailbox->isChecked() ) { - mMailboxEdit->setText( TQString::null ); + mMailboxEdit->setText( TQString() ); slotFindClicked(); if ( mMailboxEdit->text().isNull() ) { kdWarning() << "Could not find Exchange mailbox URL, incomplete settings!" << endl; diff --git a/kresources/exchange/resourceexchangeconfig.h b/kresources/exchange/resourceexchangeconfig.h index 870317afb..9e4af8710 100644 --- a/kresources/exchange/resourceexchangeconfig.h +++ b/kresources/exchange/resourceexchangeconfig.h @@ -37,9 +37,10 @@ namespace KCal { class ResourceExchangeConfig : public KRES::ConfigWidget { Q_OBJECT + TQ_OBJECT public: - ResourceExchangeConfig( TQWidget* parent = 0, const char* name = 0 ); + ResourceExchangeConfig( TQWidget* tqparent = 0, const char* name = 0 ); public slots: virtual void loadSettings( KRES::Resource *resource); |