KVIrc
4.9.2
DeveloperAPIs
|
The class to manage the user identity. More...
#include <KviUserIdentityManager.h>
Public Member Functions | |
void | copyFrom (KviUserIdentityManager *pWorkingCopy) |
Carbon copy. More... | |
KviUserIdentityManager * | createWorkingCopy () |
Creates a new working copy. More... | |
const KviUserIdentity * | defaultIdentity () |
Returns the default identity It's NEVER null. More... | |
const KviUserIdentity * | findIdentity (const QString &szId) |
Searches fot an identity. More... | |
KviPointerHashTable< QString, KviUserIdentity > * | identityDict () |
Returns the identity dictionary. More... | |
void | load (const QString &szFileName) |
Loads the user identity database. More... | |
void | releaseWorkingCopy (KviUserIdentityManager *pWorkingCopy) |
Deletes the working copy. More... | |
void | save (const QString &szFileName) |
Saves the user identity database. More... | |
void | setDefaultIdentity (const QString &szIdentityId) |
Sets the default identity. More... | |
Static Public Member Functions | |
static void | done () |
Deletese the user identity. More... | |
static void | init () |
Initializes a new user identity. More... | |
static KviUserIdentityManager * | instance () |
Returns the instance of the identity. More... | |
Protected Member Functions | |
KviUserIdentityManager () | |
Constructs the user identity manager object. More... | |
~KviUserIdentityManager () | |
Destroys the user identity manager object. More... | |
Protected Attributes | |
KviPointerHashTable< QString, KviUserIdentity > * | m_pIdentityDict |
QString | m_szDefaultIdentity |
Static Protected Attributes | |
static KviUserIdentityManager * | m_pInstance = nullptr |
The class to manage the user identity.
|
protected |
Constructs the user identity manager object.
References m_pIdentityDict, and KviPointerHashTable< Key, T >::setAutoDelete().
Referenced by createWorkingCopy(), and init().
|
protected |
Destroys the user identity manager object.
References m_pIdentityDict.
void KviUserIdentityManager::copyFrom | ( | KviUserIdentityManager * | pWorkingCopy | ) |
Carbon copy.
pWorkingCopy | The source working copy |
References KviPointerHashTable< Key, T >::clear(), KviUserIdentity::copyFrom(), KviPointerHashTableIterator< Key, T >::current(), KviUserIdentity::id(), m_pIdentityDict, m_szDefaultIdentity, and KviPointerHashTable< Key, T >::replace().
Referenced by createWorkingCopy().
KviUserIdentityManager * KviUserIdentityManager::createWorkingCopy | ( | ) |
Creates a new working copy.
References copyFrom(), and KviUserIdentityManager().
const KviUserIdentity * KviUserIdentityManager::defaultIdentity | ( | ) |
Returns the default identity It's NEVER null.
References __tr2qs, KviPointerHashTableIterator< Key, T >::current(), KviPointerHashTable< Key, T >::find(), KviUserIdentity::id(), KVI_DEFAULT_NICKNAME1, KVI_DEFAULT_NICKNAME2, KVI_DEFAULT_NICKNAME3, KVI_DEFAULT_NICKNAME4, KVI_DEFAULT_NICKNAME_TOKEN, KVI_DEFAULT_PART_MESSAGE, KVI_DEFAULT_QUIT_MESSAGE, KVI_DEFAULT_REALNAME, KVI_DEFAULT_USERNAME, m_pIdentityDict, m_szDefaultIdentity, KviPointerHashTable< Key, T >::replace(), KviUserIdentity::setAltNickName1(), KviUserIdentity::setAltNickName2(), KviUserIdentity::setAltNickName3(), KviUserIdentity::setId(), KviUserIdentity::setNickName(), KviUserIdentity::setPartMessage(), KviUserIdentity::setQuitMessage(), KviUserIdentity::setRealName(), and KviUserIdentity::setUserName().
Referenced by KviIrcContext::connectToCurrentServer().
|
static |
Deletese the user identity.
References m_pInstance.
Referenced by KviApplication::~KviApplication().
|
inline |
Searches fot an identity.
szId | The identity id to find |
Referenced by KviIrcContext::connectToCurrentServer().
|
inline |
Returns the identity dictionary.
|
static |
Initializes a new user identity.
References KviUserIdentityManager(), and m_pInstance.
Referenced by KviApplication::setup().
|
inlinestatic |
Returns the instance of the identity.
Referenced by KviIrcContext::connectToCurrentServer(), KviApplication::saveIdentities(), and KviApplication::setup().
void KviUserIdentityManager::load | ( | const QString & | szFileName | ) |
Loads the user identity database.
szFileName | The filename where to load |
References KviPointerHashTable< Key, T >::clear(), KviPointerHashTableIterator< Key, T >::current(), KviPointerHashTableIterator< Key, T >::currentKey(), KviConfigurationFile::dict(), KviQString::equalCI(), KviUserIdentity::id(), KviUserIdentity::load(), m_pIdentityDict, m_szDefaultIdentity, KviConfigurationFile::Read, KviConfigurationFile::readEntry(), KviPointerHashTable< Key, T >::replace(), and KviConfigurationFile::setGroup().
Referenced by KviApplication::setup().
void KviUserIdentityManager::releaseWorkingCopy | ( | KviUserIdentityManager * | pWorkingCopy | ) |
Deletes the working copy.
pWorkingCopy | The source working copy |
void KviUserIdentityManager::save | ( | const QString & | szFileName | ) |
Saves the user identity database.
szFileName | The filename where to save |
References KviConfigurationFile::clear(), KviPointerHashTableIterator< Key, T >::current(), m_pIdentityDict, m_szDefaultIdentity, KviConfigurationFile::setGroup(), KviConfigurationFile::Write, and KviConfigurationFile::writeEntry().
Referenced by KviApplication::saveIdentities().
|
inline |
Sets the default identity.
szIdentityId | The identity id to set |
|
protected |
Referenced by copyFrom(), defaultIdentity(), KviUserIdentityManager(), load(), save(), and ~KviUserIdentityManager().
|
staticprotected |
|
protected |
Referenced by copyFrom(), defaultIdentity(), load(), and save().