KVIrc
4.9.2
DeveloperAPIs
|
#include <KviConfigurationFile.h>
Public Types | |
enum | FileMode { Read = 1, Write = 2, ReadWrite = 3 } |
Public Member Functions | |
void | clear () |
void | clearDirtyFlag () |
void | clearGroup (const QString &szGroup) |
void | clearKey (const QString &szKey) |
KviPointerHashTable< QString, KviConfigurationFileGroup > * | dict () |
bool | dirty () |
bool | ensureWritable () |
const QString & | fileName () |
const QString & | group () |
unsigned int | groupsCount () |
bool | hasGroup (const QString &szGroup) |
bool | hasKey (const QString &szKey) |
KviConfigurationFile (const QString &filename, FileMode f, bool bLocal8Bit=false) | |
KviConfigurationFile (const char *filename, FileMode f, bool bLocal8Bit=false) | |
void | preserveEmptyGroups (bool bPreserve) |
bool | readBoolEntry (const QString &szKey, bool bTrue) |
char | readCharEntry (const QString &szKey, char iDefault) |
QColor | readColorEntry (const QString &szKey, const QColor &clr) |
QString | readEntry (const QString &szKey, const QString &szDefault=QString()) |
QFont | readFontEntry (const QString &szKey, const QFont &fnt) |
int | readIntEntry (const QString &szKey, int iDefault) |
QList< int > | readIntListEntry (const QString &, const QList< int > &list) |
QString | readKviCStringEntry (const QString &szKey, const KviCString &szDefault) |
KviMessageTypeSettings | readMsgTypeEntry (const QString &szKey, const KviMessageTypeSettings &msgDef) |
bool | readOnly () |
KviPixmap | readPixmapEntry (const QString &szKey, const KviPixmap &pixDef) |
QRect | readRectEntry (const QString &szKey, const QRect &rct) |
QStringList | readStringListEntry (const QString &szKey, const QStringList &list=QStringList()) |
unsigned char | readUCharEntry (const QString &szKey, unsigned char iDefault) |
unsigned int | readUIntEntry (const QString &szKey, unsigned int iDefault) |
unsigned short int | readUShortEntry (const QString &szKey, unsigned short int usDefault) |
void | setGroup (const QString &szGroup) |
void | setReadOnly (bool bReadOnly) |
void | setSavePath (const QString &savePath) |
bool | sync () |
void | writeEntry (const QString &szKey, const QString &szValue) |
void | writeEntry (const QString &szKey, const char *szValue) |
void | writeEntry (const QString &szKey, const KviPixmap &pixmap) |
void | writeEntry (const QString &szKey, const KviMessageTypeSettings &msg) |
void | writeEntry (const QString &szKey, const QColor &clr) |
void | writeEntry (const QString &szKey, QFont &fnt) |
void | writeEntry (const QString &szKey, bool bTrue) |
void | writeEntry (const QString &szKey, const QRect &rct) |
void | writeEntry (const QString &szKey, const QStringList &list) |
void | writeEntry (const QString &szKey, const QList< int > &list) |
void | writeEntry (const QString &szKey, int iValue) |
void | writeEntry (const QString &szKey, unsigned short int usValue) |
void | writeEntry (const QString &szKey, unsigned int iValue) |
void | writeEntry (const QString &szKey, char iValue) |
void | writeEntry (const QString &szKey, unsigned char iValue) |
~KviConfigurationFile () | |
Static Public Member Functions | |
static void | getFontProperties (KviCString &buffer, QFont *fnt) |
static void | setFontProperties (KviCString &str, QFont *fnt) |
Private Member Functions | |
KviConfigurationFileGroup * | getCurrentGroup () |
bool | load () |
bool | save () |
Private Attributes | |
bool | m_bDirty |
bool | m_bLocal8Bit |
bool | m_bPreserveEmptyGroups |
bool | m_bReadOnly |
KviPointerHashTable< QString, KviConfigurationFileGroup > * | m_pDict |
QString | m_szFileName |
QString | m_szGroup |
QString | m_szStrBuffer |
KviConfigurationFile::KviConfigurationFile | ( | const QString & | filename, |
FileMode | f, | ||
bool | bLocal8Bit = false |
||
) |
References KVI_CONFIG_DEFAULT_GROUP, load(), m_bDirty, m_bLocal8Bit, m_bPreserveEmptyGroups, m_bReadOnly, m_pDict, m_szFileName, m_szGroup, Read, and Write.
KviConfigurationFile::KviConfigurationFile | ( | const char * | filename, |
FileMode | f, | ||
bool | bLocal8Bit = false |
||
) |
References KVI_CONFIG_DEFAULT_GROUP, load(), m_bDirty, m_bLocal8Bit, m_bPreserveEmptyGroups, m_bReadOnly, m_pDict, m_szFileName, m_szGroup, Read, and Write.
void KviConfigurationFile::clear | ( | ) |
References KVI_CONFIG_DEFAULT_GROUP, m_bDirty, m_pDict, and m_szGroup.
Referenced by ClassEditorWidget::build(), config_kvs_cmd_clear(), ListWindow::exportList(), KviProxyDataBase::save(), KviSharedFilesManager::save(), KviKvsPopupManager::save(), KviRegisteredChannelDataBase::save(), KviNickServRuleSet::save(), KviMediaManager::save(), KviKvsAliasManager::save(), KviRegisteredUserDataBase::save(), KviActionManager::save(), KviThemeInfo::save(), KviInputHistory::save(), KviUserIdentityManager::save(), KviKvsScriptAddonManager::save(), KviDefaultScriptManager::save(), KviIdentityProfileSet::save(), KviIrcServerDataBase::save(), KviKvsEventManager::saveAppEvents(), ClassEditorWidget::saveNotBuiltClasses(), and KviKvsEventManager::saveRawEvents().
|
inline |
void KviConfigurationFile::clearGroup | ( | const QString & | szGroup | ) |
References KVI_CONFIG_DEFAULT_GROUP, m_bDirty, m_pDict, and m_szGroup.
Referenced by clearKey(), config_kvs_cmd_clearsection(), and KviMainWindow::saveWindowProperties().
void KviConfigurationFile::clearKey | ( | const QString & | szKey | ) |
References clearGroup(), KviPointerHashTable< Key, T >::count(), getCurrentGroup(), m_bDirty, m_szGroup, and KviPointerHashTable< Key, T >::remove().
Referenced by config_kvs_cmd_write().
|
inline |
Referenced by config_kvs_fnc_keylist(), config_kvs_fnc_sectionlist(), KviKvsScriptAddonManager::delayedLoad(), ListWindow::importList(), KviRegisteredChannelDataBase::load(), KviKvsPopupManager::load(), KviCustomToolBarManager::load(), KviKvsAliasManager::load(), KviRegisteredUserDataBase::load(), KviActionManager::load(), KviAvatarCache::load(), KviUserIdentityManager::load(), KviIrcServerDataBase::load(), KviTextIconManager::load(), ClassEditorWidget::loadNotBuiltClasses(), save(), and KviMainWindow::saveWindowProperties().
|
inline |
Referenced by config_kvs_cmd_close().
bool KviConfigurationFile::ensureWritable | ( | ) |
References f, m_bReadOnly, and m_szFileName.
Referenced by KviApplication::saveOptions().
|
inline |
Referenced by config_kvs_cmd_close(), config_kvs_fnc_filename(), config_kvs_fnc_id(), and config_kvs_fnc_open().
|
private |
References KVI_CONFIG_DEFAULT_GROUP, m_pDict, m_szGroup, and KviPointerHashTable< Key, T >::setAutoDelete().
Referenced by clearKey(), hasKey(), readBoolEntry(), readCharEntry(), readColorEntry(), readEntry(), readFontEntry(), readIntEntry(), readIntListEntry(), readMsgTypeEntry(), readPixmapEntry(), readRectEntry(), readStringListEntry(), readUCharEntry(), readUIntEntry(), readUShortEntry(), setGroup(), and writeEntry().
|
static |
References KviStringConversion::toString().
|
inline |
|
inline |
Referenced by KviMainWindow::saveWindowProperties().
bool KviConfigurationFile::hasGroup | ( | const QString & | szGroup | ) |
References m_pDict.
Referenced by KviMainWindow::addWindow(), config_kvs_fnc_hassection(), KviMircServersIniImport::doImport(), KviIrcServerDataBase::importFromMircIni(), KviKvsEventManager::loadAppEvents(), KviKvsEventManager::loadRawEvents(), KviKvsEventManager::saveAppEvents(), setGroup(), and SetupWizard::SetupWizard().
bool KviConfigurationFile::hasKey | ( | const QString & | szKey | ) |
References KviPointerHashTable< Key, T >::find(), and getCurrentGroup().
Referenced by KviTheme::apply().
|
private |
References KviMemory::allocate(), f, KviMemory::free(), KviCString::hexDecode(), KviCString::isEmpty(), KVI_CONFIG_DEFAULT_GROUP, KviCString::len(), LOAD_BLOCK_SIZE, m_bLocal8Bit, m_pDict, m_szFileName, KviMemory::move(), p, KviCString::ptr(), KviMemory::reallocate(), KviPointerHashTable< Key, T >::replace(), KviPointerHashTable< Key, T >::setAutoDelete(), KviCString::stripRightWhiteSpace(), and z.
Referenced by KviConfigurationFile().
|
inline |
Referenced by KviRegisteredChannelDataBase::save(), and KviRegisteredUserDataBase::save().
bool KviConfigurationFile::readBoolEntry | ( | const QString & | szKey, |
bool | bTrue | ||
) |
References KviPointerHashTable< Key, T >::find(), and getCurrentGroup().
Referenced by KviMainWindow::addWindow(), ConfigDialog::ConfigDialog(), KviProxyDataBase::load(), KviRegisteredUserDataBase::load(), KviIrcServerDataBase::load(), OptionsWidget_messageColors::load(), KviIrcServer::load(), KviKvsEventManager::loadAppEvents(), KviNickServRuleSet::loadPrivate(), KviIdentityProfileSet::loadPrivate(), KviConsoleWindow::loadProperties(), KviQueryWindow::loadProperties(), KviWindow::loadProperties(), KviChannelWindow::loadProperties(), KviKvsEventManager::loadRawEvents(), KviStatusBarClock::loadState(), KviStatusBarConnectionTimer::loadState(), KviStatusBarAwayIndicator::loadState(), KviStatusBarUpdateIndicator::loadState(), SetupWizard::SetupWizard(), and url_module_cleanup().
char KviConfigurationFile::readCharEntry | ( | const QString & | szKey, |
char | iDefault | ||
) |
References KviPointerHashTable< Key, T >::find(), and getCurrentGroup().
QColor KviConfigurationFile::readColorEntry | ( | const QString & | szKey, |
const QColor & | clr | ||
) |
QString KviConfigurationFile::readEntry | ( | const QString & | szKey, |
const QString & | szDefault = QString() |
||
) |
References KviPointerHashTable< Key, T >::find(), getCurrentGroup(), and m_szStrBuffer.
Referenced by KviTheme::apply(), KviDefaultScriptManager::compareVersions(), config_kvs_fnc_read(), KviMircServersIniImport::doImport(), KviApplication::findLocalKvircDirectory(), KviIrcServerDataBase::importFromMircIni(), ListWindow::importList(), KviDefaultScriptManager::isDefscriptUpToDate(), KviProxyDataBase::load(), KviSharedFilesManager::load(), KviMediaManager::load(), KviKvsAliasManager::load(), KviKvsUserAction::load(), KviCustomToolBarDescriptor::load(), KviNickServRule::load(), KviKvsScriptAddon::load(), KviThemeInfo::load(), KviAvatarCache::load(), KviInputHistory::load(), KviUserIdentityManager::load(), KviIdentityProfile::load(), KviIrcServerDataBase::load(), KviStatusBar::load(), KviTextIconManager::load(), KviKvsPopupMenu::load(), KviUserIdentity::load(), KviIrcServer::load(), KviKvsEventManager::loadAppEvents(), KviDefaultScriptManager::loadInternal(), ClassEditorWidget::loadNotBuiltClasses(), AliasEditorWidget::loadProperties(), ClassEditorWidget::loadProperties(), KviWindow::loadProperties(), KviKvsEventManager::loadRawEvents(), TipWindow::nextTip(), TipWindow::prevTip(), KviDefaultScriptManager::restoreInternal(), and SetupWizard::SetupWizard().
QFont KviConfigurationFile::readFontEntry | ( | const QString & | szKey, |
const QFont & | fnt | ||
) |
References KviPointerHashTable< Key, T >::find(), getCurrentGroup(), setFontProperties(), and KviCString::stripLeftWhiteSpace().
Referenced by ScriptEditorImplementation::loadOptions().
int KviConfigurationFile::readIntEntry | ( | const QString & | szKey, |
int | iDefault | ||
) |
References KviPointerHashTable< Key, T >::find(), and getCurrentGroup().
Referenced by KviSharedFilesManager::load(), KviCustomToolBarManager::load(), KviRegisteredUserDataBase::load(), KviInputHistory::load(), KviIrcServerDataBase::load(), OptionsWidget_messageColors::load(), KviStatusBar::load(), KviTextIconManager::load(), KviKvsPopupMenu::load(), KviIrcServer::load(), KviStatusBarClock::loadState(), and SetupWizard::SetupWizard().
QList< int > KviConfigurationFile::readIntListEntry | ( | const QString & | szKey, |
const QList< int > & | list | ||
) |
References KviPointerHashTable< Key, T >::find(), and getCurrentGroup().
Referenced by KviDebugWindow::loadProperties(), HelpWindow::loadProperties(), AliasEditorWidget::loadProperties(), KviConsoleWindow::loadProperties(), ActionEditorWindow::loadProperties(), KviQueryWindow::loadProperties(), ClassEditorWidget::loadProperties(), and KviChannelWindow::loadProperties().
|
inline |
References KviCString::ptr().
KviMessageTypeSettings KviConfigurationFile::readMsgTypeEntry | ( | const QString & | szKey, |
const KviMessageTypeSettings & | msgDef | ||
) |
|
inline |
Referenced by config_kvs_cmd_close(), config_kvs_cmd_flush(), config_kvs_fnc_open(), and config_kvs_fnc_readonly().
References KviPointerHashTable< Key, T >::find(), KviStringConversion::fromString(), and getCurrentGroup().
Referenced by KviUserIdentity::load(), and KviChannelWindow::loadProperties().
QRect KviConfigurationFile::readRectEntry | ( | const QString & | szKey, |
const QRect & | rct | ||
) |
References KviPointerHashTable< Key, T >::find(), KviStringConversion::fromString(), and getCurrentGroup().
Referenced by addon_module_init(), channelsjoin_module_init(), theme_module_init(), and toolbareditor_module_init().
QStringList KviConfigurationFile::readStringListEntry | ( | const QString & | szKey, |
const QStringList & | list = QStringList() |
||
) |
unsigned char KviConfigurationFile::readUCharEntry | ( | const QString & | szKey, |
unsigned char | iDefault | ||
) |
References KviPointerHashTable< Key, T >::find(), and getCurrentGroup().
unsigned int KviConfigurationFile::readUIntEntry | ( | const QString & | szKey, |
unsigned int | iDefault | ||
) |
References KviPointerHashTable< Key, T >::find(), and getCurrentGroup().
Referenced by KviApplication::findLocalKvircDirectory(), KviProxyDataBase::load(), KviMediaManager::load(), KviNickServRuleSet::load(), KviKvsUserAction::load(), KviCustomToolBarDescriptor::load(), KviAvatarCache::load(), KviIdentityProfileSet::load(), KviIrcServer::load(), KviKvsEventManager::loadAppEvents(), KviKvsEventManager::loadRawEvents(), TipWindow::nextTip(), and TipWindow::prevTip().
unsigned short int KviConfigurationFile::readUShortEntry | ( | const QString & | szKey, |
unsigned short int | usDefault | ||
) |
References KviPointerHashTable< Key, T >::find(), and getCurrentGroup().
|
private |
References KviPointerHashTable< Key, T >::count(), KviPointerHashTableIterator< Key, T >::current(), KviPointerHashTableIterator< Key, T >::currentKey(), dict(), f, group(), KviCString::hexEncodeWhiteSpace(), KviCString::hexEncodeWithTable(), KviCString::len(), m_bDirty, m_bLocal8Bit, m_bPreserveEmptyGroups, m_bReadOnly, m_pDict, m_szFileName, and KviCString::ptr().
Referenced by ~KviConfigurationFile().
|
static |
References KviStringConversion::fromString(), and KviCString::ptr().
Referenced by readFontEntry().
void KviConfigurationFile::setGroup | ( | const QString & | szGroup | ) |
References getCurrentGroup(), hasGroup(), m_bDirty, m_bPreserveEmptyGroups, and m_szGroup.
Referenced by ConfigDialog::acceptbtn(), KviMainWindow::addWindow(), KviTheme::apply(), config_kvs_cmd_setsection(), config_set_section(), ConfigDialog::ConfigDialog(), KviMircServersIniImport::doImport(), ListWindow::exportList(), KviApplication::findLocalKvircDirectory(), KviIrcServerDataBase::importFromMircIni(), ListWindow::importList(), KviSharedFilesManager::load(), KviKvsPopupManager::load(), KviMediaManager::load(), KviCustomToolBarManager::load(), KviKvsAliasManager::load(), KviRegisteredUserDataBase::load(), KviActionManager::load(), KviKvsScriptAddon::load(), KviThemeInfo::load(), KviAvatarCache::load(), KviUserIdentityManager::load(), KviIrcServerDataBase::load(), OptionsWidget_messageColors::load(), KviStatusBar::load(), KviTextIconManager::load(), KviKvsEventManager::loadAppEvents(), ClassEditorWidget::loadNotBuiltClasses(), KviKvsEventManager::loadRawEvents(), KviSharedFilesManager::save(), KviKvsPopupManager::save(), KviRegisteredChannelDataBase::save(), KviMediaManager::save(), KviCustomToolBarManager::save(), KviKvsAliasManager::save(), KviKvsUserAction::save(), KviCustomToolBarDescriptor::save(), KviRegisteredUserDataBase::save(), KviActionManager::save(), KviKvsScriptAddon::save(), KviThemeInfo::save(), KviUserIdentityManager::save(), KviAvatarCache::save(), KviKvsScriptAddonManager::save(), KviIrcServerDataBase::save(), OptionsWidget_messageColors::save(), KviStatusBar::save(), KviTextIconManager::save(), KviUserIdentity::save(), KviTheme::save(), KviKvsEventManager::saveAppEvents(), KviApplication::saveKvircDirectory(), ClassEditorWidget::saveNotBuiltClasses(), KviKvsEventManager::saveRawEvents(), KviMainWindow::saveWindowProperties(), SetupWizard::SetupWizard(), and url_module_cleanup().
|
inline |
Referenced by config_kvs_fnc_open().
|
inline |
Referenced by TipWindow::closeConfig().
|
inline |
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
const QString & | szValue | ||
) |
References getCurrentGroup(), m_bDirty, and KviPointerHashTable< Key, T >::replace().
Referenced by ConfigDialog::acceptbtn(), addon_module_cleanup(), channelsjoin_module_cleanup(), config_kvs_cmd_write(), ListWindow::exportList(), TipWindow::nextTip(), TipWindow::prevTip(), KviProxyDataBase::save(), KviSharedFilesManager::save(), KviRegisteredChannelDataBase::save(), KviMediaManager::save(), KviNickServRuleSet::save(), KviCustomToolBarManager::save(), KviKvsAliasManager::save(), KviKvsUserAction::save(), KviCustomToolBarDescriptor::save(), KviNickServRule::save(), KviRegisteredUserDataBase::save(), KviKvsScriptAddon::save(), KviThemeInfo::save(), KviInputHistory::save(), KviUserIdentityManager::save(), KviAvatarCache::save(), KviIdentityProfile::save(), KviIdentityProfileSet::save(), KviIrcServerDataBase::save(), OptionsWidget_messageColors::save(), KviStatusBar::save(), KviTextIconManager::save(), KviKvsPopupMenu::save(), KviUserIdentity::save(), KviIrcServer::save(), KviTheme::save(), KviKvsEventManager::saveAppEvents(), BanFrame::saveBans(), KviDefaultScriptManager::saveInternal(), KviApplication::saveKvircDirectory(), ClassEditorWidget::saveNotBuiltClasses(), ScriptEditorImplementation::saveOptions(), KviDebugWindow::saveProperties(), HelpWindow::saveProperties(), AliasEditorWidget::saveProperties(), KviConsoleWindow::saveProperties(), ActionEditorWindow::saveProperties(), KviQueryWindow::saveProperties(), ClassEditorWidget::saveProperties(), KviWindow::saveProperties(), KviChannelWindow::saveProperties(), KviKvsEventManager::saveRawEvents(), KviApplication::saveRecentEntries(), KviStatusBarClock::saveState(), KviStatusBarConnectionTimer::saveState(), KviStatusBarAwayIndicator::saveState(), KviStatusBarUpdateIndicator::saveState(), KviMainWindow::saveWindowProperties(), theme_module_cleanup(), and toolbareditor_module_cleanup().
|
inline |
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
const KviPixmap & | pixmap | ||
) |
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
const KviMessageTypeSettings & | msg | ||
) |
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
const QColor & | clr | ||
) |
References KviCString::Format, getCurrentGroup(), m_bDirty, and KviPointerHashTable< Key, T >::replace().
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
QFont & | fnt | ||
) |
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
bool | bTrue | ||
) |
References getCurrentGroup(), m_bDirty, and KviPointerHashTable< Key, T >::replace().
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
const QRect & | rct | ||
) |
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
const QStringList & | list | ||
) |
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
const QList< int > & | list | ||
) |
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
int | iValue | ||
) |
References getCurrentGroup(), m_bDirty, and KviPointerHashTable< Key, T >::replace().
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
unsigned short int | usValue | ||
) |
References getCurrentGroup(), m_bDirty, and KviPointerHashTable< Key, T >::replace().
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
unsigned int | iValue | ||
) |
References getCurrentGroup(), m_bDirty, and KviPointerHashTable< Key, T >::replace().
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
char | iValue | ||
) |
References getCurrentGroup(), m_bDirty, and KviPointerHashTable< Key, T >::replace().
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
unsigned char | iValue | ||
) |
References getCurrentGroup(), m_bDirty, and KviPointerHashTable< Key, T >::replace().
|
private |
Referenced by clear(), clearGroup(), clearKey(), KviConfigurationFile(), save(), setGroup(), writeEntry(), and ~KviConfigurationFile().
|
private |
Referenced by KviConfigurationFile(), load(), and save().
|
private |
Referenced by KviConfigurationFile(), save(), and setGroup().
|
private |
Referenced by ensureWritable(), KviConfigurationFile(), and save().
|
private |
Referenced by clear(), clearGroup(), getCurrentGroup(), hasGroup(), KviConfigurationFile(), load(), save(), and ~KviConfigurationFile().
|
private |
Referenced by ensureWritable(), KviConfigurationFile(), load(), and save().
|
private |
Referenced by clear(), clearGroup(), clearKey(), getCurrentGroup(), KviConfigurationFile(), and setGroup().
|
private |
Referenced by readEntry().