KVIrc  4.9.2
DeveloperAPIs
Public Member Functions | Private Attributes | List of all members
KviIrcServerDataBase Class Reference

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...
 
KviIrcNetworkcurrentNetwork ()
 Returns the current network. More...
 
const QString & currentNetworkName ()
 Returns the current network name. More...
 
KviIrcNetworkfindNetwork (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
 

Detailed Description

Irc server database handling class.

Constructor & Destructor Documentation

KviIrcServerDataBase::KviIrcServerDataBase ( )
KviIrcServerDataBase::~KviIrcServerDataBase ( )

Destroys the server database object.

References m_pAutoConnectOnStartupNetworks, m_pAutoConnectOnStartupServers, and m_pRecords.

Member Function Documentation

void KviIrcServerDataBase::addNetwork ( KviIrcNetwork pNet)

Adds a network to the database.

Parameters
pNetThe source network
Returns
void

References m_pRecords, KviIrcNetwork::name(), and KviPointerHashTable< Key, T >::replace().

Referenced by OptionsWidget_servers::commit(), importFromMircIni(), load(), and serverdb_kvs_cmd_addNetwork().

KviPointerList<KviIrcNetwork>* KviIrcServerDataBase::autoConnectOnStartupNetworks ( )
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.

Returns
KviPointerList<KviIrcNetwork> *

Referenced by KviApplication::autoConnectToServers(), and KviApplication::createFrame().

KviPointerList<KviIrcServer>* KviIrcServerDataBase::autoConnectOnStartupServers ( )
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.

Returns
KviPointerList<KviIrcServer> *

Referenced by KviApplication::autoConnectToServers(), and KviApplication::createFrame().

void KviIrcServerDataBase::clear ( )
void KviIrcServerDataBase::clearAutoConnectOnStartupNetworks ( )

Deletes the list of autoconnect networks.

Returns
void

References m_pAutoConnectOnStartupNetworks.

Referenced by KviApplication::autoConnectToServers().

void KviIrcServerDataBase::clearAutoConnectOnStartupServers ( )

Deletes the list of autoconnect servers.

Returns
void

References m_pAutoConnectOnStartupServers.

Referenced by KviApplication::autoConnectToServers().

KviIrcNetwork * KviIrcServerDataBase::currentNetwork ( )
const QString& KviIrcServerDataBase::currentNetworkName ( )
inline

Returns the current network name.

Returns
const QString &

Referenced by OptionsWidget_servers::fillServerList().

KviIrcNetwork * KviIrcServerDataBase::findNetwork ( const QString &  szName)
void KviIrcServerDataBase::importFromMircIni ( const QString &  filename,
const QString &  szMircIni,
QStringList &  recentServers 
)

Import servers and networks from a mirc ini file.

Parameters
filenameThe database file where to add new servers
szMircIniThe source mirc ini file to import
recentServersThe list of recent servers where to add new servers
Returns
void

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)
bool KviIrcServerDataBase::makeCurrentBestServerInNetwork ( const QString &  szNetName,
KviIrcNetwork pNet,
QString &  szError 
)

Marks the current servers as the best in the network.

Parameters
szNetNameThe name of the network
pNetThe source network
szErrorThe container for a possible error
Returns
bool

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 
)
unsigned int KviIrcServerDataBase::networkCount ( ) const

Returns the number of networks.

Returns
unsigned integer

References KviPointerHashTable< Key, T >::count(), and m_pRecords.

Referenced by KviIrcContext::connectToCurrentServer().

KviPointerHashTable<QString, KviIrcNetwork>* KviIrcServerDataBase::recordDict ( )
inline

Returns the record dictionary of the database.

Returns
KviPointerHashTable<QString,KviIrcNetwork> *

Referenced by OptionsWidget_servers::fillServerList(), and serverdb_kvs_fnc_serverExists().

void KviIrcServerDataBase::save ( const QString &  szFilename)
void KviIrcServerDataBase::setCurrentNetwork ( const QString &  szNetName)
inline

Sets the current network.

Parameters
szNetNameThe name of the network
Returns
void

Referenced by OptionsWidget_servers::commit().

Member Data Documentation

KviPointerList<KviIrcNetwork>* KviIrcServerDataBase::m_pAutoConnectOnStartupNetworks
private
KviPointerList<KviIrcServer>* KviIrcServerDataBase::m_pAutoConnectOnStartupServers
private
KviPointerHashTable<QString, KviIrcNetwork>* KviIrcServerDataBase::m_pRecords
private
QString KviIrcServerDataBase::m_szCurrentNetwork
private

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