本文整理汇总了C++中KConfigBase::sync方法的典型用法代码示例。如果您正苦于以下问题:C++ KConfigBase::sync方法的具体用法?C++ KConfigBase::sync怎么用?C++ KConfigBase::sync使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KConfigBase
的用法示例。
在下文中一共展示了KConfigBase::sync方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotTextFontSizeChanged
// private slot
void kpMainWindow::slotTextFontSizeChanged ()
{
#if DEBUG_KP_MAIN_WINDOW
kdDebug () << "kpMainWindow::slotTextFontSizeChanged() alive="
<< m_isFullyConstructed
<< " fontSize="
<< m_actionTextFontSize->fontSize ()
<< endl;
#endif
if (!m_isFullyConstructed)
return;
if (m_toolText && m_toolText->hasBegun ())
{
m_toolText->slotFontSizeChanged (m_actionTextFontSize->fontSize (),
m_textOldFontSize);
}
// Since editable KSelectAction's steal focus from view, switch back to mainView
// TODO: back to the last view
if (m_mainView)
m_mainView->setFocus ();
KConfigGroupSaver cfgGroupSaver (kapp->config (), kpSettingsGroupText);
KConfigBase *cfg = cfgGroupSaver.config ();
cfg->writeEntry (kpSettingFontSize, m_actionTextFontSize->fontSize ());
cfg->sync ();
m_textOldFontSize = m_actionTextFontSize->fontSize ();
}
示例2: slotSaveThumbnailGeometry
// private slot
void kpMainWindow::slotSaveThumbnailGeometry ()
{
#if DEBUG_KP_MAIN_WINDOW
kdDebug () << "kpMainWindow::saveThumbnailGeometry()" << endl;
#endif
if (!m_thumbnail)
return;
QRect rect (m_thumbnail->x (), m_thumbnail->y (),
m_thumbnail->width (), m_thumbnail->height ());
#if DEBUG_KP_MAIN_WINDOW
kdDebug () << "\tthumbnail relative geometry=" << rect << endl;
#endif
m_configThumbnailGeometry = mapFromGlobal (rect);
#if DEBUG_KP_MAIN_WINDOW
kdDebug () << "\tCONFIG: saving thumbnail geometry "
<< m_configThumbnailGeometry
<< endl;
#endif
KConfigGroupSaver cfgGroupSaver (kapp->config (), kpSettingsGroupThumbnail);
KConfigBase *cfg = cfgGroupSaver.config ();
cfg->writeEntry (kpSettingThumbnailGeometry, m_configThumbnailGeometry);
cfg->sync ();
}
示例3: 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;
}
示例4: slotMoreEffects
// private slot
void kpMainWindow::slotMoreEffects ()
{
if (toolHasBegunShape ())
tool ()->endShapeInternal ();
kpEffectsDialog dialog ((bool) m_document->selection (), this);
dialog.selectEffect (d->m_moreEffectsDialogLastEffect);
if (dialog.exec () && !dialog.isNoOp ())
{
addImageOrSelectionCommand (dialog.createCommand ());
}
if (d->m_moreEffectsDialogLastEffect != dialog.selectedEffect ())
{
d->m_moreEffectsDialogLastEffect = dialog.selectedEffect ();
KConfigGroupSaver cfgGroupSaver (kapp->config (), kpSettingsGroupGeneral);
KConfigBase *cfg = cfgGroupSaver.config ();
cfg->writeEntry (kpSettingMoreEffectsLastEffect,
d->m_moreEffectsDialogLastEffect);
cfg->sync ();
}
}
示例5: slotShowGridToggled
// private slot
void kpMainWindow::slotShowGridToggled ()
{
#if DEBUG_KP_MAIN_WINDOW
kdDebug () << "kpMainWindow::slotActionShowGridToggled()" << endl;
#endif
updateMainViewGrid ();
KConfigGroupSaver cfgGroupSaver (kapp->config (), kpSettingsGroupGeneral);
KConfigBase *cfg = cfgGroupSaver.config ();
cfg->writeEntry (kpSettingShowGrid, m_configShowGrid = m_actionShowGrid->isChecked ());
cfg->sync ();
}
示例6: slotResizeScale
// private slot
void kpMainWindow::slotResizeScale ()
{
if (toolHasBegunShape ())
tool ()->endShapeInternal ();
kpToolResizeScaleDialog dialog (this);
dialog.setKeepAspectRatio (d->m_resizeScaleDialogLastKeepAspect);
if (dialog.exec () && !dialog.isNoOp ())
{
kpToolResizeScaleCommand *cmd = new kpToolResizeScaleCommand (
dialog.actOnSelection (),
dialog.imageWidth (), dialog.imageHeight (),
dialog.type (),
this);
bool addSelCreateCommand = (dialog.actOnSelection () ||
cmd->scaleSelectionWithImage ());
bool addSelPullCommand = dialog.actOnSelection ();
addImageOrSelectionCommand (
cmd,
addSelCreateCommand,
addSelPullCommand);
// Resized document?
if (!dialog.actOnSelection () &&
dialog.type () == kpToolResizeScaleCommand::Resize)
{
// TODO: this should be the responsibility of kpDocument
saveDefaultDocSize (QSize (dialog.imageWidth (), dialog.imageHeight ()));
}
}
if (d->m_resizeScaleDialogLastKeepAspect != dialog.keepAspectRatio ())
{
d->m_resizeScaleDialogLastKeepAspect = dialog.keepAspectRatio ();
KConfigGroupSaver cfgGroupSaver (kapp->config (), kpSettingsGroupGeneral);
KConfigBase *cfg = cfgGroupSaver.config ();
cfg->writeEntry (kpSettingResizeScaleLastKeepAspect,
d->m_resizeScaleDialogLastKeepAspect);
cfg->sync ();
}
}
示例7: slotZoomedThumbnailToggled
// private slot
void kpMainWindow::slotZoomedThumbnailToggled ()
{
#if DEBUG_KP_MAIN_WINDOW
kdDebug () << "kpMainWindow::slotZoomedThumbnailToggled()" << endl;
#endif
m_configZoomedThumbnail = m_actionZoomedThumbnail->isChecked ();
KConfigGroupSaver cfgGroupSaver (kapp->config (), kpSettingsGroupThumbnail);
KConfigBase *cfg = cfgGroupSaver.config ();
cfg->writeEntry (kpSettingThumbnailZoomed, m_configZoomedThumbnail);
cfg->sync ();
updateThumbnailZoomed ();
}
示例8: slotShowPathToggled
// private slot
void kpMainWindow::slotShowPathToggled ()
{
#if DEBUG_KP_MAIN_WINDOW
kdDebug () << "kpMainWindow::slotShowPathToggled()" << endl;
#endif
m_configShowPath = m_actionShowPath->isChecked ();
slotUpdateCaption ();
KConfigGroupSaver cfgGroupSaver (kapp->config (), kpSettingsGroupGeneral);
KConfigBase *cfg = cfgGroupSaver.config ();
cfg->writeEntry (kpSettingShowPath, m_configShowPath);
cfg->sync ();
}
示例9: slotShowThumbnailToggled
// private slot
void kpMainWindow::slotShowThumbnailToggled ()
{
#if DEBUG_KP_MAIN_WINDOW
kdDebug () << "kpMainWindow::slotShowThumbnailToggled()" << endl;
#endif
m_configThumbnailShown = m_actionShowThumbnail->isChecked ();
KConfigGroupSaver cfgGroupSaver (kapp->config (), kpSettingsGroupThumbnail);
KConfigBase *cfg = cfgGroupSaver.config ();
cfg->writeEntry (kpSettingThumbnailShown, m_configThumbnailShown);
cfg->sync ();
enableThumbnailOptionActions (m_actionShowThumbnail->isChecked ());
updateThumbnail ();
}
示例10: slotTextStrikeThruChanged
// private slot
void kpMainWindow::slotTextStrikeThruChanged ()
{
#if DEBUG_KP_MAIN_WINDOW
kdDebug () << "kpMainWindow::slotTextStrikeThruChanged() alive="
<< m_isFullyConstructed
<< " strikeThru="
<< m_actionTextStrikeThru->isChecked ()
<< endl;
#endif
if (!m_isFullyConstructed)
return;
if (m_toolText && m_toolText->hasBegun ())
m_toolText->slotStrikeThruChanged (m_actionTextStrikeThru->isChecked ());
KConfigGroupSaver cfgGroupSaver (kapp->config (), kpSettingsGroupText);
KConfigBase *cfg = cfgGroupSaver.config ();
cfg->writeEntry (kpSettingStrikeThru, m_actionTextStrikeThru->isChecked ());
cfg->sync ();
}
示例11: slotThumbnailShowRectangleToggled
// private slot
void kpMainWindow::slotThumbnailShowRectangleToggled ()
{
#if DEBUG_KP_MAIN_WINDOW
kdDebug () << "kpMainWindow::slotThumbnailShowRectangleToggled()" << endl;
#endif
d->m_configThumbnailShowRectangle = d->m_actionShowThumbnailRectangle->isChecked ();
KConfigGroupSaver cfgGroupSaver (kapp->config (), kpSettingsGroupThumbnail);
KConfigBase *cfg = cfgGroupSaver.config ();
cfg->writeEntry (kpSettingThumbnailShowRectangle, d->m_configThumbnailShowRectangle);
cfg->sync ();
if (m_thumbnailView)
{
m_thumbnailView->showBuddyViewScrollableContainerRectangle (
d->m_actionShowThumbnailRectangle->isChecked ());
}
}