Commit 9b5d1d23 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Port Krita from kglobal::config to ksharedconfig::openconfig

parent 2ce28ffd
......@@ -63,7 +63,7 @@ KisSerializableConfiguration* KisBookmarkedConfigurationManager::load(const QStr
else
return 0;
}
KConfigGroup cfg = KGlobal::config()->group(configEntryGroup());
KConfigGroup cfg = KSharedConfig::openConfig()->group(configEntryGroup());
QDomDocument doc;
doc.setContent(cfg.readEntry<QString>(configname, ""));
......@@ -77,20 +77,20 @@ void KisBookmarkedConfigurationManager::save(const QString & configname, const K
{
dbgImage << "Saving configuration " << config << " to " << configname;
if (!config) return;
KConfigGroup cfg = KGlobal::config()->group(configEntryGroup());
KConfigGroup cfg = KSharedConfig::openConfig()->group(configEntryGroup());
cfg.writeEntry(configname, config->toXML());
}
bool KisBookmarkedConfigurationManager::exists(const QString & configname) const
{
KSharedConfig::Ptr cfg = KGlobal::config();
KSharedConfig::Ptr cfg = KSharedConfig::openConfig();
QMap< QString, QString > m = cfg->entryMap(configEntryGroup());
return (m.find(configname) != m.end());
}
QList<QString> KisBookmarkedConfigurationManager::configurations() const
{
KSharedConfig::Ptr cfg = KGlobal::config();
KSharedConfig::Ptr cfg = KSharedConfig::openConfig();
QMap< QString, QString > m = cfg->entryMap(configEntryGroup());
QList<QString> keys = m.keys();
QList<QString> configsKey;
......@@ -120,7 +120,7 @@ QString KisBookmarkedConfigurationManager::configEntryGroup() const
void KisBookmarkedConfigurationManager::remove(const QString & name)
{
KSharedConfig::Ptr cfg = KGlobal::config();
KSharedConfig::Ptr cfg = KSharedConfig::openConfig();
KConfigGroup group = cfg->group(configEntryGroup());
group.deleteEntry(name);
}
......
......@@ -30,7 +30,7 @@
KisImageConfig::KisImageConfig()
: m_config(KGlobal::config()->group(""))
: m_config( KSharedConfig::openConfig()->group(""))
{
}
......
......@@ -255,7 +255,7 @@ void KisColorPatches::updateSettings()
{
KisColorSelectorBase::updateSettings();
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
if(cfg.readEntry(m_configPrefix+"Alignment", false))
m_direction=Vertical;
......
......@@ -145,7 +145,7 @@ KisColorSelector::Configuration KisColorSelector::configuration() const
void KisColorSelector::updateSettings()
{
KisColorSelectorBase::updateSettings();
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
setConfiguration(Configuration::fromString(cfg.readEntry("colorSelectorConfiguration", KisColorSelector::Configuration().toString())));
}
......
......@@ -432,7 +432,7 @@ void KisColorSelectorBase::updateSettings()
m_popup->updateSettings();
}
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
int zoomSelectorOptions = (int) cfg.readEntry("zoomSelectorOptions", 0) ;
......
......@@ -122,7 +122,7 @@ void KisColorSelectorContainer::setCanvas(KisCanvas2* canvas)
void KisColorSelectorContainer::updateSettings()
{
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
m_onDockerResizeSetting = (int)cfg.readEntry("onDockerResize", 0);
QString type = cfg.readEntry("shadeSelectorType", "MyPaint");
......
......@@ -151,7 +151,7 @@ void KisColorSelectorNgDockerWidget::openSettings()
void KisColorSelectorNgDockerWidget::updateLayout()
{
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
//color patches
......
......@@ -163,8 +163,8 @@ KIcon KisColorSelectorSettings::icon()
void KisColorSelectorSettings::savePreferences() const
{
// write cfg
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup hsxcfg = KGlobal::config()->group("hsxColorSlider");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
KConfigGroup hsxcfg = KSharedConfig::openConfig()->group("hsxColorSlider");
// advanced color selector
cfg.writeEntry("onDockerResize", ui->dockerResizeOptionsComboBox->currentIndex());
......@@ -385,8 +385,8 @@ void KisColorSelectorSettings::loadPreferences()
//read cfg
//don't forget to also add a new entry to the default preferences
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup hsxcfg = KGlobal::config()->group("hsxColorSlider");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
KConfigGroup hsxcfg = KSharedConfig::openConfig()->group("hsxColorSlider");
// Advanced color selector
......
......@@ -123,7 +123,7 @@ void KisColorSelectorSimple::setColor(const KoColor &color)
qreal hslH, hslS, hslL;
qreal hsiH, hsiS, hsiI;
qreal hsyH, hsyS, hsyY;
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
R = cfg.readEntry("lumaR", 0.2126);
G = cfg.readEntry("lumaG", 0.7152);
B = cfg.readEntry("lumaB", 0.0722);
......
......@@ -97,7 +97,7 @@ void KisColorSelectorWheel::setColor(const KoColor &color)
qreal hslH, hslS, hslL;
qreal hsiH, hsiS, hsiI;
qreal hsyH, hsyS, hsyY;
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
R = cfg.readEntry("lumaR", 0.2126);
G = cfg.readEntry("lumaG", 0.7152);
B = cfg.readEntry("lumaB", 0.0722);
......
......@@ -63,7 +63,7 @@ void KisCommonColors::setCanvas(KisCanvas2 *canvas)
{
KisColorPatches::setCanvas(canvas);
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
if (cfg.readEntry("commonColorsAutoUpdate", false)) {
if (m_image) {
m_image->disconnect(this);
......@@ -94,7 +94,7 @@ void KisCommonColors::updateSettings()
if(!(m_canvas && m_canvas->image()))
return;
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
if(cfg.readEntry("commonColorsAutoUpdate", false)) {
connect(m_canvas->image(), SIGNAL(sigImageUpdated(const QRect &)),
&m_recalculationTimer, SLOT(start()), Qt::UniqueConnection);
......
......@@ -77,7 +77,7 @@ void KisMinimalShadeSelector::setColor(const KoColor& color)
void KisMinimalShadeSelector::updateSettings()
{
KisColorSelectorBase::updateSettings();
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
QString stri = cfg.readEntry("minimalShadeSelectorLineConfig", "0|0.2|0|0");
QStringList strili = stri.split(';', QString::SkipEmptyParts);
......@@ -156,7 +156,7 @@ void KisMinimalShadeSelector::canvasResourceChanged(int key, const QVariant &v)
if(m_colorUpdateAllowed==false)
return;
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
bool onForeground = cfg.readEntry("shadeSelectorUpdateOnForeground", false);
bool onBackground = cfg.readEntry("shadeSelectorUpdateOnBackground", true);
......
......@@ -82,7 +82,7 @@ void KisMyPaintShadeSelector::paintEvent(QPaintEvent *) {
m_realPixelCache->clear();
m_realCircleBorder->clear();
}
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
QString shadeMyPaintType=cfg.readEntry("shadeMyPaintType", "HSV");
int size = qMin(width(), height());
......@@ -232,7 +232,7 @@ void KisMyPaintShadeSelector::mouseReleaseEvent(QMouseEvent *e)
Acs::ColorRole role = Acs::buttonToRole(e->button());
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
bool onRightClick = cfg.readEntry("shadeSelectorUpdateOnRightClick", false);
bool onLeftClick = cfg.readEntry("shadeSelectorUpdateOnLeftClick", false);
......@@ -255,7 +255,7 @@ KisColorSelectorBase* KisMyPaintShadeSelector::createPopup() const
void KisMyPaintShadeSelector::setColor(const KoColor &color) {
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
QString shadeMyPaintType=cfg.readEntry("shadeMyPaintType", "HSV");
R = cfg.readEntry("lumaR", 0.2126);
......@@ -277,7 +277,7 @@ void KisMyPaintShadeSelector::canvasResourceChanged(int key, const QVariant &v)
if(m_colorUpdateAllowed==false)
return;
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
bool onForeground = cfg.readEntry("shadeSelectorUpdateOnForeground", false);
bool onBackground = cfg.readEntry("shadeSelectorUpdateOnBackground", true);
......
......@@ -82,7 +82,7 @@ void KisShadeSelectorLine::setColor(const KoColor &color)
void KisShadeSelectorLine::updateSettings()
{
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
m_gradient = cfg.readEntry("minimalShadeSelectorAsGradient", false);
m_patchCount = cfg.readEntry("minimalShadeSelectorPatchCount", 10);
......@@ -214,7 +214,7 @@ void KisShadeSelectorLine::mouseReleaseEvent(QMouseEvent * e)
Acs::ColorRole role = Acs::buttonToRole(e->button());
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
bool onRightClick = cfg.readEntry("shadeSelectorUpdateOnRightClick", false);
bool onLeftClick = cfg.readEntry("shadeSelectorUpdateOnLeftClick", false);
......
......@@ -55,7 +55,7 @@ void KisShadeSelectorLinesSettings::fromString(const QString &stri)
void KisShadeSelectorLinesSettings::updateSettings()
{
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
fromString(cfg.readEntry("minimalShadeSelectorLineConfig", "0|0.2|0|0"));
for(int i=0; i<m_lineList.size(); i++) {
......
......@@ -77,7 +77,7 @@ void ColorSliderDock::setCanvas(KoCanvasBase * canvas)
//settings//
QBitArray m_SlidersConfigArray(12);
KConfigGroup cfg = KGlobal::config()->group("hsxColorSlider");
KConfigGroup cfg = KSharedConfig::openConfig()->group("hsxColorSlider");
m_SlidersConfigArray[0] =cfg.readEntry("hsvH", false);
m_SlidersConfigArray[1] =cfg.readEntry("hsvS", false);
......
......@@ -115,7 +115,7 @@ void KisHSXColorSliderInput::setValue(double v)
qreal h=0.0;
qreal s=0.0;
qreal l=0.0;
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
R = cfg.readEntry("lumaR", 0.2126);
G = cfg.readEntry("lumaG", 0.7152);
B = cfg.readEntry("lumaB", 0.0722);
......
......@@ -143,7 +143,7 @@ KisColorSliderWidget::KisColorSliderWidget(KoColorDisplayRendererInterface *disp
KisColorSliderWidget::~KisColorSliderWidget()
{
//KConfigGroup cfg = KGlobal::config()->group("");
//KConfigGroup cfg = KSharedConfig::openConfig()->group("");
//cfg.writeEntry("SpecificColorSelector/ShowColorSpaceSelector", m_chkShowColorSpaceSelector->isChecked());
}
......@@ -444,7 +444,7 @@ void KisColorSliderWidget::setConfig()
QBitArray m_SlidersConfigArray(12);
//dbgKrita<<"check";
KConfigGroup cfg = KGlobal::config()->group("hsxColorSlider");
KConfigGroup cfg = KSharedConfig::openConfig()->group("hsxColorSlider");
m_SlidersConfigArray[0] =cfg.readEntry("hsvH", false);
m_SlidersConfigArray[1] =cfg.readEntry("hsvS", false);
......
......@@ -61,7 +61,7 @@ KisSpecificColorSelectorWidget::KisSpecificColorSelectorWidget(QWidget* parent)
m_chkShowColorSpaceSelector = new QCheckBox(i18n("Show Colorspace Selector"), this);
connect(m_chkShowColorSpaceSelector, SIGNAL(toggled(bool)), m_colorspaceSelector, SLOT(setVisible(bool)));
KConfigGroup cfg = KGlobal::config()->group("");
KConfigGroup cfg = KSharedConfig::openConfig()->group("");
m_chkShowColorSpaceSelector->setChecked(cfg.readEntry("SpecificColorSelector/ShowColorSpaceSelector", true));
m_colorspaceSelector->setVisible(m_chkShowColorSpaceSelector->isChecked());
......@@ -74,7 +74,7 @@ KisSpecificColorSelectorWidget::KisSpecificColorSelectorWidget(QWidget* parent)
KisSpecificColorSelectorWidget::~KisSpecificColorSelectorWidget()
{
KConfigGroup cfg = KGlobal::config()->group("");
KConfigGroup cfg = KSharedConfig::openConfig()->group("");
cfg.writeEntry("SpecificColorSelector/ShowColorSpaceSelector", m_chkShowColorSpaceSelector->isChecked());
}
......
......@@ -84,7 +84,7 @@ void KisToolBrush::activate(ToolActivation activation, const QSet<KoShape*> &sha
KisToolFreehand::activate(activation, shapes);
connect(&m_signalMapper, SIGNAL(mapped(int)), SLOT(slotSetSmoothingType(int)), Qt::UniqueConnection);
m_configGroup = KGlobal::config()->group(toolId());
m_configGroup = KSharedConfig::openConfig()->group(toolId());
}
......
......@@ -98,7 +98,7 @@ void KisToolColorPicker::Configuration::save(ToolActivation activation) const
props.setProperty("sampleMerged", sampleMerged);
props.setProperty("radius", radius);
KConfigGroup config = KGlobal::config()->group(CONFIG_GROUP_NAME);
KConfigGroup config = KSharedConfig::openConfig()->group(CONFIG_GROUP_NAME);
config.writeEntry(getConfigKey(activation), props.toXML());
}
......@@ -107,7 +107,7 @@ void KisToolColorPicker::Configuration::load(ToolActivation activation)
{
KisPropertiesConfiguration props;
KConfigGroup config = KGlobal::config()->group(CONFIG_GROUP_NAME);
KConfigGroup config = KSharedConfig::openConfig()->group(CONFIG_GROUP_NAME);
props.fromXML(config.readEntry(getConfigKey(activation)));
toForegroundColor = props.getBool("toForegroundColor", true);
......
......@@ -84,7 +84,7 @@ void KisToolFill::resetCursorStyle()
void KisToolFill::activate(ToolActivation toolActivation, const QSet<KoShape*> &shapes)
{
KisToolPaint::activate(toolActivation, shapes);
m_configGroup = KGlobal::config()->group(toolId());
m_configGroup = KSharedConfig::openConfig()->group(toolId());
}
......
......@@ -88,7 +88,7 @@ void KisToolGradient::resetCursorStyle()
void KisToolGradient::activate(ToolActivation toolActivation, const QSet<KoShape*> &shapes)
{
KisToolPaint::activate(toolActivation, shapes);
m_configGroup = KGlobal::config()->group(toolId());
m_configGroup = KSharedConfig::openConfig()->group(toolId());
}
void KisToolGradient::paint(QPainter &painter, const KoViewConverter &converter)
......
......@@ -94,7 +94,7 @@ void KisToolLine::resetCursorStyle()
void KisToolLine::activate(ToolActivation activation, const QSet<KoShape*> &shapes)
{
KisToolPaint::activate(activation, shapes);
configGroup = KGlobal::config()->group(toolId());
configGroup = KSharedConfig::openConfig()->group(toolId());
}
void KisToolLine::deactivate()
......
......@@ -62,7 +62,7 @@ void KisToolMove::resetCursorStyle()
void KisToolMove::activate(ToolActivation toolActivation, const QSet<KoShape*> &shapes)
{
KisTool::activate(toolActivation, shapes);
configGroup = KGlobal::config()->group(toolId());
configGroup = KSharedConfig::openConfig()->group(toolId());
}
......
......@@ -73,7 +73,7 @@ KisToolSelectContiguous::~KisToolSelectContiguous()
void KisToolSelectContiguous::activate(ToolActivation toolActivation, const QSet<KoShape*> &shapes)
{
KisTool::activate(toolActivation, shapes);
m_configGroup = KGlobal::config()->group(toolId());
m_configGroup = KSharedConfig::openConfig()->group(toolId());
}
void KisToolSelectContiguous::beginPrimaryAction(KoPointerEvent *event)
......
......@@ -86,7 +86,7 @@ KisToolSelectSimilar::KisToolSelectSimilar(KoCanvasBase * canvas)
void KisToolSelectSimilar::activate(ToolActivation toolActivation, const QSet<KoShape*> &shapes)
{
KisTool::activate(toolActivation, shapes);
m_configGroup = KGlobal::config()->group(toolId());
m_configGroup = KSharedConfig::openConfig()->group(toolId());
}
void KisToolSelectSimilar::beginPrimaryAction(KoPointerEvent *event)
......
......@@ -131,7 +131,7 @@ void KisToolCrop::activate(ToolActivation toolActivation, const QSet<KoShape*> &
{
KisTool::activate(toolActivation, shapes);
configGroup = KGlobal::config()->group(toolId()); // save settings to kritarc
configGroup = KSharedConfig::openConfig()->group(toolId()); // save settings to kritarc
KisResourcesSnapshotSP resources =
new KisResourcesSnapshot(image(), currentNode(), 0, this->canvas()->resourceManager());
......
......@@ -78,7 +78,7 @@ void KisToolDyna::resetCursorStyle()
void KisToolDyna::activate(ToolActivation toolActivation, const QSet<KoShape*> &shapes)
{
KisToolPaint::activate(toolActivation, shapes);
m_configGroup = KGlobal::config()->group(toolId());
m_configGroup = KSharedConfig::openConfig()->group(toolId());
}
void KisToolDyna::initStroke(KoPointerEvent *event)
......
......@@ -145,7 +145,7 @@ QList<QPointer<QWidget> > KisToolText::createOptionWidgets()
connect(m_optionsWidget->cmbStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(styleIndexChanged(int)));
connect(m_optionsWidget->m_buttonGroup, SIGNAL(buttonPressed(int)), this, SLOT(textTypeIndexChanged(int)));
m_configGroup = KGlobal::config()->group(toolId());
m_configGroup = KSharedConfig::openConfig()->group(toolId());
return widgets;
}
......
......@@ -73,7 +73,7 @@ QString liquifyModeString(KisLiquifyProperties::LiquifyMode mode)
void KisLiquifyProperties::saveMode() const
{
KConfigGroup cfg =
KGlobal::config()->group(liquifyModeString(m_mode));
KSharedConfig::openConfig()->group(liquifyModeString(m_mode));
cfg.writeEntry("size", m_size);
cfg.writeEntry("amount", m_amount);
......@@ -84,14 +84,14 @@ void KisLiquifyProperties::saveMode() const
cfg.writeEntry("useWashMode", m_useWashMode);
cfg.writeEntry("flow", m_flow);
KConfigGroup globalCfg = KGlobal::config()->group("LiquifyTool");
KConfigGroup globalCfg = KSharedConfig::openConfig()->group("LiquifyTool");
globalCfg.writeEntry("mode", (int)m_mode);
}
void KisLiquifyProperties::loadMode()
{
KConfigGroup cfg =
KGlobal::config()->group(liquifyModeString(m_mode));
KSharedConfig::openConfig()->group(liquifyModeString(m_mode));
m_size = cfg.readEntry("size", m_size);
m_amount = cfg.readEntry("amount", m_amount);
......@@ -105,7 +105,7 @@ void KisLiquifyProperties::loadMode()
void KisLiquifyProperties::loadAndResetMode()
{
KConfigGroup globalCfg = KGlobal::config()->group("LiquifyTool");
KConfigGroup globalCfg = KSharedConfig::openConfig()->group("LiquifyTool");
m_mode = (LiquifyMode) globalCfg.readEntry("mode", (int)m_mode);
loadMode();
......
......@@ -52,7 +52,7 @@ ToolTransformArgs::ToolTransformArgs()
m_keepAspectRatio = false;
m_defaultPoints = true;
KConfigGroup configGroup = KGlobal::config()->group("KisToolTransform");
KConfigGroup configGroup = KSharedConfig::openConfig()->group("KisToolTransform");
QString savedFilterId = configGroup.readEntry("filterId", "Bicubic");
setFilterId(savedFilterId);
......@@ -63,7 +63,7 @@ void ToolTransformArgs::setFilterId(const QString &id) {
m_filter = KisFilterStrategyRegistry::instance()->value(id);
if (m_filter) {
KConfigGroup configGroup = KGlobal::config()->group("KisToolTransform");
KConfigGroup configGroup = KSharedConfig::openConfig()->group("KisToolTransform");
configGroup.writeEntry("filterId", id);
}
}
......
......@@ -111,7 +111,7 @@ public:
~ResetStarting() {
if (m_splash) {
KConfigGroup cfg(KGlobal::config(), "SplashScreen");
KConfigGroup cfg( KSharedConfig::openConfig(), "SplashScreen");
bool hideSplash = cfg.readEntry("HideSplashAfterStartup", false);
if (hideSplash) {
......@@ -289,7 +289,7 @@ void KisApplication::clearConfig()
{
KIS_ASSERT_RECOVER_RETURN(qApp->thread() == QThread::currentThread());
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
// find user settings file
bool createDir = false;
......
......@@ -561,7 +561,7 @@ KisDocument::KisDocument()
d->pageLayout.rightMargin = 0;
KConfigGroup cfgGrp(KGlobal::config(), "Undo");
KConfigGroup cfgGrp( KSharedConfig::openConfig(), "Undo");
d->undoStack->setUndoLimit(cfgGrp.readEntry("UndoLimit", 1000));
connect(d->undoStack, SIGNAL(indexChanged(int)), this, SLOT(slotUndoStackIndexChanged(int)));
......
......@@ -63,7 +63,7 @@ public:
, isDragging(false)
#endif
{
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup group = config->group("DocumentSectionView");
mode = (DisplayMode) group.readEntry("DocumentSectionViewMode", (int)DetailedMode);
}
......@@ -103,7 +103,7 @@ void KisDocumentSectionView::setDisplayMode(DisplayMode mode)
{
if (d->mode != mode) {
d->mode = mode;
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
KConfigGroup group = config->group("DocumentSectionView");
group.writeEntry("DocumentSectionViewMode", (int)mode);
scheduleDelayedItemsLayout();
......
......@@ -478,12 +478,12 @@ KisMainWindow::~KisMainWindow()
// }
KConfigGroup cfg(KGlobal::config(), "MainWindow");
KConfigGroup cfg( KSharedConfig::openConfig(), "MainWindow");
cfg.writeEntry("ko_geometry", saveGeometry().toBase64());
cfg.writeEntry("ko_windowstate", saveState().toBase64());
{
KConfigGroup group(KGlobal::config(), "theme");
KConfigGroup group( KSharedConfig::openConfig(), "theme");
group.writeEntry("Theme", d->themeManager->currentThemeName());
}
......@@ -574,7 +574,7 @@ void KisMainWindow::slotPreferences()
void KisMainWindow::slotThemeChanged()
{
// save theme changes instantly
KConfigGroup group(KGlobal::config(), "theme");
KConfigGroup group( KSharedConfig::openConfig(), "theme");
group.writeEntry("Theme", d->themeManager->currentThemeName());
// reload action icons!
......@@ -630,7 +630,7 @@ void KisMainWindow::addRecentURL(const QUrl &url)
void KisMainWindow::saveRecentFiles()
{
// Save list of recent files
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
d->recentFiles->saveEntries(config->group("RecentFiles"));
config->sync();
......@@ -642,7 +642,7 @@ void KisMainWindow::saveRecentFiles()
void KisMainWindow::reloadRecentFileList()
{
d->recentFiles->loadEntries(KGlobal::config()->group("RecentFiles"));
d->recentFiles->loadEntries( KSharedConfig::openConfig()->group("RecentFiles"));
}
void KisMainWindow::updateCaption()
......@@ -1100,7 +1100,7 @@ void KisMainWindow::closeEvent(QCloseEvent *e)
void KisMainWindow::saveWindowSettings()
{
KSharedConfigPtr config = KGlobal::config();
KSharedConfigPtr config = KSharedConfig::openConfig();
if (d->windowSizeDirty ) {
dbgUI << "KisMainWindow::saveWindowSettings";
......@@ -1113,7 +1113,7 @@ void KisMainWindow::saveWindowSettings()
if (!d->activeView || d->activeView->document()) {
// Save toolbar position into the config file of the app, under the doc's component name
KConfigGroup group = KGlobal::config()->group("krita");
KConfigGroup group = KSharedConfig::openConfig()->group("krita");
saveMainWindowSettings(group);
// Save collapsable state of dock widgets
......@@ -1129,7 +1129,7 @@ void KisMainWindow::saveWindowSettings()
}
KGlobal::config()->sync();
KSharedConfig::openConfig()->sync();
resetAutoSaveSettings(); // Don't let KMainWindow override the good stuff we wrote down
}
......@@ -1381,7 +1381,7 @@ KisPrintJob* KisMainWindow::exportToPdf(KoPageLayout pageLayout, QString pdfFile
return 0;
if (pdfFileName.isEmpty()) {
KConfigGroup group = KGlobal::config()->group("File Dialogs");
KConfigGroup group = KSharedConfig::openConfig()->group("File Dialogs");
QString defaultDir = group.readEntry("SavePdfDialog");
if (defaultDir.isEmpty())
defaultDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
......@@ -1463,7 +1463,7 @@ void KisMainWindow::slotConfigureKeys()
void KisMainWindow::slotConfigureToolbars()
{
KConfigGroup group = KGlobal::config()->group("krita");
KConfigGroup group = KSharedConfig::openConfig()->group("krita");
saveMainWindowSettings(group);
KEditToolBar edit(factory(), this);
connect(&edit, SIGNAL(newToolBarConfig()), this, SLOT(slotNewToolbarConfig()));
......@@ -1473,7 +1473,7 @@ void KisMainWindow::slotConfigureToolbars()
void KisMainWindow::slotNewToolbarConfig()
{
applyMainWindowSettings(KGlobal::config()->group("krita"));
applyMainWindowSettings( KSharedConfig::openConfig()->group("krita"));
KXMLGUIFactory *factory = guiFactory();
Q_UNUSED(factory);
......@@ -1500,7 +1500,7 @@ void KisMainWindow::slotToolbarToggled(bool toggle)
}
if (d->activeView && d->activeView->document()) {
KConfigGroup group = KGlobal::config()->group("krita");
KConfigGroup group = KSharedConfig::openConfig()->group("krita");
saveMainWindowSettings(group);
}
} else
......@@ -1675,7 +1675,7 @@ QDockWidget* KisMainWindow::createDockWidget(KoDockFactoryBase* factory)
visible = false;
}
KConfigGroup group = KGlobal::config()->group("krita").group("DockWidget " + factory->id());
KConfigGroup group = KSharedConfig::openConfig()->group("krita").group("DockWidget " + factory->id());
side = static_cast<Qt::DockWidgetArea>(group.readEntry("DockArea", static_cast<int>(side)));
if (side == Qt::NoDockWidgetArea) side = Qt::RightDockWidgetArea;
......@@ -1686,7 +1686,7 @@ QDockWidget* KisMainWindow::createDockWidget(KoDockFactoryBase* factory)
bool collapsed = factory->defaultCollapsed();
bool locked = false;
group = KGlobal::config()->group("krita").group("DockWidget " + factory->id());
group = KSharedConfig::openConfig()->group("krita").group("DockWidget " + factory->id());
collapsed = group.readEntry("Collapsed", collapsed);
locked = group.readEntry("Locked", locked);
......@@ -1702,7 +1702,7 @@ QDockWidget* KisMainWindow::createDockWidget(KoDockFactoryBase* factory)
dockWidget = d->dockWidgetsMap[factory->id()];
}
KConfigGroup group(KGlobal::config(), "GUI");
KConfigGroup group( KSharedConfig::openConfig(), "GUI");
QFont dockWidgetFont = KGlobalSettings::generalFont();
qreal pointSize = group.readEntry("palettefontsize", dockWidgetFont.pointSize() * 0.75);
dockWidgetFont.setPointSizeF(qMax(pointSize, KGlobalSettings::smallestReadableFont().pointSizeF()));
......@@ -1720,7 +1720,7 @@ void KisMainWindow::forceDockTabFonts()
{
foreach(QObject *child, children()) {
if (child->inherits("QTabBar")) {
KConfigGroup group(KGlobal::config(), "GUI");
KConfigGroup group( KSharedConfig::openConfig(), "GUI");
QFont dockWidgetFont = KGlobalSettings::generalFont();
qreal pointSize = group.readEntry("palettefontsize", dockWidgetFont.pointSize() * 0.75);
dockWidgetFont.setPointSizeF(qMax(pointSize, KGlobalSettings::smallestReadableFont().pointSizeF()));
......@@ -1893,7 +1893,7 @@ void KisMainWindow::configChanged()
subwin->setOption(QMdiSubWindow::RubberBandResize, cfg.readEntry<int>("mdi_rubberband", cfg.useOpenGL()));
}
KConfigGroup group(KGlobal::config(), "theme");
KConfigGroup group( KSharedConfig::openConfig(), "theme");
d->themeManager->setCurrentTheme(group.readEntry("Theme", "Krita dark"));
d->viewManager->actionManager()->updateGUI();
......@@ -1976,7 +1976,7 @@ QPointer<KisView>KisMainWindow::activeKisView()