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 /kresources/kolab/knotes/resourcekolab.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 'kresources/kolab/knotes/resourcekolab.cpp')
-rw-r--r-- | kresources/kolab/knotes/resourcekolab.cpp | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/kresources/kolab/knotes/resourcekolab.cpp b/kresources/kolab/knotes/resourcekolab.cpp index b5cad153a..1d633b62a 100644 --- a/kresources/kolab/knotes/resourcekolab.cpp +++ b/kresources/kolab/knotes/resourcekolab.cpp @@ -51,7 +51,7 @@ static const char* inlineMimeType = "text/calendar"; ResourceKolab::ResourceKolab( const KConfig *config ) : ResourceNotes( config ), ResourceKolabBase( "ResourceKolab-KNotes" ), - mCalendar( QString::fromLatin1("UTC") ) + mCalendar( TQString::fromLatin1("UTC") ) { setType( "imap" ); } @@ -66,15 +66,15 @@ bool ResourceKolab::doOpen() config.setGroup( configGroupName ); // Get the list of Notes folders from KMail - QValueList<KMailICalIface::SubResource> subResources; + TQValueList<KMailICalIface::SubResource> subResources; if ( !kmailSubresources( subResources, kmailContentsType ) ) return false; // Make the resource map from the folder list - QValueList<KMailICalIface::SubResource>::ConstIterator it; + TQValueList<KMailICalIface::SubResource>::ConstIterator it; mSubResources.clear(); for ( it = subResources.begin(); it != subResources.end(); ++it ) { - const QString subResource = (*it).location; + const TQString subResource = (*it).location; const bool active = config.readBoolEntry( subResource, true ); mSubResources[ subResource ] = Kolab::SubResource( active, (*it).writable, (*it).label ); } @@ -91,8 +91,8 @@ void ResourceKolab::doClose() config.writeEntry( it.key(), it.data().active() ); } -bool ResourceKolab::loadSubResource( const QString& subResource, - const QString &mimetype ) +bool ResourceKolab::loadSubResource( const TQString& subResource, + const TQString &mimetype ) { // Get the list of journals int count = 0; @@ -101,7 +101,7 @@ bool ResourceKolab::loadSubResource( const QString& subResource, return false; } - QMap<Q_UINT32, QString> lst; + TQMap<Q_UINT32, TQString> lst; if( !kmailIncidences( lst, mimetype, subResource, 0, count ) ) { kdError(5500) << "Communication problem in " << "ResourceKolab::getIncidenceList()\n"; @@ -113,7 +113,7 @@ bool ResourceKolab::loadSubResource( const QString& subResource, // Populate with the new entries const bool silent = mSilent; mSilent = true; - QMap<Q_UINT32, QString>::Iterator it; + TQMap<Q_UINT32, TQString>::Iterator it; for ( it = lst.begin(); it != lst.end(); ++it ) { KCal::Journal* journal = addNote( it.data(), subResource, it.key(), mimetype ); if ( !journal ) @@ -139,7 +139,7 @@ bool ResourceKolab::load() // This subResource is disabled continue; - QString mimetype = inlineMimeType; + TQString mimetype = inlineMimeType; rc &= loadSubResource( itR.key(), mimetype ); mimetype = attachmentMimeType; rc &= loadSubResource( itR.key(), mimetype ); @@ -156,11 +156,11 @@ bool ResourceKolab::save() bool ResourceKolab::addNote( KCal::Journal* journal ) { - return addNote( journal, QString::null, 0 ); + return addNote( journal, TQString::null, 0 ); } -KCal::Journal* ResourceKolab::addNote( const QString& data, const QString& subresource, - Q_UINT32 sernum, const QString &mimetype ) +KCal::Journal* ResourceKolab::addNote( const TQString& data, const TQString& subresource, + Q_UINT32 sernum, const TQString &mimetype ) { KCal::Journal* journal = 0; // FIXME: This does not take into account the time zone! @@ -180,7 +180,7 @@ KCal::Journal* ResourceKolab::addNote( const QString& data, const QString& subre } bool ResourceKolab::addNote( KCal::Journal* journal, - const QString& subresource, Q_UINT32 sernum ) + const TQString& subresource, Q_UINT32 sernum ) { kdDebug(5500) << "ResourceKolab::addNote( KCal::Journal*, '" << subresource << "', " << sernum << " )\n"; @@ -190,13 +190,13 @@ bool ResourceKolab::addNote( KCal::Journal* journal, bool newNote = subresource.isEmpty(); mCalendar.addJournal( journal ); - QString resource = + TQString resource = newNote ? findWritableResource( mSubResources ) : subresource; if ( resource.isEmpty() ) // canceled return false; if ( !mSilent ) { - QString xml = Note::journalToXML( journal ); + TQString xml = Note::journalToXML( journal ); kdDebug(5500) << k_funcinfo << "XML string:\n" << xml << endl; if( !kmailUpdate( resource, sernum, xml, attachmentMimeType, journal->uid() ) ) { @@ -215,7 +215,7 @@ bool ResourceKolab::addNote( KCal::Journal* journal, bool ResourceKolab::deleteNote( KCal::Journal* journal ) { - const QString uid = journal->uid(); + const TQString uid = journal->uid(); if ( !mUidMap.contains( uid ) ) // Odd return false; @@ -230,20 +230,20 @@ bool ResourceKolab::deleteNote( KCal::Journal* journal ) return true; } -KCal::Alarm::List ResourceKolab::alarms( const QDateTime& from, const QDateTime& to ) +KCal::Alarm::List ResourceKolab::alarms( const TQDateTime& from, const TQDateTime& to ) { KCal::Alarm::List alarms; KCal::Journal::List notes = mCalendar.journals(); KCal::Journal::List::ConstIterator note; for ( note = notes.begin(); note != notes.end(); ++note ) { - QDateTime preTime = from.addSecs( -1 ); + TQDateTime preTime = from.addSecs( -1 ); KCal::Alarm::List::ConstIterator it; for( it = (*note)->alarms().begin(); it != (*note)->alarms().end(); ++it ) { if ( (*it)->enabled() ) { - QDateTime dt = (*it)->nextRepetition( preTime ); + TQDateTime dt = (*it)->nextRepetition( preTime ); if ( dt.isValid() && dt <= to ) alarms.append( *it ); } @@ -255,7 +255,7 @@ KCal::Alarm::List ResourceKolab::alarms( const QDateTime& from, const QDateTime& void ResourceKolab::incidenceUpdated( KCal::IncidenceBase* i ) { - QString subResource; + TQString subResource; Q_UINT32 sernum; if ( mUidMap.contains( i->uid() ) ) { subResource = mUidMap[ i->uid() ].resource(); @@ -268,7 +268,7 @@ void ResourceKolab::incidenceUpdated( KCal::IncidenceBase* i ) } KCal::Journal* journal = dynamic_cast<KCal::Journal*>( i ); - QString xml = Note::journalToXML( journal ); + TQString xml = Note::journalToXML( journal ); if( !xml.isEmpty() && kmailUpdate( subResource, sernum, xml, attachmentMimeType, journal->uid() ) ) mUidMap[ i->uid() ] = StorageReference( subResource, sernum ); } @@ -277,18 +277,18 @@ void ResourceKolab::incidenceUpdated( KCal::IncidenceBase* i ) * These are the DCOP slots that KMail call to notify when something * changed. */ -bool ResourceKolab::fromKMailAddIncidence( const QString& type, - const QString& subResource, +bool ResourceKolab::fromKMailAddIncidence( const TQString& type, + const TQString& subResource, Q_UINT32 sernum, int format, - const QString& note ) + const TQString& note ) { // Check if this is a note if( type != kmailContentsType ) return false; const bool silent = mSilent; mSilent = true; - QString mimetype; + TQString mimetype; if ( format == KMailICalIface::StorageXML ) mimetype = attachmentMimeType; else @@ -300,9 +300,9 @@ bool ResourceKolab::fromKMailAddIncidence( const QString& type, return true; } -void ResourceKolab::fromKMailDelIncidence( const QString& type, - const QString& /*subResource*/, - const QString& uid ) +void ResourceKolab::fromKMailDelIncidence( const TQString& type, + const TQString& /*subResource*/, + const TQString& uid ) { // Check if this is a note if( type != kmailContentsType ) return; @@ -318,16 +318,16 @@ void ResourceKolab::fromKMailDelIncidence( const QString& type, mSilent = silent; } -void ResourceKolab::fromKMailRefresh( const QString& type, - const QString& /*subResource*/ ) +void ResourceKolab::fromKMailRefresh( const TQString& type, + const TQString& /*subResource*/ ) { if ( type == kmailContentsType ) load(); // ### should call loadSubResource(subResource) probably } -void ResourceKolab::fromKMailAddSubresource( const QString& type, - const QString& subResource, - const QString& /*label*/, +void ResourceKolab::fromKMailAddSubresource( const TQString& type, + const TQString& subResource, + const TQString& /*label*/, bool writable, bool /*alarmRelevant*/ ) { @@ -348,8 +348,8 @@ void ResourceKolab::fromKMailAddSubresource( const QString& type, emit signalSubresourceAdded( this, type, subResource ); } -void ResourceKolab::fromKMailDelSubresource( const QString& type, - const QString& subResource ) +void ResourceKolab::fromKMailDelSubresource( const TQString& type, + const TQString& subResource ) { if ( type != configGroupName ) // Not ours @@ -369,7 +369,7 @@ void ResourceKolab::fromKMailDelSubresource( const QString& type, // Make a list of all uids to remove Kolab::UidMap::ConstIterator mapIt; - QStringList uids; + TQStringList uids; for ( mapIt = mUidMap.begin(); mapIt != mUidMap.end(); ++mapIt ) if ( mapIt.data().resource() == subResource ) // We have a match @@ -379,7 +379,7 @@ void ResourceKolab::fromKMailDelSubresource( const QString& type, if ( !uids.isEmpty() ) { const bool silent = mSilent; mSilent = true; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for ( it = uids.begin(); it != uids.end(); ++it ) { KCal::Journal* j = mCalendar.journal( *it ); if( j ) @@ -391,21 +391,21 @@ void ResourceKolab::fromKMailDelSubresource( const QString& type, emit signalSubresourceRemoved( this, type, subResource ); } -void ResourceKolab::fromKMailAsyncLoadResult( const QMap<Q_UINT32, QString>& map, - const QString& type, - const QString& folder ) +void ResourceKolab::fromKMailAsyncLoadResult( const TQMap<Q_UINT32, TQString>& map, + const TQString& type, + const TQString& folder ) { // We are only interested in notes if ( ( type != attachmentMimeType ) && ( type != inlineMimeType ) ) return; // Populate with the new entries const bool silent = mSilent; mSilent = true; - QString mimetype; + TQString mimetype; if ( kmailStorageFormat( folder ) == KMailICalIface::StorageXML ) mimetype = attachmentMimeType; else mimetype = inlineMimeType; - for( QMap<Q_UINT32, QString>::ConstIterator it = map.begin(); it != map.end(); ++it ) { + for( TQMap<Q_UINT32, TQString>::ConstIterator it = map.begin(); it != map.end(); ++it ) { KCal::Journal* journal = addNote( it.data(), folder, it.key(), mimetype ); if ( !journal ) kdDebug(5500) << "loading note " << it.key() << " failed" << endl; @@ -416,12 +416,12 @@ void ResourceKolab::fromKMailAsyncLoadResult( const QMap<Q_UINT32, QString>& map } -QStringList ResourceKolab::subresources() const +TQStringList ResourceKolab::subresources() const { return mSubResources.keys(); } -bool ResourceKolab::subresourceActive( const QString& res ) const +bool ResourceKolab::subresourceActive( const TQString& res ) const { if ( mSubResources.contains( res ) ) { return mSubResources[ res ].active(); |