diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-02-16 20:17:18 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-02-16 20:17:18 +0000 |
commit | f4fae92b6768541e2952173c3d4b09040f95bf7e (patch) | |
tree | d8c5d93232235cd635f3310b4d95490df181ba2d /kresources/kolab/kcal/resourcekolab.cpp | |
parent | 125c0a08265b75a133644d3b55f47e37c919f45d (diff) | |
download | tdepim-f4fae92b6768541e2952173c3d4b09040f95bf7e.tar.gz tdepim-f4fae92b6768541e2952173c3d4b09040f95bf7e.zip |
Moved kpilot from kdepim to applications, as the core Trinity libraries should not contain hardware-dependent software
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1221127 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kresources/kolab/kcal/resourcekolab.cpp')
-rw-r--r-- | kresources/kolab/kcal/resourcekolab.cpp | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/kresources/kolab/kcal/resourcekolab.cpp b/kresources/kolab/kcal/resourcekolab.cpp index 1f5f486ff..5bbae761b 100644 --- a/kresources/kolab/kcal/resourcekolab.cpp +++ b/kresources/kolab/kcal/resourcekolab.cpp @@ -70,7 +70,7 @@ static const char* incidenceInlineMimeType = "text/calendar"; ResourceKolab::ResourceKolab( const KConfig *config ) : ResourceCalendar( config ), ResourceKolabBase( "ResourceKolab-libkcal" ), - mCalendar( TQString::fromLatin1("UTC") ), mOpen( false ),mResourceChangedTimer( 0, + mCalendar( TQString::tqfromLatin1("UTC") ), mOpen( false ),mResourceChangedTimer( 0, "mResourceChangedTimer" ), mBatchAddingInProgress( false ) { if ( !config ) { @@ -170,7 +170,7 @@ bool ResourceKolab::loadSubResource( const TQString& subResource, const TQString labelTxt = !strcmp(mimetype, "application/x-vnd.kolab.task") ? i18n( "Loading tasks..." ) : !strcmp(mimetype, "application/x-vnd.kolab.journal") ? i18n( "Loading journals..." ) : i18n( "Loading events..." ); - const bool useProgress = qApp && qApp->type() != TQApplication::Tty && count > mProgressDialogIncidenceLimit; + const bool useProgress = tqApp && tqApp->type() != TQApplication::Tty && count > mProgressDialogIncidenceLimit; if ( useProgress ) (void)::Observer::self(); // ensure kio_uiserver is running UIServer_stub uiserver( "kio_uiserver", "UIServer" ); @@ -183,7 +183,7 @@ bool ResourceKolab::loadSubResource( const TQString& subResource, } for ( int startIndex = 0; startIndex < count; startIndex += nbMessages ) { - TQMap<Q_UINT32, TQString> lst; + TQMap<TQ_UINT32, TQString> lst; if ( !kmailIncidences( lst, mimetype, subResource, startIndex, nbMessages ) ) { kdError(5650) << "Communication problem in ResourceKolab::load()\n"; if ( progressId ) @@ -193,7 +193,7 @@ bool ResourceKolab::loadSubResource( const TQString& subResource, { // for RAII scoping below TemporarySilencer t( this ); - for( TQMap<Q_UINT32, TQString>::ConstIterator it = lst.begin(); it != lst.end(); ++it ) { + for( TQMap<TQ_UINT32, TQString>::ConstIterator it = lst.begin(); it != lst.end(); ++it ) { addIncidence( mimetype, it.data(), subResource, it.key() ); } } @@ -310,7 +310,7 @@ void ResourceKolab::incidenceUpdatedSilent( KCal::IncidenceBase* incidencebase ) const TQString uid = incidencebase->uid(); //kdDebug() << k_funcinfo << uid << endl; - if ( mUidsPendingUpdate.contains( uid ) || mUidsPendingAdding.contains( uid ) ) { + if ( mUidsPendingUpdate.tqcontains( uid ) || mUidsPendingAdding.tqcontains( uid ) ) { /* We are currently processing this event ( removing and readding or * adding it ). If so, ignore this update. Keep the last of these around * and process once we hear back from KMail on this event. */ @@ -336,7 +336,7 @@ void ResourceKolab::incidenceUpdatedSilent( KCal::IncidenceBase* incidencebase ) if ( i ) { bool ignoreThisUpdate = false; - if ( !mLastKnownRevisions.contains( uid ) ) { + if ( !mLastKnownRevisions.tqcontains( uid ) ) { mLastKnownRevisions[uid] = i->revision(); } @@ -354,8 +354,8 @@ void ResourceKolab::incidenceUpdatedSilent( KCal::IncidenceBase* incidencebase ) } // end optimization TQString subResource; - Q_UINT32 sernum = 0; - if ( mUidMap.contains( uid ) ) { + TQ_UINT32 sernum = 0; + if ( mUidMap.tqcontains( uid ) ) { subResource = mUidMap[ uid ].resource(); sernum = mUidMap[ uid ].serialNumber(); mUidsPendingUpdate.append( uid ); @@ -370,7 +370,7 @@ void ResourceKolab::incidenceUpdated( KCal::IncidenceBase* incidencebase ) } incidencebase->setSyncStatusSilent( KCal::Event::SYNCMOD ); - incidencebase->setLastModified( TQDateTime::currentDateTime() ); + incidencebase->setLastModified( TQDateTime::tqcurrentDateTime() ); // we should probably update the revision number here, // or internally in the Event itself when certain things change. @@ -378,7 +378,7 @@ void ResourceKolab::incidenceUpdated( KCal::IncidenceBase* incidencebase ) incidenceUpdatedSilent( incidencebase ); } -void ResourceKolab::resolveConflict( KCal::Incidence* inc, const TQString& subresource, Q_UINT32 sernum ) +void ResourceKolab::resolveConflict( KCal::Incidence* inc, const TQString& subresource, TQ_UINT32 sernum ) { if ( !inc ) { return; @@ -441,7 +441,7 @@ void ResourceKolab::resolveConflict( KCal::Incidence* inc, const TQString& subre mSilent = silent; } void ResourceKolab::addIncidence( const char* mimetype, const TQString& data, - const TQString& subResource, Q_UINT32 sernum ) + const TQString& subResource, TQ_UINT32 sernum ) { // This uses pointer comparison, so it only works if we use the static // objects defined in the top of the file @@ -459,7 +459,7 @@ void ResourceKolab::addIncidence( const char* mimetype, const TQString& data, bool ResourceKolab::sendKMailUpdate( KCal::IncidenceBase* incidencebase, const TQString& subresource, - Q_UINT32 sernum ) + TQ_UINT32 sernum ) { const TQString& type = incidencebase->type(); const char* mimetype = 0; @@ -543,7 +543,7 @@ bool ResourceKolab::sendKMailUpdate( KCal::IncidenceBase* incidencebase, const T // behold, sernum is an in-parameter const bool rc = kmailUpdate( subresource, sernum, data, mimetype, subject, customHeaders, attURLs, attMimeTypes, attNames, deletedAtts ); // update the serial number - if ( mUidMap.contains( incidencebase->uid() ) ) { + if ( mUidMap.tqcontains( incidencebase->uid() ) ) { mUidMap[ incidencebase->uid() ].setSerialNumber( sernum ); } @@ -556,7 +556,7 @@ bool ResourceKolab::sendKMailUpdate( KCal::IncidenceBase* incidencebase, const T } bool ResourceKolab::addIncidence( KCal::Incidence* incidence, const TQString& _subresource, - Q_UINT32 sernum ) + TQ_UINT32 sernum ) { Q_ASSERT( incidence ); if ( !incidence ) { @@ -629,7 +629,7 @@ bool ResourceKolab::addIncidence( KCal::Incidence* incidence, const TQString& _s // Lets not warn the user 100 times that there's no writable resource // and not ask 100 times which resource to use - if ( !mBatchAddingInProgress || !mLastUsedResources.contains( type ) ) { + if ( !mBatchAddingInProgress || !mLastUsedResources.tqcontains( type ) ) { subResource = findWritableResource( type, *map, text ); mLastUsedResources[type] = subResource; } else { @@ -676,7 +676,7 @@ bool ResourceKolab::addIncidence( KCal::Incidence* incidence, const TQString& _s } } } else { /* KMail told us */ - const bool ourOwnUpdate = mUidsPendingUpdate.contains( uid ); + const bool ourOwnUpdate = mUidsPendingUpdate.tqcontains( uid ); kdDebug( 5650 ) << "addIncidence: ourOwnUpdate " << ourOwnUpdate << endl; /* Check if we updated this one, which means kmail deleted and added it. * We know the new state, so lets just not do much at all. The old incidence @@ -692,7 +692,7 @@ bool ResourceKolab::addIncidence( KCal::Incidence* incidence, const TQString& _s * unless the folder is read-only, in which case the user should not be * offered a means of putting mails in a folder she'll later be unable to * upload. Skip the incidence, in this case. */ - if ( mUidMap.contains( uid ) ) { + if ( mUidMap.tqcontains( uid ) ) { if ( mUidMap[ uid ].resource() == subResource ) { if ( (*map)[ subResource ].writable() ) { kdDebug( 5650 ) << "lets resolve the conflict " << endl; @@ -716,7 +716,7 @@ bool ResourceKolab::addIncidence( KCal::Incidence* incidence, const TQString& _s } /* Add to the cache if the add didn't come from KOrganizer, in which case * we've already added it, and listen to updates from KOrganizer for it. */ - if ( !mUidsPendingAdding.contains( uid ) ) { + if ( !mUidsPendingAdding.tqcontains( uid ) ) { mCalendar.addIncidence( incidence ); incidence->registerObserver( this ); } @@ -733,7 +733,7 @@ bool ResourceKolab::addIncidence( KCal::Incidence* incidence, const TQString& _s } else { /* If the uid was added by KMail, KOrganizer needs to be told, so * schedule emitting of the resourceChanged signal. */ - if ( !mUidsPendingAdding.contains( uid ) ) { + if ( !mUidsPendingAdding.tqcontains( uid ) ) { if ( !ourOwnUpdate ) mResourceChangedTimer.changeInterval( 100 ); } else { mUidsPendingAdding.remove( uid ); @@ -752,7 +752,7 @@ bool ResourceKolab::addEvent( KCal::Event *event ) bool ResourceKolab::addEvent( KCal::Event *event, const TQString &subResource ) { - if ( mUidMap.contains( event->uid() ) ) { + if ( mUidMap.tqcontains( event->uid() ) ) { return true; //noop } else { return addIncidence( event, subResource, 0 ); @@ -760,7 +760,7 @@ bool ResourceKolab::addEvent( KCal::Event *event, const TQString &subResource ) } void ResourceKolab::addEvent( const TQString& xml, const TQString& subresource, - Q_UINT32 sernum ) + TQ_UINT32 sernum ) { KCal::Event* event = Kolab::Event::xmlToEvent( xml, mCalendar.timeZoneId(), this, subresource, sernum ); Q_ASSERT( event ); @@ -776,7 +776,7 @@ bool ResourceKolab::deleteIncidence( KCal::Incidence* incidence ) } const TQString uid = incidence->uid(); - if( !mUidMap.contains( uid ) ) return false; // Odd + if( !mUidMap.tqcontains( uid ) ) return false; // Odd /* The user told us to delete, tell KMail */ if ( !mSilent ) { kmailDeleteIncidence( mUidMap[ uid ].resource(), @@ -832,7 +832,7 @@ bool ResourceKolab::addTodo( KCal::Todo *todo ) bool ResourceKolab::addTodo( KCal::Todo *todo, const TQString &subResource ) { - if ( mUidMap.contains( todo->uid() ) ) { + if ( mUidMap.tqcontains( todo->uid() ) ) { return true; //noop } else { return addIncidence( todo, subResource, 0 ); @@ -840,7 +840,7 @@ bool ResourceKolab::addTodo( KCal::Todo *todo, const TQString &subResource ) } void ResourceKolab::addTodo( const TQString& xml, const TQString& subresource, - Q_UINT32 sernum ) + TQ_UINT32 sernum ) { KCal::Todo* todo = Kolab::Task::xmlToTask( xml, mCalendar.timeZoneId(), this, subresource, sernum ); Q_ASSERT( todo ); @@ -876,14 +876,14 @@ bool ResourceKolab::addJournal( KCal::Journal *journal ) bool ResourceKolab::addJournal( KCal::Journal *journal, const TQString &subResource ) { - if ( mUidMap.contains( journal->uid() ) ) + if ( mUidMap.tqcontains( journal->uid() ) ) return true; //noop else return addIncidence( journal, subResource, 0 ); } void ResourceKolab::addJournal( const TQString& xml, const TQString& subresource, - Q_UINT32 sernum ) + TQ_UINT32 sernum ) { KCal::Journal* journal = Kolab::Journal::xmlToJournal( xml, mCalendar.timeZoneId() ); @@ -921,12 +921,12 @@ KCal::Alarm::List ResourceKolab::relevantAlarms( const KCal::Alarm::List &alarms KCal::Alarm *a = (*it); ++it; const TQString &uid = a->parent()->uid(); - if ( mUidMap.contains( uid ) ) { + if ( mUidMap.tqcontains( uid ) ) { const TQString &sr = mUidMap[ uid ].resource(); Kolab::SubResource *subResource = 0; - if ( mEventSubResources.contains( sr ) ) + if ( mEventSubResources.tqcontains( sr ) ) subResource = &( mEventSubResources[ sr ] ); - else if ( mTodoSubResources.contains( sr ) ) + else if ( mTodoSubResources.tqcontains( sr ) ) subResource = &( mTodoSubResources[ sr ] ); assert( subResource ); if ( subResource->alarmRelevant() ) @@ -960,7 +960,7 @@ void ResourceKolab::setTimeZoneId( const TQString& tzid ) bool ResourceKolab::fromKMailAddIncidence( const TQString& type, const TQString& subResource, - Q_UINT32 sernum, + TQ_UINT32 sernum, int format, const TQString& data ) { @@ -1011,14 +1011,14 @@ void ResourceKolab::fromKMailDelIncidence( const TQString& type, // Can't be in both, by contract if ( mUidsPendingDeletion.find( uid ) != mUidsPendingDeletion.end() ) { mUidsPendingDeletion.remove( mUidsPendingDeletion.find( uid ) ); - } else if ( mUidsPendingUpdate.contains( uid ) ) { + } else if ( mUidsPendingUpdate.tqcontains( uid ) ) { // It's good to know if was deleted, but we are waiting on a new one to - // replace it, so let's just sit tight. + // tqreplace it, so let's just sit tight. } else { TQString uidToUse; QPair<TQString, TQString> p( uid, subResource ); - if ( mOriginalUID2fakeUID.contains( p ) ) { + if ( mOriginalUID2fakeUID.tqcontains( p ) ) { // Incidence with the same uid in a different folder... // use the UID that addIncidence(...) generated uidToUse = mOriginalUID2fakeUID[p]; @@ -1073,7 +1073,7 @@ void ResourceKolab::fromKMailAddSubresource( const TQString& type, // Not ours return; - if ( map->contains( subResource ) ) + if ( map->tqcontains( subResource ) ) // Already registered return; @@ -1093,7 +1093,7 @@ void ResourceKolab::fromKMailDelSubresource( const TQString& type, ResourceMap* map = subResourceMap( type ); if ( !map ) // not ours return; - if ( map->contains( subResource ) ) + if ( map->tqcontains( subResource ) ) map->erase( subResource ); else // Not registered @@ -1122,21 +1122,21 @@ TQStringList ResourceKolab::subresources() const const QString ResourceKolab::labelForSubresource( const TQString& subresource ) const { - if ( mEventSubResources.contains( subresource ) ) + if ( mEventSubResources.tqcontains( subresource ) ) return mEventSubResources[ subresource ].label(); - if ( mTodoSubResources.contains( subresource ) ) + if ( mTodoSubResources.tqcontains( subresource ) ) return mTodoSubResources[ subresource ].label(); - if ( mJournalSubResources.contains( subresource ) ) + if ( mJournalSubResources.tqcontains( subresource ) ) return mJournalSubResources[ subresource ].label(); return subresource; } -void ResourceKolab::fromKMailAsyncLoadResult( const TQMap<Q_UINT32, TQString>& map, +void ResourceKolab::fromKMailAsyncLoadResult( const TQMap<TQ_UINT32, TQString>& map, const TQString& type, const TQString& folder ) { TemporarySilencer t( this ); - for( TQMap<Q_UINT32, TQString>::ConstIterator it = map.begin(); it != map.end(); ++it ) + for( TQMap<TQ_UINT32, TQString>::ConstIterator it = map.begin(); it != map.end(); ++it ) addIncidence( type.latin1(), it.data(), folder, it.key() ); } @@ -1146,11 +1146,11 @@ bool ResourceKolab::subresourceActive( const TQString& subresource ) const // before it opens the resource :-( Make sure we are open const_cast<ResourceKolab*>( this )->doOpen(); - if ( mEventSubResources.contains( subresource ) ) + if ( mEventSubResources.tqcontains( subresource ) ) return mEventSubResources[ subresource ].active(); - if ( mTodoSubResources.contains( subresource ) ) + if ( mTodoSubResources.tqcontains( subresource ) ) return mTodoSubResources[ subresource ].active(); - if ( mJournalSubResources.contains( subresource ) ) + if ( mJournalSubResources.tqcontains( subresource ) ) return mJournalSubResources[ subresource ].active(); // Safe default bet: @@ -1163,15 +1163,15 @@ void ResourceKolab::setSubresourceActive( const TQString &subresource, bool v ) { ResourceMap *map = 0; const char* mimeType = 0; - if ( mEventSubResources.contains( subresource ) ) { + if ( mEventSubResources.tqcontains( subresource ) ) { map = &mEventSubResources; mimeType = eventAttachmentMimeType; } - if ( mTodoSubResources.contains( subresource ) ) { + if ( mTodoSubResources.tqcontains( subresource ) ) { map = &mTodoSubResources; mimeType = todoAttachmentMimeType; } - if ( mJournalSubResources.contains( subresource ) ) { + if ( mJournalSubResources.tqcontains( subresource ) ) { map = &mJournalSubResources; mimeType = journalAttachmentMimeType; } @@ -1194,11 +1194,11 @@ bool ResourceKolab::subresourceWritable( const TQString& subresource ) const // before it opens the resource :-( Make sure we are open const_cast<ResourceKolab*>( this )->doOpen(); - if ( mEventSubResources.contains( subresource ) ) + if ( mEventSubResources.tqcontains( subresource ) ) return mEventSubResources[ subresource ].writable(); - if ( mTodoSubResources.contains( subresource ) ) + if ( mTodoSubResources.tqcontains( subresource ) ) return mTodoSubResources[ subresource ].writable(); - if ( mJournalSubResources.contains( subresource ) ) + if ( mJournalSubResources.tqcontains( subresource ) ) return mJournalSubResources[ subresource ].writable(); return false; //better a safe default @@ -1236,11 +1236,11 @@ bool ResourceKolab::addSubresource( const TQString& resource, const TQString& pa kdDebug(5650) << "KCal Kolab resource - adding subresource: " << resource << endl; TQString contentsType = kmailCalendarContentsType; if ( !parent.isEmpty() ) { - if ( mEventSubResources.contains( parent ) ) + if ( mEventSubResources.tqcontains( parent ) ) contentsType = kmailCalendarContentsType; - else if ( mTodoSubResources.contains( parent ) ) + else if ( mTodoSubResources.tqcontains( parent ) ) contentsType = kmailTodoContentsType; - else if ( mJournalSubResources.contains( parent ) ) + else if ( mJournalSubResources.tqcontains( parent ) ) contentsType = kmailJournalContentsType; } else { TQStringList contentTypeChoices; @@ -1269,10 +1269,10 @@ bool ResourceKolab::removeSubresource( const TQString& resource ) TQString ResourceKolab::subresourceIdentifier( Incidence *incidence ) { TQString uid = incidence->uid(); - if ( mUidMap.contains( uid ) ) + if ( mUidMap.tqcontains( uid ) ) return mUidMap[ uid ].resource(); else - if ( mNewIncidencesMap.contains( uid ) ) + if ( mNewIncidencesMap.tqcontains( uid ) ) return mNewIncidencesMap[ uid ]; else return TQString(); @@ -1311,11 +1311,11 @@ bool ResourceKolab::unloadSubResource( const TQString& subResource ) TQString ResourceKolab::subresourceType( const TQString &resource ) { - if ( mEventSubResources.contains( resource ) ) + if ( mEventSubResources.tqcontains( resource ) ) return "event"; - if ( mTodoSubResources.contains( resource ) ) + if ( mTodoSubResources.tqcontains( resource ) ) return "todo"; - if ( mJournalSubResources.contains( resource ) ) + if ( mJournalSubResources.tqcontains( resource ) ) return "journal"; return TQString(); } |