KVIrc
4.9.2
DeveloperAPIs
|
Class which manages the list of identity profiles. More...
#include <KviIdentityProfileSet.h>
Public Member Functions | |
void | addProfile (KviIdentityProfile *pProfile) |
Adds a profile to the set. More... | |
void | clear () |
Clears the list. More... | |
void | copyFrom (const KviIdentityProfileSet &src) |
Carbon copy. More... | |
unsigned int | count () |
Returns the number of instances of the class. More... | |
KviIdentityProfile * | findName (const QString &szName) |
Searches for a profile name. Returns true if the profile exists. More... | |
KviIdentityProfile * | findNetwork (const QString &szNetwork) |
Searches for a profile network. Returns true if the profile exists. More... | |
bool | isEmpty () |
Returns true if the profile set is empty. More... | |
bool | isEnabled () |
Returns true if the profile set is enabled. More... | |
KviIdentityProfileSet () | |
Constructs the identity profile set object. More... | |
KviIdentityProfileSet (const KviIdentityProfileSet &set) | |
Constructs the identity profile set object. More... | |
void | load (const QString &szConfigFile) |
Loads the configuration of the profiles from file. More... | |
KviPointerList < KviIdentityProfile > * | profiles () |
Returns the profiles set. More... | |
void | save (const QString &szConfigFile) |
Saves the configuration of the profiles to file. More... | |
void | save (KviConfigurationFile *pCfg, const QString &szPrefix) |
Saves the configuration of the profiles. More... | |
void | setEnabled (bool bEnabled) |
Enables the profile set. More... | |
~KviIdentityProfileSet () | |
Destroys the identity profile set object. More... | |
Static Public Member Functions | |
static void | done () |
Destroys the class instance. More... | |
static void | init () |
Initializes the class instance. More... | |
static KviIdentityProfileSet * | instance () |
Returns the instance of the class. More... | |
Protected Member Functions | |
bool | loadPrivate (KviConfigurationFile *pCfg, const QString &szPrefix, unsigned int uEntries) |
Loads the configuration of the profiles from file. More... | |
Protected Attributes | |
bool | m_bEnabled |
KviPointerList < KviIdentityProfile > * | m_pProfiles |
Static Private Attributes | |
static KviIdentityProfileSet * | m_pSelf = nullptr |
static unsigned int | m_uCount = 0 |
Class which manages the list of identity profiles.
KviIdentityProfileSet::KviIdentityProfileSet | ( | ) |
Constructs the identity profile set object.
References m_bEnabled, and m_pProfiles.
Referenced by init().
KviIdentityProfileSet::KviIdentityProfileSet | ( | const KviIdentityProfileSet & | set | ) |
Constructs the identity profile set object.
This is a carbon copy.
set | A profile set to copy from |
References copyFrom(), and m_pProfiles.
KviIdentityProfileSet::~KviIdentityProfileSet | ( | ) |
Destroys the identity profile set object.
References m_pProfiles.
void KviIdentityProfileSet::addProfile | ( | KviIdentityProfile * | pProfile | ) |
Adds a profile to the set.
pProfile | The source profile to add |
References KviPointerList< T >::append(), m_pProfiles, and KviPointerList< T >::setAutoDelete().
Referenced by OptionsWidget_identityProfile::commit().
void KviIdentityProfileSet::clear | ( | ) |
Clears the list.
References m_bEnabled, and m_pProfiles.
Referenced by OptionsWidget_identityProfile::commit(), and load().
void KviIdentityProfileSet::copyFrom | ( | const KviIdentityProfileSet & | src | ) |
Carbon copy.
src | The source profile set |
References KviPointerList< T >::append(), KviPointerList< T >::clear(), KviIdentityProfile::copyFrom(), KviPointerList< T >::first(), KviPointerList< T >::isEmpty(), m_bEnabled, m_pProfiles, KviPointerList< T >::next(), and KviPointerList< T >::setAutoDelete().
Referenced by KviIdentityProfileSet().
|
inline |
|
static |
Destroys the class instance.
References count(), m_pSelf, and m_uCount.
Referenced by KviApplication::~KviApplication().
KviIdentityProfile * KviIdentityProfileSet::findName | ( | const QString & | szName | ) |
Searches for a profile name. Returns true if the profile exists.
szName | The name of the profile |
References KviPointerList< T >::first(), m_pProfiles, KviQString::matchString(), KviIdentityProfile::name(), and KviPointerList< T >::next().
KviIdentityProfile * KviIdentityProfileSet::findNetwork | ( | const QString & | szNetwork | ) |
Searches for a profile network. Returns true if the profile exists.
szNetwork | The network name of the profile |
References KviPointerList< T >::first(), m_pProfiles, KviQString::matchString(), KviIdentityProfile::network(), and KviPointerList< T >::next().
Referenced by KviIrcConnection::pickNextLoginNickName(), and KviIrcConnection::useProfileData().
|
static |
Initializes the class instance.
References count(), KviIdentityProfileSet(), m_pSelf, and m_uCount.
Referenced by KviApplication::setup().
|
inlinestatic |
Returns the instance of the class.
Referenced by OptionsWidget_identityProfile::commit(), KviIrcConnection::loginToIrcServer(), OptionsWidget_identityProfile::OptionsWidget_identityProfile(), KviIrcConnection::pickNextLoginNickName(), KviApplication::saveIdentityProfiles(), and KviApplication::setup().
|
inline |
Returns true if the profile set is empty.
Referenced by KviIrcConnection::loginToIrcServer(), OptionsWidget_identityProfile::OptionsWidget_identityProfile(), and KviIrcConnection::pickNextLoginNickName().
|
inline |
Returns true if the profile set is enabled.
Referenced by KviIrcConnection::loginToIrcServer(), OptionsWidget_identityProfile::OptionsWidget_identityProfile(), and KviIrcConnection::pickNextLoginNickName().
void KviIdentityProfileSet::load | ( | const QString & | szConfigFile | ) |
Loads the configuration of the profiles from file.
szConfigFile | The file where to load |
References clear(), loadPrivate(), KviConfigurationFile::Read, and KviConfigurationFile::readUIntEntry().
Referenced by KviApplication::setup().
|
protected |
Loads the configuration of the profiles from file.
pCfg | The configuration file |
szPrefix | The prefix of the rules |
uEntries | The number of entries |
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().
|
inline |
Returns the profiles set.
Referenced by OptionsWidget_identityProfile::OptionsWidget_identityProfile().
void KviIdentityProfileSet::save | ( | const QString & | szConfigFile | ) |
Saves the configuration of the profiles to file.
szConfigFile | The file to save |
References KviConfigurationFile::clear(), and KviConfigurationFile::Write.
Referenced by KviApplication::saveIdentityProfiles().
void KviIdentityProfileSet::save | ( | KviConfigurationFile * | pCfg, |
const QString & | szPrefix | ||
) |
Saves the configuration of the profiles.
pCfg | The configuration file |
szPrefix | The prefix of the rules |
References KviPointerList< T >::count(), KviPointerList< T >::first(), KviPointerList< T >::isEmpty(), m_bEnabled, m_pProfiles, KviPointerList< T >::next(), and KviConfigurationFile::writeEntry().
|
inline |
Enables the profile set.
bEnabled | Whether to enable the profile set |
Referenced by OptionsWidget_identityProfile::commit().
|
protected |
Referenced by clear(), copyFrom(), KviIdentityProfileSet(), loadPrivate(), and save().
|
protected |
Referenced by addProfile(), clear(), copyFrom(), findName(), findNetwork(), KviIdentityProfileSet(), loadPrivate(), save(), and ~KviIdentityProfileSet().
|
staticprivate |