summaryrefslogtreecommitdiffstats
path: root/kresources/scalix/kcal/resourcescalix.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-02-16 20:17:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-02-16 20:17:18 +0000
commitf4fae92b6768541e2952173c3d4b09040f95bf7e (patch)
treed8c5d93232235cd635f3310b4d95490df181ba2d /kresources/scalix/kcal/resourcescalix.cpp
parent125c0a08265b75a133644d3b55f47e37c919f45d (diff)
downloadtdepim-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/scalix/kcal/resourcescalix.cpp')
-rw-r--r--kresources/scalix/kcal/resourcescalix.cpp82
1 files changed, 41 insertions, 41 deletions
diff --git a/kresources/scalix/kcal/resourcescalix.cpp b/kresources/scalix/kcal/resourcescalix.cpp
index 63e964eb9..1d74c5709 100644
--- a/kresources/scalix/kcal/resourcescalix.cpp
+++ b/kresources/scalix/kcal/resourcescalix.cpp
@@ -63,7 +63,7 @@ static const char* incidenceInlineMimeType = "text/calendar";
ResourceScalix::ResourceScalix( const KConfig *config )
: ResourceCalendar( config ), ResourceScalixBase( "ResourceScalix-libkcal" ),
- mCalendar( TQString::fromLatin1("UTC") ), mOpen( false )
+ mCalendar( TQString::tqfromLatin1("UTC") ), mOpen( false )
{
setType( "scalix" );
connect( &mResourceChangedTimer, TQT_SIGNAL( timeout() ),
@@ -159,7 +159,7 @@ bool ResourceScalix::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" );
@@ -172,7 +172,7 @@ bool ResourceScalix::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 ResourceScalix::load()\n";
if ( progressId )
@@ -182,7 +182,7 @@ bool ResourceScalix::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() );
}
}
@@ -269,24 +269,24 @@ void ResourceScalix::incidenceUpdated( KCal::IncidenceBase* incidencebase )
{
if ( incidencebase->isReadOnly() ) return; // Should not happen (TM)
incidencebase->setSyncStatus( 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.
// need to verify with ical documentation.
const TQString uid = incidencebase->uid();
- 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. */
- mPendingUpdates.replace( uid, incidencebase );
+ mPendingUpdates.tqreplace( uid, incidencebase );
return;
}
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 );
@@ -294,7 +294,7 @@ void ResourceScalix::incidenceUpdated( KCal::IncidenceBase* incidencebase )
sendKMailUpdate( incidencebase, subResource, sernum );
}
-void ResourceScalix::resolveConflict( KCal::Incidence* inc, const TQString& subresource, Q_UINT32 sernum )
+void ResourceScalix::resolveConflict( KCal::Incidence* inc, const TQString& subresource, TQ_UINT32 sernum )
{
if ( ! inc )
return;
@@ -344,7 +344,7 @@ void ResourceScalix::resolveConflict( KCal::Incidence* inc, const TQString& subr
}
}
void ResourceScalix::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
@@ -354,7 +354,7 @@ void ResourceScalix::addIncidence( const char* mimetype, const TQString& data,
bool ResourceScalix::sendKMailUpdate( KCal::IncidenceBase* incidencebase, const TQString& subresource,
- Q_UINT32 sernum )
+ TQ_UINT32 sernum )
{
const TQString& type = incidencebase->type();
const char* mimetype = 0;
@@ -390,14 +390,14 @@ bool ResourceScalix::sendKMailUpdate( KCal::IncidenceBase* incidencebase, const
// behold, sernum is an in-parameter
const bool rc = kmailUpdate( subresource, sernum, data, mimetype, subject, customHeaders );
// update the serial number
- if ( mUidMap.contains( incidencebase->uid() ) ) {
+ if ( mUidMap.tqcontains( incidencebase->uid() ) ) {
mUidMap[ incidencebase->uid() ].setSerialNumber( sernum );
}
return rc;
}
bool ResourceScalix::addIncidence( KCal::Incidence* incidence, const TQString& _subresource,
- Q_UINT32 sernum )
+ TQ_UINT32 sernum )
{
Q_ASSERT( incidence );
if ( !incidence ) return false;
@@ -450,7 +450,7 @@ bool ResourceScalix::addIncidence( KCal::Incidence* incidence, const TQString& _
* We know the new state, so lets just not do much at all. The old incidence
* in the calendar remains valid, but the serial number changed, so we need to
* update that */
- if ( ourOwnUpdate = mUidsPendingUpdate.contains( uid ) ) {
+ if ( ourOwnUpdate = mUidsPendingUpdate.tqcontains( uid ) ) {
mUidsPendingUpdate.remove( uid );
mUidMap.remove( uid );
mUidMap[ uid ] = StorageReference( subResource, sernum );
@@ -460,7 +460,7 @@ bool ResourceScalix::addIncidence( KCal::Incidence* incidence, const TQString& _
* 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 )
&& ( mUidMap[ uid ].resource() == subResource ) ) {
if ( (*map)[ subResource ].writable() ) {
resolveConflict( incidence, subResource, sernum );
@@ -472,7 +472,7 @@ bool ResourceScalix::addIncidence( KCal::Incidence* incidence, const TQString& _
}
/* 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 );
}
@@ -489,7 +489,7 @@ bool ResourceScalix::addIncidence( KCal::Incidence* incidence, const TQString& _
} 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 );
@@ -504,7 +504,7 @@ bool ResourceScalix::addIncidence( KCal::Incidence* incidence, const TQString& _
bool ResourceScalix::addEvent( KCal::Event* event )
{
- if ( mUidMap.contains( event->uid() ) )
+ if ( mUidMap.tqcontains( event->uid() ) )
return true; //noop
else
return addIncidence( event, TQString::null, 0 );
@@ -521,7 +521,7 @@ bool ResourceScalix::deleteIncidence( KCal::Incidence* incidence )
if ( incidence->isReadOnly() ) return false;
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(),
@@ -572,7 +572,7 @@ KCal::Event::List ResourceScalix::rawEvents( const TQDate& start,
bool ResourceScalix::addTodo( KCal::Todo* todo )
{
- if ( mUidMap.contains( todo->uid() ) )
+ if ( mUidMap.tqcontains( todo->uid() ) )
return true; //noop
else
return addIncidence( todo, TQString::null, 0 );
@@ -606,7 +606,7 @@ KCal::Todo::List ResourceScalix::rawTodosForDate( const TQDate& date )
bool ResourceScalix::addJournal( KCal::Journal* journal )
{
- if ( mUidMap.contains( journal->uid() ) )
+ if ( mUidMap.tqcontains( journal->uid() ) )
return true; //noop
else
return addIncidence( journal, TQString::null, 0 );
@@ -657,7 +657,7 @@ void ResourceScalix::setTimeZoneId( const TQString& tzid )
bool ResourceScalix::fromKMailAddIncidence( const TQString& type,
const TQString& subResource,
- Q_UINT32 sernum,
+ TQ_UINT32 sernum,
int /*format*/,
const TQString& data )
{
@@ -689,11 +689,11 @@ void ResourceScalix::fromKMailDelIncidence( const TQString& type,
if ( !subresourceActive( subResource ) ) return;
// Can't be in both, by contract
- if ( mUidsPendingDeletion.contains( uid ) ) {
+ if ( mUidsPendingDeletion.tqcontains( uid ) ) {
mUidsPendingDeletion.remove( 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 {
// We didn't trigger this, so KMail did, remove the reference to the uid
KCal::Incidence* incidence = mCalendar.incidence( uid );
@@ -741,7 +741,7 @@ void ResourceScalix::fromKMailAddSubresource( const TQString& type,
// Not ours
return;
- if ( map->contains( subResource ) )
+ if ( map->tqcontains( subResource ) )
// Already registered
return;
@@ -760,7 +760,7 @@ void ResourceScalix::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
@@ -807,11 +807,11 @@ TQStringList ResourceScalix::subresources() const
const QString
ResourceScalix::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;
}
@@ -819,21 +819,21 @@ ResourceScalix::labelForSubresource( const TQString& subresource ) const
TQString ResourceScalix::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();
}
-void ResourceScalix::fromKMailAsyncLoadResult( const TQMap<Q_UINT32, TQString>& map,
+void ResourceScalix::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() );
}
@@ -843,11 +843,11 @@ bool ResourceScalix::subresourceActive( const TQString& subresource ) const
// before it opens the resource :-( Make sure we are open
const_cast<ResourceScalix*>( 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:
@@ -860,11 +860,11 @@ void ResourceScalix::setSubresourceActive( const TQString &subresource, bool v )
{
ResourceMap *map = 0;
- if ( mEventSubResources.contains( subresource ) )
+ if ( mEventSubResources.tqcontains( subresource ) )
map = &mEventSubResources;
- if ( mTodoSubResources.contains( subresource ) )
+ if ( mTodoSubResources.tqcontains( subresource ) )
map = &mTodoSubResources;
- if ( mJournalSubResources.contains( subresource ) )
+ if ( mJournalSubResources.tqcontains( subresource ) )
map = &mJournalSubResources;
if ( map && ( ( *map )[ subresource ].active() != v ) ) {