KVIrc
4.9.2
DeveloperAPIs
|
Irc server database handling class. More...
#include <KviIrcServerDataBase.h>
Public Member Functions | |
void | addNetwork (KviIrcNetwork *pNet) |
Adds a network to the database. More... | |
KviPointerList< KviIrcNetwork > * | autoConnectOnStartupNetworks () |
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. More... | |
KviPointerList< KviIrcServer > * | autoConnectOnStartupServers () |
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. More... | |
void | clear () |
Deletes the database. More... | |
void | clearAutoConnectOnStartupNetworks () |
Deletes the list of autoconnect networks. More... | |
void | clearAutoConnectOnStartupServers () |
Deletes the list of autoconnect servers. More... | |
KviIrcNetwork * | currentNetwork () |
Returns the current network. More... | |
const QString & | currentNetworkName () |
Returns the current network name. More... | |
KviIrcNetwork * | findNetwork (const QString &szName) |
Searches for a network. More... | |
void | importFromMircIni (const QString &filename, const QString &szMircIni, QStringList &recentServers) |
Import servers and networks from a mirc ini file. More... | |
KviIrcServerDataBase () | |
Constructs the server database object. More... | |
void | load (const QString &szFilename) |
Loads the database data. More... | |
bool | makeCurrentBestServerInNetwork (const QString &szNetName, KviIrcNetwork *pNet, QString &szError) |
Marks the current servers as the best in the network. More... | |
bool | makeCurrentServer (KviIrcServerDefinition *pDef, QString &szError) |
Marks a server as current. More... | |
unsigned int | networkCount () const |
Returns the number of networks. More... | |
KviPointerHashTable< QString, KviIrcNetwork > * | recordDict () |
Returns the record dictionary of the database. More... | |
void | save (const QString &szFilename) |
Saves the database data. More... | |
void | setCurrentNetwork (const QString &szNetName) |
Sets the current network. More... | |
~KviIrcServerDataBase () | |
Destroys the server database object. More... | |
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, m_pRecords, and KviPointerHashTable< Key, T >::setAutoDelete().
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, KviIrcNetwork::name(), and KviPointerHashTable< Key, T >::replace().
Referenced by OptionsWidget_servers::commit(), importFromMircIni(), load(), and serverdb_kvs_cmd_addNetwork().
|
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.
Referenced by KviApplication::autoConnectToServers(), and KviApplication::createFrame().
|
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.
Referenced by KviApplication::autoConnectToServers(), and KviApplication::createFrame().
void KviIrcServerDataBase::clear | ( | ) |
Deletes the database.
References KviPointerHashTable< Key, T >::clear(), m_pRecords, and m_szCurrentNetwork.
Referenced by OptionsWidget_servers::commit(), importFromMircIni(), and load().
void KviIrcServerDataBase::clearAutoConnectOnStartupNetworks | ( | ) |
Deletes the list of autoconnect networks.
References m_pAutoConnectOnStartupNetworks.
Referenced by KviApplication::autoConnectToServers().
void KviIrcServerDataBase::clearAutoConnectOnStartupServers | ( | ) |
Deletes the list of autoconnect servers.
References m_pAutoConnectOnStartupServers.
Referenced by KviApplication::autoConnectToServers().
KviIrcNetwork * KviIrcServerDataBase::currentNetwork | ( | ) |
Returns the current network.
References KviPointerHashTable< Key, T >::find(), m_pRecords, and m_szCurrentNetwork.
Referenced by KviIrcContext::connectToCurrentServer().
|
inline |
Returns the current network name.
Referenced by OptionsWidget_servers::fillServerList().
KviIrcNetwork * KviIrcServerDataBase::findNetwork | ( | const QString & | szName | ) |
Searches for a network.
szName | The name of the network to find |
References KviPointerHashTable< Key, T >::find(), and m_pRecords.
Referenced by OptionsWidget_servers::commit(), importFromMircIni(), serverdb_kvs_cmd_addNetwork(), serverdb_kvs_cmd_addServer(), serverdb_kvs_fnc_networkExists(), and serverdb_kvs_fnc_serverExists().
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, and uPort.
Referenced by setup_finish().
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(), KviPointerHashTableIterator< Key, T >::current(), KviPointerHashTableIterator< Key, T >::currentKey(), KviConfigurationFile::dict(), KviPointerList< T >::first(), i, l, KviNickServRuleSet::load(), KviIrcServer::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(), KviPointerList< T >::setAutoDelete(), KviIrcNetwork::setAutoJoinChannelList(), and KviConfigurationFile::setGroup().
Referenced by KviApplication::setup().
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(), KviPointerHashTable< Key, T >::find(), KviPointerList< T >::first(), KviNetUtils::isValidStringIp(), m_pRecords, m_szCurrentNetwork, makeCurrentBestServerInNetwork(), KviIrcNetwork::name(), KviPointerList< T >::next(), KviPointerHashTable< Key, T >::replace(), KviIrcNetwork::serverList(), KviIrcServer::setCacheIp(), KviIrcNetwork::setCurrentServer(), KviIrcServer::setHostName(), KviIrcServer::setIp(), _KviIrcServerDefinition::szId, _KviIrcServerDefinition::szLinkFilter, _KviIrcServerDefinition::szServer, KviPointerHashTableIterator< Key, T >::toFirst(), and _KviIrcServerDefinition::uPort.
Referenced by KviIrcContext::connectToCurrentServer().
unsigned int KviIrcServerDataBase::networkCount | ( | ) | const |
Returns the number of networks.
References KviPointerHashTable< Key, T >::count(), and m_pRecords.
Referenced by KviIrcContext::connectToCurrentServer().
|
inline |
Returns the record dictionary of the database.
Referenced by OptionsWidget_servers::fillServerList(), and serverdb_kvs_fnc_serverExists().
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().
Referenced by KviApplication::saveIrcServerDataBase().
|
inline |
Sets the current network.
szNetName | The name of the network |
Referenced by OptionsWidget_servers::commit().
|
private |
Referenced by clearAutoConnectOnStartupNetworks(), KviIrcServerDataBase(), load(), and ~KviIrcServerDataBase().
|
private |
Referenced by clearAutoConnectOnStartupServers(), KviIrcServerDataBase(), load(), and ~KviIrcServerDataBase().
|
private |
Referenced by addNetwork(), clear(), currentNetwork(), findNetwork(), KviIrcServerDataBase(), makeCurrentServer(), networkCount(), save(), and ~KviIrcServerDataBase().
|
private |
Referenced by clear(), currentNetwork(), importFromMircIni(), load(), makeCurrentBestServerInNetwork(), makeCurrentServer(), and save().