|
|
@ -296,7 +296,7 @@ const TQFont& CBTConfig::getDefault( const CLanguageMgr::Language* const) {
|
|
|
|
static KStaticDeleter<TQFont> sd;
|
|
|
|
static KStaticDeleter<TQFont> sd;
|
|
|
|
|
|
|
|
|
|
|
|
//TODO: We need a better way to get the KDE konqueror KHTML settings
|
|
|
|
//TODO: We need a better way to get the KDE konqueror KHTML settings
|
|
|
|
KConfig conf("konquerorrc");
|
|
|
|
TDEConfig conf("konquerorrc");
|
|
|
|
KHTMLSettings settings;
|
|
|
|
KHTMLSettings settings;
|
|
|
|
settings.init(&conf);
|
|
|
|
settings.init(&conf);
|
|
|
|
|
|
|
|
|
|
|
@ -311,15 +311,15 @@ const TQFont& CBTConfig::getDefault( const CLanguageMgr::Language* const) {
|
|
|
|
|
|
|
|
|
|
|
|
const TQString CBTConfig::get
|
|
|
|
const TQString CBTConfig::get
|
|
|
|
( const CBTConfig::strings ID) {
|
|
|
|
( const CBTConfig::strings ID) {
|
|
|
|
KConfig* config = CBTConfig::getConfig();
|
|
|
|
TDEConfig* config = CBTConfig::getConfig();
|
|
|
|
KConfigGroupSaver groupSaver(config, "strings");
|
|
|
|
TDEConfigGroupSaver groupSaver(config, "strings");
|
|
|
|
return config->readEntry(getKey(ID),getDefault(ID));
|
|
|
|
return config->readEntry(getKey(ID),getDefault(ID));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CSwordModuleInfo* const CBTConfig::get
|
|
|
|
CSwordModuleInfo* const CBTConfig::get
|
|
|
|
( const CBTConfig::modules ID) {
|
|
|
|
( const CBTConfig::modules ID) {
|
|
|
|
KConfig* config = CBTConfig::getConfig();
|
|
|
|
TDEConfig* config = CBTConfig::getConfig();
|
|
|
|
KConfigGroupSaver groupSaver(config, "modules");
|
|
|
|
TDEConfigGroupSaver groupSaver(config, "modules");
|
|
|
|
|
|
|
|
|
|
|
|
TQString name = config->readEntry(getKey(ID),getDefault(ID));
|
|
|
|
TQString name = config->readEntry(getKey(ID),getDefault(ID));
|
|
|
|
return CPointers::backend()->findModuleByName(name);
|
|
|
|
return CPointers::backend()->findModuleByName(name);
|
|
|
@ -329,36 +329,36 @@ CSwordModuleInfo* const CBTConfig::get
|
|
|
|
const bool CBTConfig::get
|
|
|
|
const bool CBTConfig::get
|
|
|
|
( const CBTConfig::bools ID) {
|
|
|
|
( const CBTConfig::bools ID) {
|
|
|
|
//special behaviour for the KTipDialog class
|
|
|
|
//special behaviour for the KTipDialog class
|
|
|
|
KConfig* config = CBTConfig::getConfig();
|
|
|
|
TDEConfig* config = CBTConfig::getConfig();
|
|
|
|
KConfigGroupSaver groupSaver(config, (ID == CBTConfig::tips) ? "TipOfDay" : "bools");
|
|
|
|
TDEConfigGroupSaver groupSaver(config, (ID == CBTConfig::tips) ? "TipOfDay" : "bools");
|
|
|
|
return config->readBoolEntry(getKey(ID),getDefault(ID));
|
|
|
|
return config->readBoolEntry(getKey(ID),getDefault(ID));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const int CBTConfig::get
|
|
|
|
const int CBTConfig::get
|
|
|
|
( const CBTConfig::ints ID) {
|
|
|
|
( const CBTConfig::ints ID) {
|
|
|
|
KConfig* config = CBTConfig::getConfig();
|
|
|
|
TDEConfig* config = CBTConfig::getConfig();
|
|
|
|
KConfigGroupSaver groupSaver(config, "ints");
|
|
|
|
TDEConfigGroupSaver groupSaver(config, "ints");
|
|
|
|
return config->readNumEntry(getKey(ID), getDefault(ID));
|
|
|
|
return config->readNumEntry(getKey(ID), getDefault(ID));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const TQValueList<int> CBTConfig::get
|
|
|
|
const TQValueList<int> CBTConfig::get
|
|
|
|
( const CBTConfig::intLists ID ) {
|
|
|
|
( const CBTConfig::intLists ID ) {
|
|
|
|
KConfig* config = CBTConfig::getConfig();
|
|
|
|
TDEConfig* config = CBTConfig::getConfig();
|
|
|
|
KConfigGroupSaver groupSaver(config, "intlists");
|
|
|
|
TDEConfigGroupSaver groupSaver(config, "intlists");
|
|
|
|
return config->readIntListEntry(getKey(ID));
|
|
|
|
return config->readIntListEntry(getKey(ID));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const TQStringList CBTConfig::get
|
|
|
|
const TQStringList CBTConfig::get
|
|
|
|
( const CBTConfig::stringLists ID ) {
|
|
|
|
( const CBTConfig::stringLists ID ) {
|
|
|
|
KConfig* config = CBTConfig::getConfig();
|
|
|
|
TDEConfig* config = CBTConfig::getConfig();
|
|
|
|
KConfigGroupSaver groupSaver(config, "stringlists");
|
|
|
|
TDEConfigGroupSaver groupSaver(config, "stringlists");
|
|
|
|
return config->readListEntry(getKey(ID));
|
|
|
|
return config->readListEntry(getKey(ID));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const CBTConfig::StringMap CBTConfig::get
|
|
|
|
const CBTConfig::StringMap CBTConfig::get
|
|
|
|
( const CBTConfig::stringMaps ID ) {
|
|
|
|
( const CBTConfig::stringMaps ID ) {
|
|
|
|
KConfig* config = CBTConfig::getConfig();
|
|
|
|
TDEConfig* config = CBTConfig::getConfig();
|
|
|
|
KConfigGroupSaver groupSaver(config, getKey(ID));
|
|
|
|
TDEConfigGroupSaver groupSaver(config, getKey(ID));
|
|
|
|
|
|
|
|
|
|
|
|
if (config->hasGroup(getKey(ID))) {
|
|
|
|
if (config->hasGroup(getKey(ID))) {
|
|
|
|
CBTConfig::StringMap map = config->entryMap(getKey(ID));
|
|
|
|
CBTConfig::StringMap map = config->entryMap(getKey(ID));
|
|
|
@ -395,8 +395,8 @@ const CBTConfig::FontSettingsPair CBTConfig::get
|
|
|
|
sd.setObject(fontConfigMap, new FontCache());
|
|
|
|
sd.setObject(fontConfigMap, new FontCache());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
KConfig* config = CBTConfig::getConfig();
|
|
|
|
TDEConfig* config = CBTConfig::getConfig();
|
|
|
|
KConfigGroupSaver groupSaver(config, "font standard settings");
|
|
|
|
TDEConfigGroupSaver groupSaver(config, "font standard settings");
|
|
|
|
|
|
|
|
|
|
|
|
FontSettingsPair settings;
|
|
|
|
FontSettingsPair settings;
|
|
|
|
settings.first = config->readBoolEntry(getKey(language));
|
|
|
|
settings.first = config->readBoolEntry(getKey(language));
|
|
|
@ -414,15 +414,15 @@ const CBTConfig::FontSettingsPair CBTConfig::get
|
|
|
|
|
|
|
|
|
|
|
|
void CBTConfig::set
|
|
|
|
void CBTConfig::set
|
|
|
|
( const CBTConfig::strings ID, const TQString value ) {
|
|
|
|
( const CBTConfig::strings ID, const TQString value ) {
|
|
|
|
KConfig* config = CBTConfig::getConfig();
|
|
|
|
TDEConfig* config = CBTConfig::getConfig();
|
|
|
|
KConfigGroupSaver groupSaver(config, "strings");
|
|
|
|
TDEConfigGroupSaver groupSaver(config, "strings");
|
|
|
|
config->writeEntry(getKey(ID), value);
|
|
|
|
config->writeEntry(getKey(ID), value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CBTConfig::set
|
|
|
|
void CBTConfig::set
|
|
|
|
( const CBTConfig::modules ID, CSwordModuleInfo* const value ) {
|
|
|
|
( const CBTConfig::modules ID, CSwordModuleInfo* const value ) {
|
|
|
|
KConfig* config = CBTConfig::getConfig();
|
|
|
|
TDEConfig* config = CBTConfig::getConfig();
|
|
|
|
KConfigGroupSaver groupSaver(config, "modules");
|
|
|
|
TDEConfigGroupSaver groupSaver(config, "modules");
|
|
|
|
config->writeEntry(getKey(ID), value ? value->name() : TQString());
|
|
|
|
config->writeEntry(getKey(ID), value ? value->name() : TQString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -437,37 +437,37 @@ void CBTConfig::set
|
|
|
|
|
|
|
|
|
|
|
|
void CBTConfig::set
|
|
|
|
void CBTConfig::set
|
|
|
|
(const CBTConfig::bools ID,const bool value ) {
|
|
|
|
(const CBTConfig::bools ID,const bool value ) {
|
|
|
|
KConfig* config = CBTConfig::getConfig();
|
|
|
|
TDEConfig* config = CBTConfig::getConfig();
|
|
|
|
//special behaviour to work with KTipDialog class of KDE
|
|
|
|
//special behaviour to work with KTipDialog class of KDE
|
|
|
|
KConfigGroupSaver groupSaver(config, (ID == CBTConfig::tips) ? "TipOfDay" : "bools");
|
|
|
|
TDEConfigGroupSaver groupSaver(config, (ID == CBTConfig::tips) ? "TipOfDay" : "bools");
|
|
|
|
config->writeEntry(getKey(ID), value);
|
|
|
|
config->writeEntry(getKey(ID), value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CBTConfig::set
|
|
|
|
void CBTConfig::set
|
|
|
|
(const CBTConfig::ints ID, const int value ) {
|
|
|
|
(const CBTConfig::ints ID, const int value ) {
|
|
|
|
KConfig* config = CBTConfig::getConfig();
|
|
|
|
TDEConfig* config = CBTConfig::getConfig();
|
|
|
|
KConfigGroupSaver groupSaver(config, "ints");
|
|
|
|
TDEConfigGroupSaver groupSaver(config, "ints");
|
|
|
|
config->writeEntry(getKey(ID), value);
|
|
|
|
config->writeEntry(getKey(ID), value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CBTConfig::set
|
|
|
|
void CBTConfig::set
|
|
|
|
( const CBTConfig::intLists ID, const TQValueList<int> value ) {
|
|
|
|
( const CBTConfig::intLists ID, const TQValueList<int> value ) {
|
|
|
|
KConfig* config = CBTConfig::getConfig();
|
|
|
|
TDEConfig* config = CBTConfig::getConfig();
|
|
|
|
KConfigGroupSaver groupSaver(config, "intlists");
|
|
|
|
TDEConfigGroupSaver groupSaver(config, "intlists");
|
|
|
|
config->writeEntry(getKey(ID), value);
|
|
|
|
config->writeEntry(getKey(ID), value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CBTConfig::set
|
|
|
|
void CBTConfig::set
|
|
|
|
( const CBTConfig::stringLists ID, const TQStringList value ) {
|
|
|
|
( const CBTConfig::stringLists ID, const TQStringList value ) {
|
|
|
|
KConfig* config = CBTConfig::getConfig();
|
|
|
|
TDEConfig* config = CBTConfig::getConfig();
|
|
|
|
KConfigGroupSaver groupSaver(config, "stringlists");
|
|
|
|
TDEConfigGroupSaver groupSaver(config, "stringlists");
|
|
|
|
config->writeEntry(getKey(ID), value);
|
|
|
|
config->writeEntry(getKey(ID), value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CBTConfig::set
|
|
|
|
void CBTConfig::set
|
|
|
|
( const CBTConfig::stringMaps ID, const CBTConfig::StringMap value ) {
|
|
|
|
( const CBTConfig::stringMaps ID, const CBTConfig::StringMap value ) {
|
|
|
|
KConfig* config = CBTConfig::getConfig();
|
|
|
|
TDEConfig* config = CBTConfig::getConfig();
|
|
|
|
KConfigGroupSaver groupSaver(config, getKey(ID));
|
|
|
|
TDEConfigGroupSaver groupSaver(config, getKey(ID));
|
|
|
|
config->deleteGroup(getKey(ID)); //make sure we only save the new entries and don't use old ones
|
|
|
|
config->deleteGroup(getKey(ID)); //make sure we only save the new entries and don't use old ones
|
|
|
|
config->sync();
|
|
|
|
config->sync();
|
|
|
|
config->setGroup(getKey(ID));
|
|
|
|
config->setGroup(getKey(ID));
|
|
|
@ -507,9 +507,9 @@ void CBTConfig::set
|
|
|
|
|
|
|
|
|
|
|
|
void CBTConfig::set
|
|
|
|
void CBTConfig::set
|
|
|
|
( const CLanguageMgr::Language* const language, const FontSettingsPair& value ) {
|
|
|
|
( const CLanguageMgr::Language* const language, const FontSettingsPair& value ) {
|
|
|
|
KConfig* config = CBTConfig::getConfig();
|
|
|
|
TDEConfig* config = CBTConfig::getConfig();
|
|
|
|
|
|
|
|
|
|
|
|
KConfigGroupSaver groupSaver(config, "fonts");
|
|
|
|
TDEConfigGroupSaver groupSaver(config, "fonts");
|
|
|
|
config->writeEntry(getKey(language), value.second);
|
|
|
|
config->writeEntry(getKey(language), value.second);
|
|
|
|
|
|
|
|
|
|
|
|
config->setGroup("font standard settings");
|
|
|
|
config->setGroup("font standard settings");
|
|
|
@ -639,8 +639,8 @@ void CBTConfig::saveAccelSettings(const CBTConfig::keys type, KActionCollection*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const TQString CBTConfig::getModuleEncryptionKey( const TQString& module ) {
|
|
|
|
const TQString CBTConfig::getModuleEncryptionKey( const TQString& module ) {
|
|
|
|
KConfig* config = CBTConfig::getConfig();
|
|
|
|
TDEConfig* config = CBTConfig::getConfig();
|
|
|
|
KConfigGroupSaver groupSaver(config, "Module keys");
|
|
|
|
TDEConfigGroupSaver groupSaver(config, "Module keys");
|
|
|
|
|
|
|
|
|
|
|
|
return config->readEntry(module, TQString());
|
|
|
|
return config->readEntry(module, TQString());
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -656,14 +656,14 @@ void CBTConfig::setModuleEncryptionKey( const TQString& module, const TQString&
|
|
|
|
// return;
|
|
|
|
// return;
|
|
|
|
// };
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
|
|
KConfig* config = CBTConfig::getConfig();
|
|
|
|
TDEConfig* config = CBTConfig::getConfig();
|
|
|
|
KConfigGroupSaver groupSaver(config, "Module keys");
|
|
|
|
TDEConfigGroupSaver groupSaver(config, "Module keys");
|
|
|
|
|
|
|
|
|
|
|
|
config->writeEntry(module, key);
|
|
|
|
config->writeEntry(module, key);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
KConfig* const CBTConfig::getConfig() {
|
|
|
|
TDEConfig* const CBTConfig::getConfig() {
|
|
|
|
KConfig* config = TDEGlobal::config();
|
|
|
|
TDEConfig* config = TDEGlobal::config();
|
|
|
|
|
|
|
|
|
|
|
|
if (TDEApplication::kApplication()->sessionSaving()) {
|
|
|
|
if (TDEApplication::kApplication()->sessionSaving()) {
|
|
|
|
tqWarning("Using session config");
|
|
|
|
tqWarning("Using session config");
|
|
|
|