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