![]() |
KVIrc 5.2.6
Developer APIs
|
Irc server database handling class. More...
#include <KviIrcServerDataBase.h>
Public Member Functions | |
void | addNetwork (KviIrcNetwork *pNet) |
Adds a network to the database. | |
KviPointerList< KviIrcNetwork > * | autoConnectOnStartupNetworks () const |
Returns a list of networks to connect on startup This list is computed when the data are loaded from disk during the startup and is used by KviApplication to start the connections. The pointer is zero if there are no autoConnect networks. The list is valid only during the startup phase because it contains shallow pointers to the networks really contained in the server/network list and it is never updated later. | |
KviPointerList< KviIrcServer > * | autoConnectOnStartupServers () const |
Returns a list of servers to connect on startup This list is computed when the data are loaded from disk during the startup and is used by KviApplication to start the connections. The pointer is zero if there are no autoConnect servers. The list is valid only during the startup phase because it contains shallow pointers to the servers really contained in the server/network list and it is never updated later. | |
void | clear () |
Deletes the database. | |
void | clearAutoConnectOnStartupNetworks () |
Deletes the list of autoconnect networks. | |
void | clearAutoConnectOnStartupServers () |
Deletes the list of autoconnect servers. | |
KviIrcNetwork * | currentNetwork () |
Returns the current network. | |
const QString & | currentNetworkName () const |
Returns the current network name. | |
KviIrcNetwork * | findNetwork (const QString &szName) |
Searches for a network. | |
void | importFromMircIni (const QString &filename, const QString &szMircIni, QStringList &recentServers) |
Import servers and networks from a mirc ini file. | |
KviIrcServerDataBase () | |
Constructs the server database object. | |
void | load (const QString &szFilename) |
Loads the database data. | |
bool | makeCurrentBestServerInNetwork (const QString &szNetName, KviIrcNetwork *pNet, QString &szError) |
Marks the current servers as the best in the network. | |
bool | makeCurrentServer (KviIrcServerDefinition *pDef, QString &szError) |
Marks a server as current. | |
unsigned int | networkCount () const |
Returns the number of networks. | |
KviPointerHashTable< QString, KviIrcNetwork > * | recordDict () const |
Returns the record dictionary of the database. | |
void | save (const QString &szFilename) |
Saves the database data. | |
void | setCurrentNetwork (const QString &szNetName) |
Sets the current network. | |
~KviIrcServerDataBase () | |
Destroys the server database object. | |
Private Attributes | |
KviPointerList< KviIrcNetwork > * | m_pAutoConnectOnStartupNetworks |
KviPointerList< KviIrcServer > * | m_pAutoConnectOnStartupServers |
KviPointerHashTable< QString, KviIrcNetwork > * | m_pRecords |
QString | m_szCurrentNetwork |
Irc server database handling class.
KviIrcServerDataBase::KviIrcServerDataBase | ( | ) |
Constructs the server database object.
References m_pAutoConnectOnStartupNetworks, m_pAutoConnectOnStartupServers, and m_pRecords.
KviIrcServerDataBase::~KviIrcServerDataBase | ( | ) |
Destroys the server database object.
References m_pAutoConnectOnStartupNetworks, m_pAutoConnectOnStartupServers, and m_pRecords.
void KviIrcServerDataBase::addNetwork | ( | KviIrcNetwork * | pNet | ) |
Adds a network to the database.
pNet | The source network |
References m_pRecords, and KviIrcNetwork::name().
Referenced by importFromMircIni(), and load().
|
inline |
Returns a list of networks to connect on startup This list is computed when the data are loaded from disk during the startup and is used by KviApplication to start the connections. The pointer is zero if there are no autoConnect networks. The list is valid only during the startup phase because it contains shallow pointers to the networks really contained in the server/network list and it is never updated later.
References m_pAutoConnectOnStartupNetworks.
|
inline |
Returns a list of servers to connect on startup This list is computed when the data are loaded from disk during the startup and is used by KviApplication to start the connections. The pointer is zero if there are no autoConnect servers. The list is valid only during the startup phase because it contains shallow pointers to the servers really contained in the server/network list and it is never updated later.
References m_pAutoConnectOnStartupServers.
void KviIrcServerDataBase::clear | ( | ) |
Deletes the database.
References m_pRecords, and m_szCurrentNetwork.
Referenced by importFromMircIni(), and load().
void KviIrcServerDataBase::clearAutoConnectOnStartupNetworks | ( | ) |
void KviIrcServerDataBase::clearAutoConnectOnStartupServers | ( | ) |
KviIrcNetwork * KviIrcServerDataBase::currentNetwork | ( | ) |
|
inline |
KviIrcNetwork * KviIrcServerDataBase::findNetwork | ( | const QString & | szName | ) |
Searches for a network.
szName | The name of the network to find |
References m_pRecords.
Referenced by importFromMircIni().
void KviIrcServerDataBase::importFromMircIni | ( | const QString & | filename, |
const QString & | szMircIni, | ||
QStringList & | recentServers ) |
Import servers and networks from a mirc ini file.
filename | The database file where to add new servers |
szMircIni | The source mirc ini file to import |
recentServers | The list of recent servers where to add new servers |
References addNetwork(), KviPointerList< T >::append(), clear(), findNetwork(), KviConfigurationFile::hasGroup(), i, KviIrcNetwork::m_pServerList, m_szCurrentNetwork, parseMircServerRecord(), KviConfigurationFile::Read, KviConfigurationFile::readEntry(), KviIrcServer::setDescription(), KviConfigurationFile::setGroup(), KviIrcServer::setHostName(), KviIrcServer::setPort(), szHost, szMircIni, and uPort.
void KviIrcServerDataBase::load | ( | const QString & | szFilename | ) |
Loads the database data.
szFilename | The filename of the database data to load |
References addNetwork(), KviPointerList< T >::append(), KviIrcServer::autoConnect(), clear(), KviPointerHashTable< Key, T >::count(), KviPointerHashTableIterator< Key, T >::current(), KviPointerHashTableIterator< Key, T >::currentKey(), KviConfigurationFile::dict(), KviPointerList< T >::first(), i, l, KviIrcServer::load(), KviNickServRuleSet::load(), KviIrcNetwork::m_bAutoConnect, m_pAutoConnectOnStartupNetworks, m_pAutoConnectOnStartupServers, KviIrcNetwork::m_pCurrentServer, KviIrcNetwork::m_pNickServRuleSet, KviIrcNetwork::m_pServerList, KviIrcNetwork::m_szAlternativeNickName, m_szCurrentNetwork, KviIrcNetwork::m_szDescription, KviIrcNetwork::m_szEncoding, KviIrcNetwork::m_szNickName, KviIrcNetwork::m_szOnConnectCommand, KviIrcNetwork::m_szOnLoginCommand, KviIrcNetwork::m_szPass, KviIrcNetwork::m_szRealName, KviIrcNetwork::m_szTextEncoding, KviIrcNetwork::m_szUserIdentityId, KviIrcNetwork::m_szUserName, KviConfigurationFile::Read, KviConfigurationFile::readBoolEntry(), KviConfigurationFile::readEntry(), KviConfigurationFile::readIntEntry(), KviConfigurationFile::readStringListEntry(), KviIrcNetwork::setAutoJoinChannelList(), and KviConfigurationFile::setGroup().
bool KviIrcServerDataBase::makeCurrentBestServerInNetwork | ( | const QString & | szNetName, |
KviIrcNetwork * | pNet, | ||
QString & | szError ) |
Marks the current servers as the best in the network.
szNetName | The name of the network |
pNet | The source network |
szError | The container for a possible error |
References __tr2qs, KviQString::equalCI(), KviPointerList< T >::first(), KviPointerList< T >::isEmpty(), KviIrcNetwork::m_pServerList, m_szCurrentNetwork, KviPointerList< T >::next(), and KviIrcNetwork::setCurrentServer().
Referenced by makeCurrentServer().
bool KviIrcServerDataBase::makeCurrentServer | ( | KviIrcServerDefinition * | pDef, |
QString & | szError ) |
Marks a server as current.
pDef | The server definition |
szError | The container for a possible error |
References __tr2qs, KviIrcServerDefinition::bIPv6, KviIrcServerDefinition::bPortIsValid, KviIrcServerDefinition::bSSL, KviPointerHashTableIterator< Key, T >::current(), KviQString::equalCI(), KviQString::equalCIN(), KviPointerList< T >::first(), KviIrcServer::hostName(), KviIrcServer::id(), KviIrcServer::isIPv6(), KviNetUtils::isValidStringIp(), KviIrcServer::linkFilter(), m_pRecords, m_szCurrentNetwork, makeCurrentBestServerInNetwork(), KviIrcNetwork::name(), KviPointerList< T >::next(), KviIrcServer::port(), KviIrcNetwork::serverList(), KviIrcServer::setCacheIp(), KviIrcNetwork::setCurrentServer(), KviIrcServer::setHostName(), KviIrcServer::setIp(), KviIrcServerDefinition::szId, KviIrcServerDefinition::szLinkFilter, KviIrcServerDefinition::szServer, KviPointerHashTableIterator< Key, T >::toFirst(), KviIrcServerDefinition::uPort, and KviIrcServer::useSSL().
unsigned int KviIrcServerDataBase::networkCount | ( | ) | const |
|
inline |
Returns the record dictionary of the database.
References m_pRecords.
void KviIrcServerDataBase::save | ( | const QString & | szFilename | ) |
Saves the database data.
szFilename | The filename of the database data to save |
References KviConfigurationFile::clear(), KviPointerHashTableIterator< Key, T >::current(), i, m_pRecords, m_szCurrentNetwork, KviConfigurationFile::setGroup(), KviConfigurationFile::Write, and KviConfigurationFile::writeEntry().
|
inline |
Sets the current network.
szNetName | The name of the network |
References m_szCurrentNetwork.
|
private |
|
private |
|
private |
Referenced by addNetwork(), clear(), currentNetwork(), findNetwork(), KviIrcServerDataBase(), makeCurrentServer(), networkCount(), recordDict(), save(), and ~KviIrcServerDataBase().
|
private |