Commit a207bec3 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Make the readonly parameter for Kis(Image)Config explicit

This also adds a safe assert that fires whenever we create a
read/write KisConfig object in a non-gui thread.
parent 6b376b33
......@@ -47,7 +47,7 @@ void removeTempFiles(const QString &filesMask)
void runRenderingTest(KisImageSP image, int numCores, int numClones)
{
{
KisImageConfig cfg;
KisImageConfig cfg(false);
cfg.setMaxNumberOfThreads(numCores);
cfg.setFrameRenderingClones(numClones);
}
......
......@@ -89,7 +89,7 @@ void KisLowMemoryBenchmark::benchmarkWideArea(const QString presetFileName,
/**
* Reset configuration to the desired settings
*/
KisImageConfig config;
KisImageConfig config(false);
qreal oldHardLimit = config.memoryHardLimitPercent();
qreal oldSoftLimit = config.memorySoftLimitPercent();
qreal oldPoolLimit = config.memoryPoolLimitPercent();
......
......@@ -335,7 +335,7 @@ extern "C" int main(int argc, char **argv)
}
#if defined Q_OS_WIN
KisConfig cfg;
KisConfig cfg(false);
bool supportedWindowsVersion = true;
#if QT_VERSION >= 0x050900
QOperatingSystemVersion osVersion = QOperatingSystemVersion::current();
......
......@@ -145,7 +145,7 @@ public:
, axesCenter(QPointF(0.5, 0.5))
{
{
KisImageConfig cfg;
KisImageConfig cfg(true);
if (cfg.enableProgressReporting()) {
scheduler.setProgressProxy(&compositeProgressProxy);
}
......@@ -1283,7 +1283,7 @@ KisStrokeId KisImage::startStroke(KisStrokeStrategy *strokeStrategy)
void KisImage::KisImagePrivate::notifyProjectionUpdatedInPatches(const QRect &rc)
{
KisImageConfig imageConfig;
KisImageConfig imageConfig(true);
int patchWidth = imageConfig.updatePatchWidth();
int patchHeight = imageConfig.updatePatchHeight();
......
......@@ -43,6 +43,9 @@ KisImageConfig::KisImageConfig(bool readOnly)
: m_config(KSharedConfig::openConfig()->group(QString()))
, m_readOnly(readOnly)
{
if (!readOnly) {
KIS_SAFE_ASSERT_RECOVER_RETURN(qApp->thread() == QThread::currentThread());
}
#ifdef Q_OS_OSX
// clear /var/folders/ swap path set by old broken Krita swap implementation in order to use new default swap dir.
QString swap = m_config.readEntry("swaplocation", "");
......
......@@ -27,7 +27,7 @@
class KRITAIMAGE_EXPORT KisImageConfig
{
public:
KisImageConfig(bool readOnly = false);
KisImageConfig(bool readOnly);
~KisImageConfig();
bool enableProgressReporting(bool requestDefault = false) const;
......
......@@ -50,8 +50,7 @@ struct KisKeyframe::Private
KisKeyframe::KisKeyframe(KisKeyframeChannel *channel, int time)
: m_d(new Private(channel, time))
{
KisImageConfig config;
m_d->colorLabel = config.defaultFrameColorLabel();
m_d->colorLabel = KisImageConfig(true).defaultFrameColorLabel();
}
KisKeyframe::KisKeyframe(const KisKeyframe *rhs, KisKeyframeChannel *channel)
......
......@@ -157,7 +157,7 @@ KisMemoryStatisticsServer::fetchMemoryStatistics(KisImageSP image) const
stats.swapSize = tileStats.swapSize;
KisImageConfig cfg;
KisImageConfig cfg(true);
stats.tilesHardLimit = cfg.tilesHardLimit() * MiB;
stats.tilesSoftLimit = cfg.tilesSoftLimit() * MiB;
......
......@@ -87,7 +87,7 @@ struct KisOnionSkinCompositor::Private
void refreshConfig()
{
KisImageConfig config;
KisImageConfig config(true);
numberOfSkins = config.numberOfOnionSkins();
tintFactor = config.onionSkinTintFactor();
......
......@@ -72,7 +72,7 @@ void KisSimpleUpdateQueue::updateSettings()
{
QMutexLocker locker(&m_lock);
KisImageConfig config;
KisImageConfig config(true);
m_patchWidth = config.updatePatchWidth();
m_patchHeight = config.updatePatchHeight();
......
......@@ -108,9 +108,7 @@ KisTransformMask::KisTransformMask()
connect(&m_d->updateSignalCompressor, SIGNAL(timeout()), SLOT(slotDelayedStaticUpdate()));
connect(this, SIGNAL(sigInternalForceStaticImageUpdate()), SLOT(slotInternalForceStaticImageUpdate()));
KisImageConfig cfg;
m_d->offBoundsReadArea = cfg.transformMaskOffBoundsReadArea();
m_d->offBoundsReadArea = KisImageConfig(true).transformMaskOffBoundsReadArea();
}
KisTransformMask::~KisTransformMask()
......
......@@ -50,7 +50,7 @@
struct Q_DECL_HIDDEN KisUpdateScheduler::Private {
Private(KisUpdateScheduler *_q, KisProjectionUpdateListener *p)
: q(_q)
, updaterContext(KisImageConfig().maxNumberOfThreads(), q)
, updaterContext(KisImageConfig(true).maxNumberOfThreads(), q)
, projectionUpdateListener(p)
{}
......@@ -314,10 +314,8 @@ KisPostExecutionUndoAdapter *KisUpdateScheduler::lodNPostExecutionUndoAdapter()
void KisUpdateScheduler::updateSettings()
{
m_d->updatesQueue.updateSettings();
KisImageConfig config;
KisImageConfig config(true);
m_d->defaultBalancingRatio = config.schedulerBalancingRatio();
setThreadsLimit(config.maxNumberOfThreads());
}
......
......@@ -45,7 +45,7 @@ namespace KritaUtils
QSize optimalPatchSize()
{
KisImageConfig cfg;
KisImageConfig cfg(true);
return QSize(cfg.updatePatchWidth(),
cfg.updatePatchHeight());
}
......
......@@ -275,7 +275,7 @@ void KisColorizeStrokeStrategy::cancelStrokeCallback()
KisStrokeStrategy* KisColorizeStrokeStrategy::createLodClone(int levelOfDetail)
{
KisImageConfig cfg;
KisImageConfig cfg(true);
if (!cfg.useLodForColorizeMask()) return 0;
KisColorizeStrokeStrategy *clone = new KisColorizeStrokeStrategy(*this, levelOfDetail);
......
......@@ -30,7 +30,7 @@
void KisOnionSkinCompositorTest::testComposite()
{
KisImageConfig config;
KisImageConfig config(false);
config.setOnionSkinTintFactor(64);
config.setOnionSkinTintColorBackward(Qt::blue);
config.setOnionSkinTintColorForward(Qt::red);
......@@ -139,7 +139,7 @@ void KisOnionSkinCompositorTest::testSettings()
i->switchCurrentTimeAsync(1);
p.image->waitForDone();
KisImageConfig config;
KisImageConfig config(false);
config.setOnionSkinOpacity(-1, 32);
config.setOnionSkinOpacity(1, 192);
config.setOnionSkinOpacity(2, 64);
......
......@@ -99,8 +99,7 @@ KisTileDataPooler::KisTileDataPooler(KisTileDataStore *store, qint32 memoryLimit
m_memoryLimit = memoryLimit;
}
else {
KisImageConfig config;
m_memoryLimit = MiB_TO_METRIC(config.poolLimit());
m_memoryLimit = MiB_TO_METRIC(KisImageConfig(true).poolLimit());
}
}
......@@ -417,6 +416,5 @@ void KisTileDataPooler::debugTileStatistics()
void KisTileDataPooler::testingRereadConfig()
{
KisImageConfig config;
m_memoryLimit = MiB_TO_METRIC(config.poolLimit());
m_memoryLimit = MiB_TO_METRIC(KisImageConfig(true).poolLimit());
}
......@@ -28,7 +28,7 @@
KisSwappedDataStore::KisSwappedDataStore()
: m_memoryMetric(0)
{
KisImageConfig config;
KisImageConfig config(true);
const quint64 maxSwapSize = config.maxSwapSize() * MiB;
const quint64 swapSlabSize = config.swapSlabSize() * MiB;
const quint64 swapWindowSize = config.swapWindowSize() * MiB;
......
......@@ -60,7 +60,7 @@ class KisStoreLimits
{
public:
KisStoreLimits() {
KisImageConfig config;
KisImageConfig config(true);
m_emergencyThreshold = MiB_TO_METRIC(config.tilesHardLimit());
......
......@@ -31,7 +31,7 @@
void KisLowMemoryTests::initTestCase()
{
// hard limit of 1MiB, no undo in memory, no clones
KisImageConfig config;
KisImageConfig config(false);
config.setMemoryHardLimitPercent(1.1 * 100.0 / KisImageConfig::totalRAM());
config.setMemorySoftLimitPercent(0);
config.setMemoryPoolLimitPercent(0);
......
......@@ -26,7 +26,7 @@
void KisStoreLimitsTest::testLimits()
{
KisImageConfig config;
KisImageConfig config(false);
config.setMemoryHardLimitPercent(50);
config.setMemorySoftLimitPercent(25);
config.setMemoryPoolLimitPercent(10);
......
......@@ -37,7 +37,7 @@ void KisSwappedDataStoreTest::testRoundTrip()
const quint8 defaultPixel = 128;
const qint32 NUM_TILES = 10000;
KisImageConfig config;
KisImageConfig config(false);
config.setMaxSwapSize(4);
config.setSwapSlabSize(1);
config.setSwapWindowSize(1);
......@@ -103,7 +103,7 @@ void KisSwappedDataStoreTest::testRandomAccess()
const qint32 NUM_CYCLES = 50000;
const qint32 NUM_TILES = 10000;
KisImageConfig config;
KisImageConfig config(false);
config.setMaxSwapSize(40);
config.setSwapSlabSize(1);
config.setSwapWindowSize(1);
......
......@@ -144,7 +144,7 @@ void KisTileDataStoreTest::testLeaks()
void KisTileDataStoreTest::testSwapping()
{
KisImageConfig config;
KisImageConfig config(false);
config.setMemoryHardLimitPercent(100.0 / KisImageConfig::totalRAM());
config.setMemorySoftLimitPercent(0);
......
......@@ -132,7 +132,7 @@ void Settings::setThemeID(const QString& /*id*/)
QObject* Settings::customImageSettings() const
{
QObject* settings = new PropertyContainer("customImageSettings", qApp);
KisConfig cfg;
KisConfig cfg(false);
settings->setProperty("Width", cfg.defImageWidth());
settings->setProperty("Height", cfg.defImageHeight());
settings->setProperty("Resolution", qRound(cfg.defImageResolution() * 72)); // otherwise we end up with silly floating point numbers
......@@ -144,7 +144,7 @@ QObject* Settings::customImageSettings() const
QString Settings::lastPreset() const
{
KisConfig cfg;
KisConfig cfg(true);
KisPaintOpPresetResourceServer * rserver = KisResourceServerProvider::instance()->paintOpPresetServer();
QString defaultPresetName = "basic_tip_default";
bool foundTip = false;
......
......@@ -73,7 +73,7 @@ QString ImageBuilder::createImageFromClipboard()
void ImageBuilder::createImageFromClipboardDelayed()
{
DocumentManager::instance()->disconnect(this, SLOT(createImageFromClipboardDelayed()));
KisConfig cfg;
KisConfig cfg(false);
cfg.setPasteBehaviour(PASTE_ASSUME_MONITOR);
QSize sz = KisClipboard::instance()->clipSize();
......
......@@ -380,7 +380,7 @@ void KisApplication::loadGuiPlugins()
bool KisApplication::start(const KisApplicationArguments &args)
{
KisConfig cfg;
KisConfig cfg(false);
#if defined(Q_OS_WIN)
#ifdef ENV32BIT
......
......@@ -236,7 +236,7 @@ public:
, lastMod(firstMod)
, nserver(new KisNameServer(1))
, imageIdleWatcher(2000 /*ms*/)
, globalAssistantsColor(KisConfig().defaultAssistantsColor())
, globalAssistantsColor(KisConfig(true).defaultAssistantsColor())
, savingLock(&savingMutex)
, batchMode(false)
{
......@@ -529,7 +529,7 @@ bool KisDocument::exportDocumentImpl(const KritaUtils::ExportFileJob &job, KisPr
return false;
}
KisConfig cfg;
KisConfig cfg(true);
if (cfg.backupFile() && filePathInfo.exists()) {
KBackup::backupFile(job.filePath);
}
......@@ -863,7 +863,7 @@ void KisDocument::slotCompleteAutoSaving(const KritaUtils::ExportFileJob &job, K
fileName,
exportErrorToUserMessage(status, errorMessage)), errorMessageTimeout);
} else {
KisConfig cfg;
KisConfig cfg(true);
d->autoSaveDelay = cfg.autoSaveInterval();
if (!d->modifiedWhileSaving) {
......@@ -1456,7 +1456,7 @@ void KisDocument::slotUndoStackCleanChanged(bool value)
void KisDocument::slotConfigChanged()
{
KisConfig cfg;
KisConfig cfg(true);
d->undoStack->setUndoLimit(cfg.undoStackLimit());
d->autoSaveDelay = cfg.autoSaveInterval();
setNormalAutoSaveInterval();
......@@ -1604,8 +1604,6 @@ bool KisDocument::newImage(const QString& name,
{
Q_ASSERT(cs);
KisConfig cfg;
KisImageSP image;
KisPaintLayerSP layer;
......@@ -1652,6 +1650,7 @@ bool KisDocument::newImage(const QString& name,
layer->setDirty(QRect(0, 0, width, height));
}
KisConfig cfg(false);
cfg.defImageWidth(width);
cfg.defImageHeight(height);
cfg.defImageResolution(imageResolution);
......
......@@ -186,7 +186,7 @@ KisPropertiesConfigurationSP KisImportExportFilter::defaultConfiguration(const Q
KisPropertiesConfigurationSP KisImportExportFilter::lastSavedConfiguration(const QByteArray &from, const QByteArray &to) const
{
KisPropertiesConfigurationSP cfg = defaultConfiguration(from, to);
const QString filterConfig = KisConfig().exportConfiguration(to);
const QString filterConfig = KisConfig(true).exportConfiguration(to);
if (cfg && !filterConfig.isEmpty()) {
cfg->fromXML(filterConfig, false);
}
......
......@@ -387,7 +387,7 @@ KisImportExportManager::ConversionResult KisImportExportManager::convert(KisImpo
}
if (exportConfiguration) {
KisConfig().setExportConfiguration(typeName, exportConfiguration);
KisConfig(false).setExportConfiguration(typeName, exportConfiguration);
}
}
return result;
......@@ -532,7 +532,7 @@ bool KisImportExportManager::askUserAboutExportConfiguration(
QCheckBox *chkAlsoAsKra = 0;
if (showWarnings && !warnings.isEmpty()) {
chkAlsoAsKra = new QCheckBox(i18n("Also save your image as a Krita file."));
chkAlsoAsKra->setChecked(KisConfig().readEntry<bool>("AlsoSaveAsKra", false));
chkAlsoAsKra->setChecked(KisConfig(true).readEntry<bool>("AlsoSaveAsKra", false));
layout->addWidget(chkAlsoAsKra);
}
......@@ -547,7 +547,7 @@ bool KisImportExportManager::askUserAboutExportConfiguration(
*alsoAsKra = false;
if (chkAlsoAsKra) {
KisConfig().writeEntry<bool>("AlsoSaveAsKra", chkAlsoAsKra->isChecked());
KisConfig(false).writeEntry<bool>("AlsoSaveAsKra", chkAlsoAsKra->isChecked());
*alsoAsKra = chkAlsoAsKra->isChecked();
}
......
......@@ -290,7 +290,6 @@ KisMainWindow::KisMainWindow(QUuid uuid)
d->workspacemodel = new KoResourceModel(adapter, this);
connect(d->workspacemodel, &KoResourceModel::afterResourcesLayoutReset, this, [&]() { updateWindowMenu(); });
KisConfig cfg;
d->viewManager = new KisViewManager(this, actionCollection());
KConfigGroup group( KSharedConfig::openConfig(), "theme");
......@@ -326,6 +325,7 @@ KisMainWindow::KisMainWindow(QUuid uuid)
QDockWidget *toolbox = createDockWidget(&toolBoxFactory);
toolbox->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetClosable);
KisConfig cfg(true);
if (cfg.toolOptionsInDocker()) {
ToolDockerFactory toolDockerFactory;
d->toolOptionsDocker = qobject_cast<KoToolDocker*>(createDockWidget(&toolDockerFactory));
......@@ -579,7 +579,7 @@ void KisMainWindow::showView(KisView *imageView)
subwin->setAttribute(Qt::WA_DeleteOnClose, true);
connect(subwin, SIGNAL(destroyed()), SLOT(updateWindowMenu()));
KisConfig cfg;
KisConfig cfg(true);
subwin->setOption(QMdiSubWindow::RubberBandMove, cfg.readEntry<int>("mdi_rubberband", cfg.useOpenGL()));
subwin->setOption(QMdiSubWindow::RubberBandResize, cfg.readEntry<int>("mdi_rubberband", cfg.useOpenGL()));
subwin->setWindowIcon(qApp->windowIcon());
......@@ -1397,7 +1397,7 @@ void KisMainWindow::slotFileNew()
startupWidget->setWindowTitle(i18n("Create new document"));
KisConfig cfg;
KisConfig cfg(true);
int w = cfg.defImageWidth();
int h = cfg.defImageHeight();
......@@ -1872,7 +1872,7 @@ void KisMainWindow::slotToolbarToggled(bool toggle)
void KisMainWindow::viewFullscreen(bool fullScreen)
{
KisConfig cfg;
KisConfig cfg(false);
cfg.setFullscreenMode(fullScreen);
if (fullScreen) {
......@@ -2240,7 +2240,7 @@ void KisMainWindow::setActiveSubWindow(QWidget *window)
void KisMainWindow::configChanged()
{
KisConfig cfg;
KisConfig cfg(true);
QMdiArea::ViewMode viewMode = (QMdiArea::ViewMode)cfg.readEntry<int>("mdi_viewmode", (int)QMdiArea::TabbedView);
d->mdiArea->setViewMode(viewMode);
Q_FOREACH (QMdiSubWindow *subwin, d->mdiArea->subWindowList()) {
......@@ -2400,7 +2400,6 @@ void KisMainWindow::applyDefaultSettings(QPrinter &printer) {
void KisMainWindow::createActions()
{
KisActionManager *actionManager = d->actionManager();
KisConfig cfg;
actionManager->createStandardAction(KStandardAction::New, this, SLOT(slotFileNew()));
actionManager->createStandardAction(KStandardAction::Open, this, SLOT(slotFileOpen()));
......@@ -2464,7 +2463,7 @@ void KisMainWindow::createActions()
connect(d->themeManager, SIGNAL(signalThemeChanged()), this, SLOT(slotThemeChanged()));
d->toggleDockers = actionManager->createAction("view_toggledockers");
cfg.showDockers(true);
KisConfig(true).showDockers(true);
d->toggleDockers->setChecked(true);
connect(d->toggleDockers, SIGNAL(toggled(bool)), SLOT(toggleDockersVisibility(bool)));
......
......@@ -728,7 +728,7 @@ bool KisNodeDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, cons
}
}
else if (event->type() == QEvent::ToolTip) {
if (!KisConfig().hidePopups()) {
if (!KisConfig(true).hidePopups()) {
QHelpEvent *helpEvent = static_cast<QHelpEvent*>(event);
d->tip.showTip(d->view, helpEvent->pos(), option, index);
}
......@@ -904,7 +904,7 @@ void KisNodeDelegate::drawProgressBar(QPainter *p, const QStyleOptionViewItem &o
void KisNodeDelegate::slotConfigChanged()
{
KisConfig cfg;
KisConfig cfg(true);
d->checkersColor1 = cfg.checkersColor1();
d->checkersColor2 = cfg.checkersColor2();
......
......@@ -234,7 +234,7 @@ KisView *KisPart::createView(KisDocument *document,
QWidget *parent)
{
// If creating the canvas fails, record this and disable OpenGL next time
KisConfig cfg;
KisConfig cfg(false);
KConfigGroup grp( KSharedConfig::openConfig(), "crashprevention");
if (grp.readEntry("CreatingCanvas", false)) {
cfg.setUseOpenGL(false);
......@@ -339,7 +339,7 @@ bool KisPart::closeSession(bool keepWindows)
}
if (d->currentSession) {
KisConfig kisCfg;
KisConfig kisCfg(false);
if (kisCfg.saveSessionOnQuit(false)) {
d->currentSession->storeCurrentWindows();
......
......@@ -72,7 +72,7 @@ void KisPrintJob::startPrinting(RemovePolicy removePolicy)
gc.setClipping(false);
KisConfig cfg;
KisConfig cfg(true);
QString printerProfileName = cfg.printerProfile();
const KoColorProfile *printerProfile = KoColorSpaceRegistry::instance()->profileByName(printerProfileName);
......
......@@ -231,7 +231,7 @@ KisView::KisView(KisDocument *document, KoCanvasResourceManager *resourceManager
d->canvas.setup();
KisConfig cfg;
KisConfig cfg(false);
d->canvasController.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
d->canvasController.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
......@@ -658,7 +658,7 @@ void KisView::slotSavingStatusMessage(const QString &text, int timeout, bool isA
sb->showMessage(text, timeout);
}
KisConfig cfg;
KisConfig cfg(true);
if (!sb || sb->isHidden() ||
(!isAutoSaving && cfg.forceShowSaveMessages()) ||
......
......@@ -268,20 +268,20 @@ KisViewManager::KisViewManager(QWidget *parent, KActionCollection *_actionCollec
// These initialization functions must wait until KisViewManager ctor is complete.
d->statusBar.setup();
d->persistentImageProgressUpdater =
d->statusBar.progressUpdater()->startSubtask(1, "", true);
d->statusBar.progressUpdater()->startSubtask(1, "", true);
// reset state to "completed"
d->persistentImageProgressUpdater->setRange(0,100);
d->persistentImageProgressUpdater->setValue(100);
d->persistentUnthreadedProgressUpdater =
d->statusBar.progressUpdater()->startSubtask(1, "", true);
// reset state to "completed"
d->statusBar.progressUpdater()->startSubtask(1, "", true);
// reset state to "completed"
d->persistentUnthreadedProgressUpdater->setRange(0,100);
d->persistentUnthreadedProgressUpdater->setValue(100);
d->persistentUnthreadedProgressUpdaterRouter.reset(
new KoProgressUpdater(d->persistentUnthreadedProgressUpdater,
KoProgressUpdater::Unthreaded));
new KoProgressUpdater(d->persistentUnthreadedProgressUpdater,
KoProgressUpdater::Unthreaded));
d->persistentUnthreadedProgressUpdaterRouter->setAutoNestNames(true);
d->controlFrame.setup(parent);
......@@ -315,7 +315,7 @@ KisViewManager::KisViewManager(QWidget *parent, KActionCollection *_actionCollec
KisInputProfileManager::instance()->loadProfiles();
KisConfig cfg;
KisConfig cfg(true);
d->showFloatingMessage = cfg.showCanvasMessages();
const KoColorSpace *cs = KoColorSpaceRegistry::instance()->rgb8();
KoColor foreground(Qt::black, cs);
......@@ -330,7 +330,7 @@ KisViewManager::KisViewManager(QWidget *parent, KActionCollection *_actionCollec
KisViewManager::~KisViewManager()
{
KisConfig cfg;
KisConfig cfg(false);
if (resourceProvider() && resourceProvider()->currentPreset()) {
cfg.writeEntry("LastPreset", resourceProvider()->currentPreset()->name());
cfg.writeKoColor("LastForeGroundColor",resourceProvider()->fgColor());
......@@ -415,7 +415,6 @@ void KisViewManager::setCurrentView(KisView *view)
// Restore the last used brush preset, color and background color.
if (first) {
KisConfig cfg;
KisPaintOpPresetResourceServer * rserver = KisResourceServerProvider::instance()->paintOpPresetServer();
QString defaultPresetName = "basic_tip_default";
bool foundTip = false;
......@@ -430,6 +429,7 @@ void KisViewManager::setCurrentView(KisView *view)
foundTip = true;
}
}
KisConfig cfg(true);
QString lastPreset = cfg.readEntry("LastPreset", defaultPresetName);
KisPaintOpPresetSP preset = rserver->resourceByName(lastPreset);
if (!preset) {
......@@ -497,21 +497,21 @@ void KisViewManager::setCurrentView(KisView *view)
d->currentImageView->canvasController()->setFocus();
d->viewConnections.addUniqueConnection(
image(), SIGNAL(sigSizeChanged(const QPointF&, const QPointF&)),
resourceProvider(), SLOT(slotImageSizeChanged()));
image(), SIGNAL(sigSizeChanged(const QPointF&, const QPointF&)),