summaryrefslogtreecommitdiffstats
path: root/kontact/src/profilemanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kontact/src/profilemanager.cpp')
-rw-r--r--kontact/src/profilemanager.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/kontact/src/profilemanager.cpp b/kontact/src/profilemanager.cpp
index 53419cc5..bb8d5095 100644
--- a/kontact/src/profilemanager.cpp
+++ b/kontact/src/profilemanager.cpp
@@ -33,11 +33,11 @@
#include <kstaticdeleter.h>
#include <kurl.h>
-#include <qdir.h>
-#include <qstringlist.h>
-#include <qvaluelist.h>
+#include <tqdir.h>
+#include <tqstringlist.h>
+#include <tqvaluelist.h>
-Kontact::Profile::Profile( const QString& id, bool isLocal ) : m_id( id ), m_local( isLocal )
+Kontact::Profile::Profile( const TQString& id, bool isLocal ) : m_id( id ), m_local( isLocal )
{
}
@@ -45,17 +45,17 @@ Kontact::Profile::Profile() : m_local( false )
{
}
-QString Kontact::Profile::id() const
+TQString Kontact::Profile::id() const
{
return m_id;
}
-QString Kontact::Profile::name() const
+TQString Kontact::Profile::name() const
{
return m_name;
}
-QString Kontact::Profile::description() const
+TQString Kontact::Profile::description() const
{
return m_description;
}
@@ -65,17 +65,17 @@ bool Kontact::Profile::isNull() const
return m_id.isNull();
}
-void Kontact::Profile::setId( const QString& id )
+void Kontact::Profile::setId( const TQString& id )
{
m_id = id;
}
-void Kontact::Profile::setDescription( const QString& description )
+void Kontact::Profile::setDescription( const TQString& description )
{
m_description = description;
}
-void Kontact::Profile::setName( const QString& name )
+void Kontact::Profile::setName( const TQString& name )
{
m_name = name;
}
@@ -96,18 +96,18 @@ bool Kontact::Profile::isLocal() const
return m_local;
}
-void Kontact::Profile::setOriginalLocation( const QString& path )
+void Kontact::Profile::setOriginalLocation( const TQString& path )
{
m_originalLocation = path;
}
-QString Kontact::Profile::localSaveLocation() const
+TQString Kontact::Profile::localSaveLocation() const
{
- return m_id.isNull() ? QString() : locateLocal( "data", "kontact/profiles/" + m_id, /*create folder=*/true );
+ return m_id.isNull() ? TQString() : locateLocal( "data", "kontact/profiles/" + m_id, /*create folder=*/true );
}
-QString Kontact::Profile::saveLocation() const
+TQString Kontact::Profile::saveLocation() const
{
return m_local ? localSaveLocation() : m_originalLocation;
}
@@ -131,7 +131,7 @@ Kontact::ProfileManager* Kontact::ProfileManager::self()
return m_self;
}
-Kontact::ProfileManager::ProfileManager( QObject* parent ) : QObject( parent )
+Kontact::ProfileManager::ProfileManager( TQObject* parent ) : TQObject( parent )
{
}
@@ -142,19 +142,19 @@ Kontact::ProfileManager::~ProfileManager()
void Kontact::ProfileManager::writeConfig() const
{
- const QValueList<Kontact::Profile> profiles = m_profiles.values();
- for ( QValueList<Kontact::Profile>::ConstIterator it = profiles.begin(), end = profiles.end(); it != end; ++it )
+ const TQValueList<Kontact::Profile> profiles = m_profiles.values();
+ for ( TQValueList<Kontact::Profile>::ConstIterator it = profiles.begin(), end = profiles.end(); it != end; ++it )
{
writeProfileConfig( *it );
}
}
-Kontact::Profile Kontact::ProfileManager::readFromConfiguration( const QString& configFile, bool isLocal )
+Kontact::Profile Kontact::ProfileManager::readFromConfiguration( const TQString& configFile, bool isLocal )
{
KConfig profileCfg( configFile, true /*read-only*/, false /*no KDE global*/ );
- const QString configDir = configFile.left( configFile.findRev( QDir::separator(), -1 ) );
+ const TQString configDir = configFile.left( configFile.findRev( TQDir::separator(), -1 ) );
profileCfg.setGroup( "Kontact Profile" );
- const QString id = profileCfg.readEntry( "Identifier" );
+ const TQString id = profileCfg.readEntry( "Identifier" );
Kontact::Profile profile( id );
profile.setName( profileCfg.readEntry( "Name" ) );
profile.setDescription( profileCfg.readEntry( "Description" ) );
@@ -166,8 +166,8 @@ Kontact::Profile Kontact::ProfileManager::readFromConfiguration( const QString&
void Kontact::ProfileManager::writeProfileConfig( const Kontact::Profile& profile ) const
{
- const QString profileDir = profile.saveLocation();
- const QString cfgPath = profileDir + "/profile.cfg";
+ const TQString profileDir = profile.saveLocation();
+ const TQString cfgPath = profileDir + "/profile.cfg";
KConfig profileCfg( cfgPath, false /*read-only*/, false /*no KDE global*/ );
profileCfg.setGroup( "Kontact Profile" );
profileCfg.writeEntry( "Identifier", profile.id() );
@@ -178,14 +178,14 @@ void Kontact::ProfileManager::writeProfileConfig( const Kontact::Profile& profil
void Kontact::ProfileManager::readConfig()
{
- const QStringList profilePaths = KGlobal::dirs()->findAllResources( "data", QString::fromLatin1( "kontact/profiles/*/profile.cfg" ) );
+ const TQStringList profilePaths = KGlobal::dirs()->findAllResources( "data", TQString::fromLatin1( "kontact/profiles/*/profile.cfg" ) );
- typedef QMap<QString, Kontact::Profile> ProfileMap;
+ typedef TQMap<TQString, Kontact::Profile> ProfileMap;
ProfileMap profiles;
ProfileMap globalProfiles;
- const QString localPrefix = locateLocal( "data", "kontact/profiles/", /*createDir=*/false );
- for ( QStringList::ConstIterator it = profilePaths.begin(), end = profilePaths.end(); it != end; ++it )
+ const TQString localPrefix = locateLocal( "data", "kontact/profiles/", /*createDir=*/false );
+ for ( TQStringList::ConstIterator it = profilePaths.begin(), end = profilePaths.end(); it != end; ++it )
{
const bool isLocal = (*it).startsWith( localPrefix );
const Kontact::Profile profile = readFromConfiguration( *it, isLocal );
@@ -209,19 +209,19 @@ void Kontact::ProfileManager::readConfig()
}
}
-QValueList<Kontact::Profile> Kontact::ProfileManager::profiles() const
+TQValueList<Kontact::Profile> Kontact::ProfileManager::profiles() const
{
return m_profiles.values();
}
-Kontact::Profile Kontact::ProfileManager::profileById( const QString& id ) const
+Kontact::Profile Kontact::ProfileManager::profileById( const TQString& id ) const
{
return m_profiles[id];
}
void Kontact::ProfileManager::updateProfile( const Kontact::Profile& profile_ )
{
- const QString id = profile_.id();
+ const TQString id = profile_.id();
if ( id.isNull() || m_profiles[id] == profile_ )
return;
Kontact::Profile profile( profile_ );
@@ -231,7 +231,7 @@ void Kontact::ProfileManager::updateProfile( const Kontact::Profile& profile_ )
emit profileUpdated( id );
}
-void Kontact::Profile::copyConfigFiles( const QString& source_, const QString& dest_ )
+void Kontact::Profile::copyConfigFiles( const TQString& source_, const TQString& dest_ )
{
const KURL source = KURL::fromPathOrURL( source_+"/*rc" );
const KURL dest = KURL::fromPathOrURL( dest_ );
@@ -239,7 +239,7 @@ void Kontact::Profile::copyConfigFiles( const QString& source_, const QString& d
// TODO better check for the copy result
}
-void Kontact::ProfileManager::saveToProfile( const QString& id )
+void Kontact::ProfileManager::saveToProfile( const TQString& id )
{
Kontact::Profile profile = profileById( id );
if ( profile.isNull() )
@@ -251,7 +251,7 @@ void Kontact::ProfileManager::saveToProfile( const QString& id )
bool Kontact::ProfileManager::addProfile( const Kontact::Profile& profile, bool syncConfig )
{
- const QString id = profile.id();
+ const TQString id = profile.id();
if ( m_profiles.contains( id ) )
return false;
m_profiles[id] = profile;
@@ -264,7 +264,7 @@ bool Kontact::ProfileManager::addProfile( const Kontact::Profile& profile, bool
return true;
}
-void Kontact::ProfileManager::loadProfile( const QString& id )
+void Kontact::ProfileManager::loadProfile( const TQString& id )
{
if ( !m_profiles.contains( id ) )
return;
@@ -276,7 +276,7 @@ void Kontact::ProfileManager::removeProfile( const Kontact::Profile& profile )
removeProfile( profile.id() );
}
-void Kontact::ProfileManager::removeProfile( const QString& id )
+void Kontact::ProfileManager::removeProfile( const TQString& id )
{
if ( !m_profiles.contains( id ) )
return;
@@ -290,17 +290,17 @@ void Kontact::ProfileManager::removeProfile( const QString& id )
emit profileRemoved( id );
}
-Kontact::ProfileManager::ExportError Kontact::ProfileManager::exportProfileToDirectory( const QString& id, const QString& path )
+Kontact::ProfileManager::ExportError Kontact::ProfileManager::exportProfileToDirectory( const TQString& id, const TQString& path )
{
if ( !m_profiles.contains( id ) )
return SuccessfulExport;
- if ( !QDir( path ).exists() )
+ if ( !TQDir( path ).exists() )
return DirectoryDoesNotExist;
const Kontact::Profile profile = profileById( id );
const KURL source = KURL::fromPathOrURL( profile.saveLocation() );
- const KURL target = KURL::fromPathOrURL( path + QDir::separator() + profile.name() );
+ const KURL target = KURL::fromPathOrURL( path + TQDir::separator() + profile.name() );
KIO::CopyJob* job = KIO::copy( source, target, /*showProgressInfo=*/false );
// TODO check result
@@ -308,7 +308,7 @@ Kontact::ProfileManager::ExportError Kontact::ProfileManager::exportProfileToDir
return SuccessfulExport;
}
-Kontact::ProfileManager::ImportError Kontact::ProfileManager::importProfileFromDirectory( const QString& path )
+Kontact::ProfileManager::ImportError Kontact::ProfileManager::importProfileFromDirectory( const TQString& path )
{
Kontact::Profile profile = readFromConfiguration( path + "/profile.cfg", /*isLocal=*/ true );
if ( profile.isNull() )
@@ -327,11 +327,11 @@ Kontact::ProfileManager::ImportError Kontact::ProfileManager::importProfileFromD
return SuccessfulImport;
}
-QString Kontact::ProfileManager::generateNewId() const
+TQString Kontact::ProfileManager::generateNewId() const
{
while ( true )
{
- const QString newId = KApplication::randomString( 10 );
+ const TQString newId = KApplication::randomString( 10 );
if ( !m_profiles.contains( newId ) )
return newId;
}