KVIrc 5.2.4
Developer APIs
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Private Attributes | List of all members
KviIdentityProfileSet Class Reference

Class which manages the list of identity profiles. More...

#include <KviIdentityProfileSet.h>

+ Inheritance diagram for KviIdentityProfileSet:

Public Member Functions

void addProfile (KviIdentityProfile *pProfile)
 Adds a profile to the set.
 
void clear ()
 Clears the list.
 
void copyFrom (const KviIdentityProfileSet &src)
 Carbon copy.
 
KviIdentityProfilefindName (const QString &szName)
 Searches for a profile name. Returns true if the profile exists.
 
KviIdentityProfilefindNetwork (const QString &szNetwork)
 Searches for a profile network. Returns true if the profile exists.
 
bool isEmpty ()
 Returns true if the profile set is empty.
 
bool isEnabled ()
 Returns true if the profile set is enabled.
 
 KviIdentityProfileSet ()
 Constructs the identity profile set object.
 
 KviIdentityProfileSet (const KviIdentityProfileSet &set)
 Constructs the identity profile set object.
 
void load (const QString &szConfigFile)
 Loads the configuration of the profiles from file.
 
KviPointerList< KviIdentityProfile > * profiles ()
 Returns the profiles set.
 
void save (const QString &szConfigFile)
 Saves the configuration of the profiles to file.
 
void save (KviConfigurationFile *pCfg, const QString &szPrefix)
 Saves the configuration of the profiles.
 
void setEnabled (bool bEnabled)
 Enables the profile set.
 
 ~KviIdentityProfileSet ()
 Destroys the identity profile set object.
 

Static Public Member Functions

static void done ()
 Destroys the class instance.
 
static void init ()
 Initializes the class instance.
 
static KviIdentityProfileSetinstance ()
 Returns the instance of the class.
 

Protected Member Functions

bool loadPrivate (KviConfigurationFile *pCfg, const QString &szPrefix, unsigned int uEntries)
 Loads the configuration of the profiles from file.
 

Protected Attributes

bool m_bEnabled
 
KviPointerList< KviIdentityProfile > * m_pProfiles
 

Static Private Attributes

static KviIdentityProfileSetm_pSelf = nullptr
 

Detailed Description

Class which manages the list of identity profiles.

Constructor & Destructor Documentation

◆ KviIdentityProfileSet() [1/2]

KviIdentityProfileSet::KviIdentityProfileSet ( )

Constructs the identity profile set object.

Returns
KviIdentityProfileSet

References m_bEnabled, and m_pProfiles.

Referenced by init().

◆ KviIdentityProfileSet() [2/2]

KviIdentityProfileSet::KviIdentityProfileSet ( const KviIdentityProfileSet set)

Constructs the identity profile set object.

This is a carbon copy.

Parameters
setA profile set to copy from
Returns
KviIdentityProfileSet

References copyFrom(), and m_pProfiles.

◆ ~KviIdentityProfileSet()

KviIdentityProfileSet::~KviIdentityProfileSet ( )

Destroys the identity profile set object.

References m_pProfiles.

Member Function Documentation

◆ addProfile()

void KviIdentityProfileSet::addProfile ( KviIdentityProfile pProfile)

Adds a profile to the set.

Parameters
pProfileThe source profile to add
Returns
void

References KviPointerList< T >::append(), m_pProfiles, and KviPointerList< T >::setAutoDelete().

Referenced by OptionsWidget_identityProfile::commit().

◆ clear()

void KviIdentityProfileSet::clear ( )

Clears the list.

Returns
void

References m_bEnabled, and m_pProfiles.

Referenced by OptionsWidget_identityProfile::commit(), and load().

◆ copyFrom()

void KviIdentityProfileSet::copyFrom ( const KviIdentityProfileSet src)

◆ done()

void KviIdentityProfileSet::done ( )
static

Destroys the class instance.

Returns
void

References m_pSelf.

Referenced by KviApplication::~KviApplication().

◆ findName()

KviIdentityProfile * KviIdentityProfileSet::findName ( const QString &  szName)

