Commit ae442195 authored by Christoph Feck's avatar Christoph Feck

KGlobal::config -> KSharedConfig::openConfig

parent ae614c1d
......@@ -232,7 +232,7 @@ void kpCommandHistoryBase::readConfig ()
#if DEBUG_KP_COMMAND_HISTORY
kDebug () << "kpCommandHistoryBase::readConfig()";
#endif
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupUndoRedo);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupUndoRedo);
setUndoMinLimit (cfg.readEntry (kpSettingUndoMinLimit, undoMinLimit ()));
setUndoMaxLimit (cfg.readEntry (kpSettingUndoMaxLimit, undoMaxLimit ()));
......@@ -249,7 +249,7 @@ void kpCommandHistoryBase::writeConfig ()
#if DEBUG_KP_COMMAND_HISTORY
kDebug () << "kpCommandHistoryBase::writeConfig()";
#endif
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupUndoRedo);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupUndoRedo);
cfg.writeEntry (kpSettingUndoMinLimit, undoMinLimit ());
cfg.writeEntry (kpSettingUndoMaxLimit, undoMaxLimit ());
......
......@@ -108,7 +108,7 @@ kpTransformResizeScaleDialog::kpTransformResizeScaleDialog (
baseLayout->addWidget(operationGroupBox);
baseLayout->addWidget(dimensionsGroupBox);
KConfigGroup cfg(KGlobal::config(), kpSettingsGroupGeneral);
KConfigGroup cfg(KSharedConfig::openConfig(), kpSettingsGroupGeneral);
setKeepAspectRatio(cfg.readEntry(kpSettingResizeScaleLastKeepAspect, false));
m_lastType = static_cast<kpTransformResizeScaleCommand::Type>
(cfg.readEntry(kpSettingResizeScaleScaleType,
......@@ -805,7 +805,7 @@ void kpTransformResizeScaleDialog::accept ()
}
// store settings
KConfigGroup cfg(KGlobal::config(), kpSettingsGroupGeneral);
KConfigGroup cfg(KSharedConfig::openConfig(), kpSettingsGroupGeneral);
cfg.writeEntry(kpSettingResizeScaleLastKeepAspect, m_keepAspectRatioCheckBox->isChecked());
cfg.writeEntry(kpSettingResizeScaleScaleType, static_cast<int>(m_lastType));
......
......@@ -419,7 +419,7 @@ static QStringList mimeTypesSupportingProperty (const QString &property,
{
QStringList mimeTypeList;
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupMimeTypeProperties);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupMimeTypeProperties);
if (cfg.hasKey (property))
{
......
......@@ -109,7 +109,7 @@ void kpMainWindow::readGeneralSettings ()
kDebug () << "\tkpMainWindow(" << objectName () << ")::readGeneralSettings()";
#endif
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupGeneral);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupGeneral);
d->configFirstTime = cfg.readEntry (kpSettingFirstTime, true);
d->configShowGrid = cfg.readEntry (kpSettingShowGrid, false);
......@@ -157,7 +157,7 @@ void kpMainWindow::readThumbnailSettings ()
kDebug () << "\tkpMainWindow(" << objectName () << ")::readThumbnailSettings()";
#endif
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupThumbnail);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupThumbnail);
d->configThumbnailShown = cfg.readEntry (kpSettingThumbnailShown, false);
d->configThumbnailGeometry = cfg.readEntry (kpSettingThumbnailGeometry, QRect ());
......@@ -213,7 +213,7 @@ void kpMainWindow::init ()
// KConfig::readEntry() does not actually reread from disk, hence doesn't
// realize what other processes have done e.g. Settings / Show Path
KGlobal::config ()->reparseConfiguration ();
KSharedConfig::openConfig ()->reparseConfiguration ();
readGeneralSettings ();
readThumbnailSettings ();
......@@ -272,7 +272,7 @@ void kpMainWindow::init ()
{
d->toolToolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
KConfigGroup cfg(KGlobal::config(), kpSettingsGroupGeneral);
KConfigGroup cfg(KSharedConfig::openConfig(), kpSettingsGroupGeneral);
cfg.writeEntry(kpSettingFirstTime, d->configFirstTime = false);
cfg.sync();
......
......@@ -91,7 +91,7 @@ void kpMainWindow::setupFileMenuActions ()
d->actionOpen = KStandardAction::open (this, SLOT (slotOpen ()), ac);
d->actionOpenRecent = KStandardAction::openRecent (this, SLOT (slotOpenRecent (const QUrl &)), ac);
d->actionOpenRecent->loadEntries (KGlobal::config ()->group (kpSettingsGroupRecentFiles));
d->actionOpenRecent->loadEntries (KSharedConfig::openConfig ()->group (kpSettingsGroupRecentFiles));
#if DEBUG_KP_MAIN_WINDOW
kDebug () << "\trecent URLs=" << d->actionOpenRecent->items ();
#endif
......@@ -193,7 +193,7 @@ void kpMainWindow::addRecentURL (const QUrl &url_)
return;
KSharedConfig::Ptr cfg = KGlobal::config();
KSharedConfig::Ptr cfg = KSharedConfig::openConfig();
// KConfig::readEntry() does not actually reread from disk, hence doesn't
// realize what other processes have done e.g. Settings / Show Path
......@@ -284,9 +284,9 @@ QSize kpMainWindow::defaultDocSize () const
{
// KConfig::readEntry() does not actually reread from disk, hence doesn't
// realize what other processes have done e.g. Settings / Show Path
KGlobal::config ()->reparseConfiguration ();
KSharedConfig::openConfig ()->reparseConfiguration ();
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupGeneral);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupGeneral);
QSize docSize = cfg.readEntry (kpSettingLastDocSize, QSize ());
......@@ -314,7 +314,7 @@ void kpMainWindow::saveDefaultDocSize (const QSize &size)
kDebug () << "\tCONFIG: saving Last Doc Size = " << size;
#endif
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupGeneral);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupGeneral);
cfg.writeEntry (kpSettingLastDocSize, size);
cfg.sync ();
......@@ -778,11 +778,11 @@ QUrl kpMainWindow::askForSaveURL (const QString &caption,
#define SETUP_READ_CFG() \
if (!reparsedConfiguration) \
{ \
KGlobal::config ()->reparseConfiguration (); \
KSharedConfig::openConfig ()->reparseConfiguration (); \
reparsedConfiguration = true; \
} \
\
KConfigGroup cfg (KGlobal::config (), forcedSaveOptionsGroup); \
KConfigGroup cfg (KSharedConfig::openConfig (), forcedSaveOptionsGroup);
if (chosenSaveOptions)
......@@ -883,7 +883,7 @@ QUrl kpMainWindow::askForSaveURL (const QString &caption,
newSaveOptions.printDebug ("\tnewSaveOptions");
#endif
KConfigGroup cfg (KGlobal::config (), forcedSaveOptionsGroup);
KConfigGroup cfg (KSharedConfig::openConfig (), forcedSaveOptionsGroup);
// Save options user forced - probably want to use them in future
kpDocumentSaveOptions::saveDefaultDifferences (cfg,
......@@ -1317,7 +1317,7 @@ void kpMainWindow::sendImageToPrinter (QPrinter *printer,
// Save config option even if the dialog was cancelled.
d->configPrintImageCenteredOnPage = optionsPage->printImageCenteredOnPage ();
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupGeneral);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupGeneral);
cfg.writeEntry (kpSettingPrintImageCenteredOnPage,
d->configPrintImageCenteredOnPage);
cfg.sync ();
......
......@@ -586,7 +586,7 @@ void kpMainWindow::slotMoreEffects ()
{
d->moreEffectsDialogLastEffect = dialog.selectedEffect ();
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupGeneral);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupGeneral);
cfg.writeEntry (kpSettingMoreEffectsLastEffect,
d->moreEffectsDialogLastEffect);
......
......@@ -121,7 +121,7 @@ void kpMainWindow::slotShowPathToggled ()
slotUpdateCaption ();
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupGeneral);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupGeneral);
cfg.writeEntry (kpSettingShowPath, d->configShowPath);
cfg.sync ();
......
......@@ -99,7 +99,7 @@ void kpMainWindow::setupTextToolBarActions ()
// private
void kpMainWindow::readAndApplyTextSettings ()
{
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupText);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupText);
const QString font (cfg.readEntry (kpSettingFontFamily, QString::fromLatin1 ("Times")));
d->actionTextFontFamily->setFont (font);
......@@ -173,7 +173,7 @@ void kpMainWindow::slotTextFontFamilyChanged ()
if (d->mainView)
d->mainView->setFocus ();
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupText);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupText);
cfg.writeEntry (kpSettingFontFamily, d->actionTextFontFamily->font ());
cfg.sync ();
......@@ -206,7 +206,7 @@ void kpMainWindow::slotTextFontSizeChanged ()
if (d->mainView)
d->mainView->setFocus ();
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupText);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupText);
cfg.writeEntry (kpSettingFontSize, d->actionTextFontSize->fontSize ());
cfg.sync ();
......@@ -233,7 +233,7 @@ void kpMainWindow::slotTextBoldChanged ()
d->toolText->slotBoldChanged (d->actionTextBold->isChecked ());
}
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupText);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupText);
cfg.writeEntry (kpSettingBold, d->actionTextBold->isChecked ());
cfg.sync ();
}
......@@ -258,7 +258,7 @@ void kpMainWindow::slotTextItalicChanged ()
d->toolText->slotItalicChanged (d->actionTextItalic->isChecked ());
}
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupText);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupText);
cfg.writeEntry (kpSettingItalic, d->actionTextItalic->isChecked ());
cfg.sync ();
}
......@@ -283,7 +283,7 @@ void kpMainWindow::slotTextUnderlineChanged ()
d->toolText->slotUnderlineChanged (d->actionTextUnderline->isChecked ());
}
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupText);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupText);
cfg.writeEntry (kpSettingUnderline, d->actionTextUnderline->isChecked ());
cfg.sync ();
}
......@@ -308,7 +308,7 @@ void kpMainWindow::slotTextStrikeThruChanged ()
d->toolText->slotStrikeThruChanged (d->actionTextStrikeThru->isChecked ());
}
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupText);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupText);
cfg.writeEntry (kpSettingStrikeThru, d->actionTextStrikeThru->isChecked ());
cfg.sync ();
}
......
......@@ -492,7 +492,7 @@ void kpMainWindow::slotToolSelected (kpTool *tool)
// private
void kpMainWindow::readLastTool ()
{
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupTools);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupTools);
d->lastToolNumber = cfg.readEntry (kpSettingLastTool, -1);
}
......@@ -526,7 +526,7 @@ void kpMainWindow::saveLastTool ()
return;
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupTools);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupTools);
cfg.writeEntry (kpSettingLastTool, number);
cfg.sync ();
......
......@@ -132,7 +132,7 @@ void kpMainWindow::slotShowGridToggled ()
updateMainViewGrid ();
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupGeneral);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupGeneral);
cfg.writeEntry (kpSettingShowGrid, d->configShowGrid = d->actionShowGrid->isChecked ());
cfg.sync ();
......
......@@ -177,7 +177,7 @@ void kpMainWindow::slotSaveThumbnailGeometry ()
<< endl;
#endif
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupThumbnail);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupThumbnail);
cfg.writeEntry (kpSettingThumbnailGeometry, d->configThumbnailGeometry);
cfg.sync ();
......@@ -192,7 +192,7 @@ void kpMainWindow::slotShowThumbnailToggled ()
d->configThumbnailShown = d->actionShowThumbnail->isChecked ();
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupThumbnail);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupThumbnail);
cfg.writeEntry (kpSettingThumbnailShown, d->configThumbnailShown);
cfg.sync ();
......@@ -226,7 +226,7 @@ void kpMainWindow::slotZoomedThumbnailToggled ()
d->configZoomedThumbnail = d->actionZoomedThumbnail->isChecked ();
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupThumbnail);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupThumbnail);
cfg.writeEntry (kpSettingThumbnailZoomed, d->configZoomedThumbnail);
cfg.sync ();
......@@ -244,7 +244,7 @@ void kpMainWindow::slotThumbnailShowRectangleToggled ()
d->configThumbnailShowRectangle = d->actionShowThumbnailRectangle->isChecked ();
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupThumbnail);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupThumbnail);
cfg.writeEntry (kpSettingThumbnailShowRectangle, d->configThumbnailShowRectangle);
cfg.sync ();
......
......@@ -61,7 +61,7 @@ kpColorSimilarityToolBarItem::kpColorSimilarityToolBarItem (QWidget *parent)
connect (this, SIGNAL (clicked ()), SLOT (openDialog ()));
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupGeneral);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupGeneral);
setColorSimilarityInternal (cfg.readEntry (kpSettingColorSimilarity, 0.0),
false/*don't write config*/);
......@@ -100,7 +100,7 @@ void kpColorSimilarityToolBarItem::setColorSimilarityInternal (double similarity
if (writeConfig)
{
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupGeneral);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupGeneral);
cfg.writeEntry (kpSettingColorSimilarity, colorSimilarity ());
cfg.sync ();
}
......
......@@ -58,7 +58,7 @@ kpEffectFlattenWidget::kpEffectFlattenWidget (bool actOnSelection,
{
if (!s_lastColor1.isValid () || !s_lastColor2.isValid ())
{
KConfigGroup cfgGroupSaver (KGlobal::config (), kpSettingsGroupFlattenEffect);
KConfigGroup cfgGroupSaver (KSharedConfig::openConfig (), kpSettingsGroupFlattenEffect);
s_lastColor1 = cfgGroupSaver.readEntry (kpSettingFlattenEffectColor1, QColor ());
if (!s_lastColor1.isValid ())
......@@ -105,7 +105,7 @@ kpEffectFlattenWidget::~kpEffectFlattenWidget ()
s_lastColor2 = color2 ();
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupFlattenEffect);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupFlattenEffect);
cfg.writeEntry (kpSettingFlattenEffectColor1, s_lastColor1);
cfg.writeEntry (kpSettingFlattenEffectColor2, s_lastColor2);
......
......@@ -542,7 +542,7 @@ void kpDocumentSaveOptionsWidget::showPreview (bool yes)
this, SLOT (hidePreview ()));
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupPreviewSave);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupPreviewSave);
if (cfg.hasKey (kpSettingPreviewSaveUpdateDelay))
{
......@@ -568,7 +568,7 @@ void kpDocumentSaveOptionsWidget::showPreview (bool yes)
#if DEBUG_KP_DOCUMENT_SAVE_OPTIONS_WIDGET
kDebug () << "\tread cfg preview dialog last rel geometry";
#endif
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupPreviewSave);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupPreviewSave);
m_previewDialogLastRelativeGeometry = cfg.readEntry (
kpSettingPreviewSaveGeometry, QRect ());
......@@ -643,7 +643,7 @@ void kpDocumentSaveOptionsWidget::showPreview (bool yes)
{
m_updatePreviewDialogLastRelativeGeometryTimer->stop ();
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupPreviewSave);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupPreviewSave);
cfg.writeEntry (kpSettingPreviewSaveGeometry, m_previewDialogLastRelativeGeometry);
cfg.sync ();
......
......@@ -204,7 +204,7 @@ QPair <int, int> kpToolWidgetBase::defaultSelectedRowAndCol () const
if (!objectName ().isEmpty ())
{
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupTools);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupTools);
row = cfg.readEntry (objectName () + QLatin1String (" Row"), -1);
col = cfg.readEntry (objectName () + QLatin1String (" Col"), -1);
......@@ -250,7 +250,7 @@ void kpToolWidgetBase::saveSelectedAsDefault () const
if (objectName ().isEmpty ())
return;
KConfigGroup cfg (KGlobal::config (), kpSettingsGroupTools);
KConfigGroup cfg (KSharedConfig::openConfig (), kpSettingsGroupTools);
cfg.writeEntry (objectName () + QLatin1String (" Row"), m_selectedRow);
cfg.writeEntry (objectName () + QLatin1String (" Col"), m_selectedCol);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment