コード例 #1
0
/** 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
0
ファイル: hostconfig.cpp プロジェクト: serghei/kde3-kdeutils
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
0
ファイル: hostconfig.cpp プロジェクト: serghei/kde3-kdeutils
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;
}