summaryrefslogtreecommitdiffstats
path: root/libkpimidentities/identitymanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libkpimidentities/identitymanager.cpp')
-rw-r--r--libkpimidentities/identitymanager.cpp102
1 files changed, 51 insertions, 51 deletions
diff --git a/libkpimidentities/identitymanager.cpp b/libkpimidentities/identitymanager.cpp
index 00f3eae45..4c6ed02ad 100644
--- a/libkpimidentities/identitymanager.cpp
+++ b/libkpimidentities/identitymanager.cpp
@@ -49,24 +49,24 @@ static const char configKeyDefaultIdentity[] = "Default Identity";
#include <kuser.h>
#include <dcopclient.h>
-#include <qregexp.h>
+#include <tqregexp.h>
#include <assert.h>
using namespace KPIM;
-static QCString newDCOPObjectName()
+static TQCString newDCOPObjectName()
{
static int s_count = 0;
- QCString name( "KPIM::IdentityManager" );
+ TQCString name( "KPIM::IdentityManager" );
if ( s_count++ ) {
name += '-';
- name += QCString().setNum( s_count );
+ name += TQCString().setNum( s_count );
}
return name;
}
-IdentityManager::IdentityManager( bool readonly, QObject * parent, const char * name )
+IdentityManager::IdentityManager( bool readonly, TQObject * parent, const char * name )
: ConfigManager( parent, name ), DCOPObject( newDCOPObjectName() )
{
mReadOnly = readonly;
@@ -91,8 +91,8 @@ IdentityManager::IdentityManager( bool readonly, QObject * parent, const char *
}
// The emitter is always called KPIM::IdentityManager even if we are not
- if ( !connectDCOPSignal( 0, "KPIM::IdentityManager", "identitiesChanged(QCString,QCString)",
- "slotIdentitiesChanged(QCString,QCString)", false ) )
+ if ( !connectDCOPSignal( 0, "KPIM::IdentityManager", "identitiesChanged(TQCString,TQCString)",
+ "slotIdentitiesChanged(TQCString,TQCString)", false ) )
kdError(5650) << "IdentityManager: connection to identitiesChanged failed" << endl;
}
@@ -108,16 +108,16 @@ void IdentityManager::commit()
// early out:
if ( !hasPendingChanges() || mReadOnly ) return;
- QValueList<uint> seenUOIDs;
- for ( QValueList<Identity>::ConstIterator it = mIdentities.begin() ;
+ TQValueList<uint> seenUOIDs;
+ for ( TQValueList<Identity>::ConstIterator it = mIdentities.begin() ;
it != mIdentities.end() ; ++it )
seenUOIDs << (*it).uoid();
- QValueList<uint> changedUOIDs;
+ TQValueList<uint> changedUOIDs;
// find added and changed identities:
- for ( QValueList<Identity>::ConstIterator it = mShadowIdentities.begin() ;
+ for ( TQValueList<Identity>::ConstIterator it = mShadowIdentities.begin() ;
it != mShadowIdentities.end() ; ++it ) {
- QValueList<uint>::Iterator uoid = seenUOIDs.find( (*it).uoid() );
+ TQValueList<uint>::Iterator uoid = seenUOIDs.find( (*it).uoid() );
if ( uoid != seenUOIDs.end() ) {
const Identity & orig = identityForUoid( *uoid ); // look it up in mIdentities
if ( *it != orig ) {
@@ -135,7 +135,7 @@ void IdentityManager::commit()
}
// what's left are deleted identities:
- for ( QValueList<uint>::ConstIterator it = seenUOIDs.begin() ;
+ for ( TQValueList<uint>::ConstIterator it = seenUOIDs.begin() ;
it != seenUOIDs.end() ; ++it ) {
kdDebug( 5006 ) << "emitting deleted() for identity " << (*it) << endl;
emit deleted( *it );
@@ -146,7 +146,7 @@ void IdentityManager::commit()
// now that mIdentities has all the new info, we can emit the added/changed
// signals that ship a uoid. This is because the slots might use identityForUoid(uoid)...
- for ( QValueList<uint>::ConstIterator it = changedUOIDs.begin() ;
+ for ( TQValueList<uint>::ConstIterator it = changedUOIDs.begin() ;
it != changedUOIDs.end() ; ++it )
emit changed( *it );
@@ -155,10 +155,10 @@ void IdentityManager::commit()
// DCOP signal for other IdentityManager instances
// The emitter is always set to KPIM::IdentityManager, so that the connect works
// This is why we can't use k_dcop_signals here, but need to use emitDCOPSignal
- QByteArray data; QDataStream arg( data, IO_WriteOnly );
+ TQByteArray data; TQDataStream arg( data, IO_WriteOnly );
arg << kapp->dcopClient()->appId();
arg << DCOPObject::objId(); // the real objId, for checking in slotIdentitiesChanged
- kapp->dcopClient()->emitDCOPSignal( "KPIM::IdentityManager", "identitiesChanged(QCString,QCString)", data );
+ kapp->dcopClient()->emitDCOPSignal( "KPIM::IdentityManager", "identitiesChanged(TQCString,TQCString)", data );
}
void IdentityManager::rollback()
@@ -171,18 +171,18 @@ bool IdentityManager::hasPendingChanges() const
return mIdentities != mShadowIdentities;
}
-QStringList IdentityManager::identities() const
+TQStringList IdentityManager::identities() const
{
- QStringList result;
+ TQStringList result;
for ( ConstIterator it = mIdentities.begin() ;
it != mIdentities.end() ; ++it )
result << (*it).identityName();
return result;
}
-QStringList IdentityManager::shadowIdentities() const
+TQStringList IdentityManager::shadowIdentities() const
{
- QStringList result;
+ TQStringList result;
for ( ConstIterator it = mShadowIdentities.begin() ;
it != mShadowIdentities.end() ; ++it )
result << (*it).identityName();
@@ -194,14 +194,14 @@ void IdentityManager::sort() {
}
void IdentityManager::writeConfig() const {
- QStringList identities = groupList(mConfig);
- for ( QStringList::Iterator group = identities.begin() ;
+ TQStringList identities = groupList(mConfig);
+ for ( TQStringList::Iterator group = identities.begin() ;
group != identities.end() ; ++group )
mConfig->deleteGroup( *group );
int i = 0;
for ( ConstIterator it = mIdentities.begin() ;
it != mIdentities.end() ; ++it, ++i ) {
- KConfigGroup cg( mConfig, QString::fromLatin1("Identity #%1").arg(i) );
+ KConfigGroup cg( mConfig, TQString::fromLatin1("Identity #%1").arg(i) );
(*it).writeConfig( &cg );
if ( (*it).isDefault() ) {
// remember which one is default:
@@ -223,14 +223,14 @@ void IdentityManager::writeConfig() const {
void IdentityManager::readConfig(KConfigBase* config) {
mIdentities.clear();
- QStringList identities = groupList(config);
+ TQStringList identities = groupList(config);
if ( identities.isEmpty() ) return; // nothing to be done...
KConfigGroup general( config, "General" );
uint defaultIdentity = general.readUnsignedNumEntry( configKeyDefaultIdentity );
bool haveDefault = false;
- for ( QStringList::Iterator group = identities.begin() ;
+ for ( TQStringList::Iterator group = identities.begin() ;
group != identities.end() ; ++group ) {
KConfigGroup configGroup( config, *group );
mIdentities << Identity();
@@ -249,8 +249,8 @@ void IdentityManager::readConfig(KConfigBase* config) {
mShadowIdentities = mIdentities;
}
-QStringList IdentityManager::groupList(KConfigBase* config) const {
- return config->groupList().grep( QRegExp("^Identity #\\d+$") );
+TQStringList IdentityManager::groupList(KConfigBase* config) const {
+ return config->groupList().grep( TQRegExp("^Identity #\\d+$") );
}
IdentityManager::ConstIterator IdentityManager::begin() const {
@@ -269,7 +269,7 @@ IdentityManager::Iterator IdentityManager::modifyEnd() {
return mShadowIdentities.end();
}
-const Identity & IdentityManager::identityForName( const QString & name ) const
+const Identity & IdentityManager::identityForName( const TQString & name ) const
{
kdWarning( 5006 )
<< "deprecated method IdentityManager::identityForName() called!" << endl;
@@ -284,7 +284,7 @@ const Identity & IdentityManager::identityForUoid( uint uoid ) const {
return Identity::null();
}
-const Identity & IdentityManager::identityForNameOrDefault( const QString & name ) const
+const Identity & IdentityManager::identityForNameOrDefault( const TQString & name ) const
{
const Identity & ident = identityForName( name );
if ( ident.isNull() )
@@ -302,14 +302,14 @@ const Identity & IdentityManager::identityForUoidOrDefault( uint uoid ) const
return ident;
}
-const Identity & IdentityManager::identityForAddress( const QString & addresses ) const
+const Identity & IdentityManager::identityForAddress( const TQString & addresses ) const
{
- QStringList addressList = KPIM::splitEmailAddrList( addresses );
+ TQStringList addressList = KPIM::splitEmailAddrList( addresses );
for ( ConstIterator it = begin() ; it != end() ; ++it ) {
- for( QStringList::ConstIterator addrIt = addressList.begin();
+ for( TQStringList::ConstIterator addrIt = addressList.begin();
addrIt != addressList.end(); ++addrIt ) {
- // I use QString::utf8() instead of QString::latin1() because I want
- // a QCString and not a char*. It doesn't matter because emailAddr()
+ // I use TQString::utf8() instead of TQString::latin1() because I want
+ // a TQCString and not a char*. It doesn't matter because emailAddr()
// returns a 7-bit string.
if( (*it).emailAddr().lower() ==
KPIM::getEmailAddress( *addrIt ).lower() ) {
@@ -320,11 +320,11 @@ const Identity & IdentityManager::identityForAddress( const QString & addresses
return Identity::null();
}
-bool IdentityManager::thatIsMe( const QString & addressList ) const {
+bool IdentityManager::thatIsMe( const TQString & addressList ) const {
return !identityForAddress( addressList ).isNull();
}
-Identity & IdentityManager::modifyIdentityForName( const QString & name )
+Identity & IdentityManager::modifyIdentityForName( const TQString & name )
{
for ( Iterator it = modifyBegin() ; it != modifyEnd() ; ++it )
if ( (*it).identityName() == name ) return (*it);
@@ -350,9 +350,9 @@ const Identity & IdentityManager::defaultIdentity() const {
return *begin();
}
-bool IdentityManager::setAsDefault( const QString & name ) {
+bool IdentityManager::setAsDefault( const TQString & name ) {
// First, check if the identity actually exists:
- QStringList names = shadowIdentities();
+ TQStringList names = shadowIdentities();
if ( names.find( name ) == names.end() ) return false;
// Then, change the default as requested:
for ( Iterator it = modifyBegin() ; it != modifyEnd() ; ++it )
@@ -381,7 +381,7 @@ bool IdentityManager::setAsDefault( uint uoid ) {
return true;
}
-bool IdentityManager::removeIdentity( const QString & name ) {
+bool IdentityManager::removeIdentity( const TQString & name ) {
for ( Iterator it = modifyBegin() ; it != modifyEnd() ; ++it )
if ( (*it).identityName() == name ) {
bool removedWasDefault = (*it).isDefault();
@@ -393,11 +393,11 @@ bool IdentityManager::removeIdentity( const QString & name ) {
return false;
}
-Identity & IdentityManager::newFromScratch( const QString & name ) {
+Identity & IdentityManager::newFromScratch( const TQString & name ) {
return newFromExisting( Identity( name ) );
}
-Identity & IdentityManager::newFromControlCenter( const QString & name ) {
+Identity & IdentityManager::newFromControlCenter( const TQString & name ) {
KEMailSettings es;
es.setProfile( es.defaultProfileName() );
@@ -410,7 +410,7 @@ Identity & IdentityManager::newFromControlCenter( const QString & name ) {
}
Identity & IdentityManager::newFromExisting( const Identity & other,
- const QString & name ) {
+ const TQString & name ) {
mShadowIdentities << other;
Identity & result = mShadowIdentities.last();
result.setIsDefault( false ); // we don't want two default identities!
@@ -421,7 +421,7 @@ Identity & IdentityManager::newFromExisting( const Identity & other,
}
void IdentityManager::createDefaultIdentity() {
- QString fullName, emailAddress;
+ TQString fullName, emailAddress;
bool done = false;
// Check if the application has any settings
@@ -445,12 +445,12 @@ void IdentityManager::createDefaultIdentity() {
emailAddress = user.loginName();
if ( !emailAddress.isEmpty() ) {
KConfigGroup general( mConfig, "General" );
- QString defaultdomain = general.readEntry( "Default domain" );
+ TQString defaultdomain = general.readEntry( "Default domain" );
if( !defaultdomain.isEmpty() ) {
emailAddress += '@' + defaultdomain;
}
else {
- emailAddress = QString::null;
+ emailAddress = TQString::null;
}
}
}
@@ -471,15 +471,15 @@ int IdentityManager::newUoid()
int uoid;
// determine the UOIDs of all saved identities
- QValueList<uint> usedUOIDs;
- for ( QValueList<Identity>::ConstIterator it = mIdentities.begin() ;
+ TQValueList<uint> usedUOIDs;
+ for ( TQValueList<Identity>::ConstIterator it = mIdentities.begin() ;
it != mIdentities.end() ; ++it )
usedUOIDs << (*it).uoid();
if ( hasPendingChanges() ) {
// add UOIDs of all shadow identities. Yes, we will add a lot of duplicate
// UOIDs, but avoiding duplicate UOIDs isn't worth the effort.
- for ( QValueList<Identity>::ConstIterator it = mShadowIdentities.begin() ;
+ for ( TQValueList<Identity>::ConstIterator it = mShadowIdentities.begin() ;
it != mShadowIdentities.end() ; ++it ) {
usedUOIDs << (*it).uoid();
}
@@ -495,16 +495,16 @@ int IdentityManager::newUoid()
return uoid;
}
-QStringList KPIM::IdentityManager::allEmails() const
+TQStringList KPIM::IdentityManager::allEmails() const
{
- QStringList lst;
+ TQStringList lst;
for ( ConstIterator it = begin() ; it != end() ; ++it ) {
lst << (*it).emailAddr();
}
return lst;
}
-void KPIM::IdentityManager::slotIdentitiesChanged( QCString appId, QCString objId )
+void KPIM::IdentityManager::slotIdentitiesChanged( TQCString appId, TQCString objId )
{
// From standalone kmail to standalone korganizer, the appId will differ
// From kontact the appId will match, so we need to test the objId