本文整理汇总了C++中KConfigBase::setGroup方法的典型用法代码示例。如果您正苦于以下问题:C++ KConfigBase::setGroup方法的具体用法?C++ KConfigBase::setGroup怎么用?C++ KConfigBase::setGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KConfigBase
的用法示例。
在下文中一共展示了KConfigBase::setGroup方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: save
/** No descriptions */
bool KCountryPage::save(KLanguageButton *comboCountry, KLanguageButton *comboLang) {
kdDebug() << "KCountryPage::save()" << endl;
KConfigBase *config = KGlobal::config();
config->setGroup(QString::fromLatin1("Locale"));
config->writeEntry(QString::fromLatin1("Country"), comboCountry->current(), true, true);
config->writeEntry(QString::fromLatin1("Language"), comboLang->current(), true, true);
config->sync();
// only make the system reload the language, if the selected one deferes from the old saved one.
if (b_savedLanguageChanged) {
// Tell kdesktop about the new language
QCString replyType; QByteArray replyData;
QByteArray data, da;
QDataStream stream( data, IO_WriteOnly );
stream << comboLang->current();
if ( !kapp->dcopClient()->isAttached() )
kapp->dcopClient()->attach();
// ksycoca needs to be rebuilt
KProcess proc;
proc << QString::fromLatin1("kbuildsycoca");
proc.start(KProcess::DontCare);
kdDebug() << "KLocaleConfig::save : sending signal to kdesktop" << endl;
// inform kicker and kdeskop about the new language
kapp->dcopClient()->send( "kicker", "Panel", "restart()", QString::null);
// call, not send, so that we know it's done before coming back
// (we both access kdeglobals...)
kapp->dcopClient()->call( "kdesktop", "KDesktopIface", "languageChanged(QString)", data, replyType, replyData );
}
// KPersonalizer::next() probably waits for a return-value
return true;
}
示例2: load
void HostConfigMap::load( KConfigBase &config, const QStringList &hosts )
{
clear();
for ( QStringList::ConstIterator it = hosts.begin(); it != hosts.end(); ++it ) {
config.setGroup( "Host " + *it );
HostConfig src;
if ( !src.load( config ) )
continue;
insert( *it, src );
}
}
示例3: save
QStringList HostConfigMap::save( KConfigBase &config ) const
{
QStringList hostList;
for ( ConstIterator it = begin(); it != end(); ++it ) {
QString host = it.key();
hostList << host;
config.setGroup( "Host " + host );
( *it ).save( config );
}
return hostList;
}