本文整理汇总了C++中KConfig::sync方法的典型用法代码示例。如果您正苦于以下问题:C++ KConfig::sync方法的具体用法?C++ KConfig::sync怎么用?C++ KConfig::sync使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KConfig
的用法示例。
在下文中一共展示了KConfig::sync方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testStyle
void Style::testStyle()
{
// Read entire XML into DOM Tree
QFile file(selectedStyle);
file.open(IO_ReadOnly);
dom.setContent(file.readAll());
file.close();
// attach to dcop
DCOPClient *client = kapp->dcopClient();
if (!client->isAttached())
client->attach();
// kicker settings
KConfig *kickerConf = new KConfig("kickerrc");
kickerConf->setGroup("General");
QDomElement Kicker = dom.elementsByTagName("kicker").item(0).toElement();
kickerConf->writeEntry("LegacyKMenu", !checkKickoff->isChecked());
kickerConf->writeEntry("Transparent", getProperty(Kicker, "Transparent", "value"));
kickerConf->writeEntry("SizePercentage", getProperty(Kicker, "SizePercentage", "value"));
kickerConf->writeEntry("CustomSize", getProperty(Kicker, "CustomSize", "value"));
kickerConf->writeEntry("Position", getProperty(Kicker, "Position", "value"));
kickerConf->writeEntry("Alignment", getProperty(Kicker, "Alignment", "value"));
kickerConf->sync();
delete kickerConf;
// restart kicker
client->send("kicker", "kicker", "restart()", "");
// kwin settings
KConfig *kwinConf = new KConfig("kwinrc");
kwinConf->setGroup("Style");
QDomElement KWin = dom.elementsByTagName("kwin").item(0).toElement();
kwinConf->writeEntry("PluginLib", getProperty(KWin, "PluginLib", "value"));
kwinConf->sync();
delete kwinConf;
// restart kwin
client->send("kwin", "KWinInterface", "reconfigure()", "");
// widget settings
KConfig *globalConf = new KConfig("kdeglobals");
globalConf->setGroup("General");
QDomElement Widget = dom.elementsByTagName("widget").item(0).toElement();
globalConf->writeEntry("widgetStyle", getProperty(Widget, "widgetStyle", "value"));
globalConf->sync();
delete globalConf;
KIPC::sendMessageAll(KIPC::StyleChanged);
}
示例2: StyleDlg
Style::Style(QWidget *parent, const char* name)
: StyleDlg(parent, name)
{
// Common Pardus settings for all themes
KConfig *config = new KConfig("kdeglobals");
config->setGroup("KDE");
config->writeEntry("ShowIconsOnPushButtons", true);
config->writeEntry("EffectAnimateCombo", true);
config->sync();
delete config;
// add kaptan themes into resouce pool
KGlobal::dirs()->addResourceType("themes", KStandardDirs::kde_default("data") + "kaptan/themes/");
QStringList themes = KGlobal::dirs()->findAllResources("themes", "*.xml", true /*recursive*/);
themes.sort();
for (QStringList::const_iterator it = themes.begin(); it != themes.end(); ++it)
styleBox->insertItem(QFileInfo(*it).baseName());
connect(styleButton, SIGNAL(clicked()), this, SLOT(testStyle()));
connect(styleBox, SIGNAL(activated(int)), this, SLOT(styleSelected(int)));
connect(checkKickoff, SIGNAL(clicked()), this, SLOT(kickoffSelected()));
styleBox->setCurrentItem(0);
emit(styleSelected(0));
}
示例3: configWrite
/** Write settings */
void KControlHeader::configWrite()
{
KConfig *config = KGlobal::config();
config->setGroup("kcontrolheader");
config->writeEntry("Geometry", size() );
config->sync();
}
示例4: saveConfigAsTemplate
/*!
saves spreadsheet properties to \c config.
*/
void SpreadsheetDock::saveConfigAsTemplate(KConfig& config) {
KConfigGroup group = config.group( "Spreadsheet" );
group.writeEntry("ColumnCount", ui.sbColumnCount->value());
group.writeEntry("RowCount", ui.sbRowCount->value());
group.writeEntry("ShowComments",ui.cbShowComments->isChecked());
config.sync();
}
示例5: slotOk
// Ok pressed - save settings and exit
void KScienceSetup::slotOk()
{
KConfig *config = KGlobal::config();
QString sSize, sSpeed, sIntensity, sMode;
config->setGroup( "Settings" );
config->writeEntry( "ModeNr", mode );
for(int i=0; i<MAX_MODES; i++)
{
sMode.setNum( i );
config->setGroup( "Mode" + sMode );
config->writeEntry( "MoveX", moveX[i] );
config->writeEntry( "MoveY", moveY[i] );
config->writeEntry( "Size", size[i] );
config->writeEntry( "Speed", speed[i] );
config->writeEntry( "Intensity", intensity[i] );
config->writeEntry( "Inverse", inverse[i] );
config->writeEntry( "Gravity", gravity[i] );
config->writeEntry( "HideBG", hideBG[i] );
}
config->sync();
accept();
}
示例6: writeConfig
void KChooseImportExportDlg::writeConfig(void)
{
KConfig *config = KGlobal::config();
config->setGroup("Last Use Settings");
config->writeEntry("KChooseImportExportDlg_LastType", typeCombo->currentText());
config->sync();
}
示例7: setup
void PrintDialog::setup()
{
PrintSetup *ps = new PrintSetup( this, "print setup", printerName,
spoolerCommand, printerVariable );
if( ps->exec() ) {
printerName.sprintf( ps->leName->text() );
spoolerCommand.sprintf( ps->leSpool->text() );
printerVariable.sprintf( ps->leVar->text() );
/* Set the default options. */
KConfig *config = KApplication::getKApplication()->getConfig();
config->setGroup( "Print" );
config->writeEntry ("Name", (const char *)printerName);
config->writeEntry ("Spool", (const char *)spoolerCommand);
config->writeEntry ("Variable", (const char*)printerVariable);
config->sync();
delete ps;
}
}
示例8: writeOut
int Korn::writeOut( QList<KornBox> *list )
{
KConfig *config = KApplication::getKApplication()->getConfig();
KornBox *box;
QString boxList;
if( config == 0 )
return -1;
for( box = list->first(); box != 0; box = list->next() ) {
// add to box list
boxList.append( box->name );
boxList.append(", ");
// update box entry
config->setGroup( box->name );
config->writeEntry( "Name", box->caption, true );
config->writeEntry( "box", box->path, true );
config->writeEntry( "polltime", box->poll, true );
config->writeEntry( "audio", box->notify, true );
config->writeEntry( "command", box->click, true );
}
config->setGroup( "Korn" );
config->writeEntry( "boxes", boxList );
config->sync();
return 0;
}
示例9: setProxyFor
void KSaveIOConfig::setProxyFor( const QString& protocol,
const QString& _proxy )
{
KConfig* cfg = config();
cfg->group("Proxy Settings").writeEntry( protocol.toLower() + "Proxy", _proxy );
cfg->sync();
}
示例10: setCacheControl
void KSaveIOConfig::setCacheControl(KIO::CacheControl policy)
{
KConfig* cfg = http_config();
QString tmp = KIO::getCacheControlString(policy);
cfg->group("").writeEntry("cache", tmp);
cfg->sync();
}
示例11: addToHotlist
void KJotsMain::addToHotlist()
{
if( hotlist.count() == HOT_LIST_SIZE )
return;
QFileInfo fi(current_folder_name);
QString name = fi.fileName();
if( hotlist.contains(name) )
return;
hotlist.append(name);
int index = folder_list.find(name);
if( index < 0 )
return;
int id = folders->idAt(index);
QPushButton *but = new QPushButton(name, bg_top);
button_list.append(but);
bg_top->insert(but, id);
KConfig *config = KApplication::getKApplication()->getConfig();
config->setGroup("kjots");
config->writeEntry( "Hotlist", hotlist );
config->sync();
but->setFocusPolicy(QWidget::ClickFocus);
but->setToggleButton(TRUE);
but->setFixedSize(BUTTON_WIDTH,24);
but->show();
but->setOn(TRUE);
bg_top->forceResize();
}
示例12: save
void FontDialog::save()
{
KConfig *cfg = kapp->config();
{
KConfigGroupSaver groupSaver(cfg, "General");
cfg->writeEntry("UseKonqSettings", false);
}
{
KConfigGroupSaver groupSaver(cfg, "HTML Settings");
cfg->writeEntry("MinimumFontSize", m_minFontSize->value());
cfg->writeEntry("MediumFontSize", m_medFontSize->value());
QStringList fonts;
fonts << m_standardFontCombo->currentText() << m_fixedFontCombo->currentText() << m_serifFontCombo->currentText()
<< m_sansSerifFontCombo->currentText() << m_italicFontCombo->currentText() << m_fantasyFontCombo->currentText()
<< QString::number(m_fontSizeAdjustement->value());
cfg->writeEntry("Fonts", fonts);
if(m_defaultEncoding->currentText() == i18n("Use Language Encoding"))
cfg->writeEntry("DefaultEncoding", QString::null);
else
cfg->writeEntry("DefaultEncoding", m_defaultEncoding->currentText());
}
cfg->sync();
}
示例13: selectBackground
/**
* Select a background image.
*/
void KJezzball::selectBackground()
{
QString path = KFileDialog::getExistingDirectory( m_backgroundDir, this,
i18n("Select Background Image Folder") );
if ( !path.isEmpty() && path!=m_backgroundDir ) {
m_backgroundDir = path;
// enable action
m_backgroundShowAction->setEnabled(true);
// save settings
KConfig *config = kapp->config();
config->writePathEntry( "BackgroundDir", m_backgroundDir );
config->sync();
// apply background setting
if ( m_showBackground ) {
if ( m_background.width()==0 )
m_background = getBackgroundPixmap();
m_gameWidget->setBackground( m_background );
}
else{
KMessageBox::information( this, i18n("You may now turn on background images."));
}
}
}
示例14: saveConfig
void KMixApplet::saveConfig()
{
kdDebug(67100) << "KMixApplet::saveConfig()" << endl;
if ( m_mixerWidget != 0) {
//kdDebug(67100) << "KMixApplet::saveConfig() save" << endl;
KConfig *cfg = this->config();
//kdDebug(67100) << "KMixApplet::saveConfig() save cfg=" << cfg << endl;
cfg->setGroup( 0 );
cfg->writeEntry( "Mixer", _mixer->id() );
cfg->writeEntry( "MixerName", _mixer->mixerName() );
cfg->writeEntry( "ColorCustom", _customColors );
cfg->writeEntry( "ColorHigh", _colors.high.name() );
cfg->writeEntry( "ColorLow", _colors.low.name() );
cfg->writeEntry( "ColorBack", _colors.back.name() );
cfg->writeEntry( "ColorMutedHigh", _colors.mutedHigh.name() );
cfg->writeEntry( "ColorMutedLow", _colors.mutedLow.name() );
cfg->writeEntry( "ColorMutedBack", _colors.mutedBack.name() );
//cfg->writeEntry( "ReversedDirection", reversedDir );
saveConfig( cfg, "Widget" );
cfg->sync();
}
}
示例15: writeSettings
void Data::writeSettings() {
KConfig *config;
config = mykapp->getConfig();
config->setGroup( "Data" );
config->writeEntry( "Printer",Printer.data() );
config->writeEntry( "Job_name",Job_name.data() );
config->writeEntry( "Density",Density.data() );
config->writeEntry( "Fontnumber", Fontnumber.data() );
config->writeEntry( "Format", Format.data() );
config->writeEntry( "Termination",Termination.data() );
config->writeEntry( "RET", RET.data() );
config->writeEntry( "Copies",Copies.data() );
config->writeEntry( "Powersave", Powersave.data() );
config->writeEntry( "Resolution",Resolution.data() );
config->writeEntry( "Language",Language.data() );
config->writeEntry( "Pageprotect",Pageprotect.data() );
config->writeEntry( "Ptsize",Ptsize.data() );
config->writeEntry( "Pitch",Pitch.data() );
config->writeEntry( "Economode",Economode.data() );
config->writeEntry( "Manualfeed",Manualfeed.data() );
config->writeEntry( "Orientation",Orientation.data() );
config->writeEntry( "Symset",Symset.data() );
config->writeEntry( "Autocont",Autocont.data() );
config->writeEntry( "Formlines",Formlines.data() );
config->sync();
}