KVIrc 5.2.6
Developer APIs
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 copyFrom(), init(), instance(), and KviIdentityProfileSet().

◆ 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(), KviIdentityProfileSet(), 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 m_pProfiles.

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)

Carbon copy.

Parameters
srcThe source profile set
Returns
void

References KviIdentityProfile::copyFrom(), KviPointerList< T >::first(), KviIdentityProfileSet(), m_bEnabled, m_pProfiles, and KviPointerList< T >::next().

Referenced by KviIdentityProfileSet().

◆ 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 m_pProfiles, KviQString::matchString(), and KviIdentityProfile::name().

◆ 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 m_pProfiles, KviQString::matchString(), and KviIdentityProfile::network().

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()

◆ 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 KviIdentityProfile::load(), m_bEnabled, m_pProfiles, KviConfigurationFile::readBoolEntry(), 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 m_bEnabled, m_pProfiles, and KviConfigurationFile::writeEntry().

◆ setEnabled()

void KviIdentityProfileSet::setEnabled ( bool bEnabled)
inline

Enables the profile set.

Parameters
bEnabledWhether to enable the profile set
Returns
void

References m_bEnabled.

Referenced by OptionsWidget_identityProfile::commit().

Member Data Documentation

◆ m_bEnabled

bool KviIdentityProfileSet::m_bEnabled
protected

◆ m_pProfiles

◆ m_pSelf

KviIdentityProfileSet * KviIdentityProfileSet::m_pSelf = nullptr
staticprivate

Referenced by done(), init(), and instance().


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