Searches for a profile name. Returns true if the profile exists.

Parameters
szNameThe name of the profile
Returns
KviIdentityProfile *

References KviPointerList< T >::first(), m_pProfiles, KviQString::matchString(), KviIdentityProfile::name(), and KviPointerList< T >::next().

◆ findNetwork()

KviIdentityProfile * KviIdentityProfileSet::findNetwork ( const QString &  szNetwork)

Searches for a profile network. Returns true if the profile exists.

Parameters
szNetworkThe network name of the profile
Returns
KviIdentityProfile *

References KviPointerList< T >::first(), m_pProfiles, KviQString::matchString(), KviIdentityProfile::network(), and KviPointerList< T >::next().

Referenced by KviIrcConnection::pickNextLoginNickName(), and KviIrcConnection::useProfileData().

◆ init()

void KviIdentityProfileSet::init ( )
static

Initializes the class instance.

Returns
void

References KviIdentityProfileSet(), and m_pSelf.

Referenced by KviApplication::setup().

◆ instance()

static KviIdentityProfileSet * KviIdentityProfileSet::instance ( )
inlinestatic

◆ isEmpty()

bool KviIdentityProfileSet::isEmpty ( )
inline

◆ isEnabled()

bool KviIdentityProfileSet::isEnabled ( )
inline

◆ load()

void KviIdentityProfileSet::load ( const QString &  szConfigFile)

Loads the configuration of the profiles from file.

Parameters
szConfigFileThe file where to load
Returns
void

References clear(), loadPrivate(), KviConfigurationFile::Read, and KviConfigurationFile::readUIntEntry().

Referenced by KviApplication::setup().

◆ loadPrivate()

bool KviIdentityProfileSet::loadPrivate ( KviConfigurationFile pCfg,
const QString &  szPrefix,
unsigned int  uEntries 
)
protected

Loads the configuration of the profiles from file.

Parameters
pCfgThe configuration file
szPrefixThe prefix of the rules
uEntriesThe number of entries
Returns
bool

References KviPointerList< T >::append(), KviPointerList< T >::clear(), KviPointerList< T >::isEmpty(), KviIdentityProfile::load(), m_bEnabled, m_pProfiles, KviConfigurationFile::readBoolEntry(), KviPointerList< T >::setAutoDelete(), and u.

Referenced by load().

◆ profiles()

KviPointerList< KviIdentityProfile > * KviIdentityProfileSet::profiles ( )
inline

◆ save() [1/2]

void KviIdentityProfileSet::save ( const QString &  szConfigFile)

Saves the configuration of the profiles to file.

Parameters
szConfigFileThe file to save
Returns
void

References KviConfigurationFile::clear(), save(), and KviConfigurationFile::Write.

Referenced by save(), and KviApplication::saveIdentityProfiles().

◆ save() [2/2]

void KviIdentityProfileSet::save ( KviConfigurationFile pCfg,
const QString &  szPrefix 
)

Saves the configuration of the profiles.

Parameters
pCfgThe configuration file
szPrefixThe prefix of the rules
Returns
void

References KviPointerList< T >::count(), KviPointerList< T >::first(), KviPointerList< T >::isEmpty(), m_bEnabled, m_pProfiles, KviPointerList< T >::next(), and KviConfigurationFile::writeEntry().

◆ setEnabled()

void KviIdentityProfileSet::setEnabled ( bool  bEnabled)
inline

Enables the profile set.

Parameters
bEnabledWhether to enable the profile set
Returns
void

Referenced by OptionsWidget_identityProfile::commit().

Member Data Documentation

◆ m_bEnabled

bool KviIdentityProfileSet::m_bEnabled
protected

◆ m_pProfiles

KviPointerList<KviIdentityProfile>* KviIdentityProfileSet::m_pProfiles
protected

◆ m_pSelf

KviIdentityProfileSet * KviIdentityProfileSet::m_pSelf = nullptr
staticprivate

Referenced by done(), and init().


The documentation for this class was generated from the following files: