Commit 5d361cf0 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Resources: Remove KoResourceLoaderThread

All resources were loaded synchronously by now, so KoResourceLoaderThread
was obsolete. This also moved the bundle server to it's own singleton,
since it needs a completely instantiated singleton of KisResourceServerProvider.

KisApplication now instantiates the singletons in the correct order, without
superfluously getting the actual resource providers. Since the order is now
properly known, we can clear the empty krita 3 system preset tags from the
tag database after loading the last bundles. However, the tag system seems
to be case-insensitive, but we used to have both ink and Ink; that still
needs fixing.

This fixes item 2 from

CCBUG:391576

Curiously enough, this also makes Krita start quite a bit faster for me...
parent 81d05bbf
......@@ -122,12 +122,8 @@ private:
KisBrushServer::KisBrushServer()
{
m_brushServer = new BrushResourceServer();
if (!QFileInfo(m_brushServer->saveLocation()).exists()) {
QDir().mkpath(m_brushServer->saveLocation());
}
m_brushThread = new KoResourceLoaderThread(m_brushServer);
m_brushThread->loadSynchronously();
// m_brushThread->barrier();
m_brushServer->loadResources(KoResourceServerProvider::blacklistFileNames(m_brushServer->fileNames(), m_brushServer->blackListedFiles()));
Q_FOREACH (KisBrushSP brush, m_brushServer->resources()) {
if (!dynamic_cast<KisAbrBrush*>(brush.data())) {
brush->setBrushTipImage(QImage());
......@@ -137,8 +133,6 @@ KisBrushServer::KisBrushServer()
KisBrushServer::~KisBrushServer()
{
dbgRegistry << "deleting KisBrushServer";
delete m_brushThread;
delete m_brushServer;
}
......@@ -147,10 +141,8 @@ KisBrushServer* KisBrushServer::instance()
return s_instance;
}
KisBrushResourceServer* KisBrushServer::brushServer(bool block)
KisBrushResourceServer* KisBrushServer::brushServer()
{
if (block) m_brushThread->barrier();
return m_brushServer;
}
......
......@@ -28,8 +28,6 @@
#include "kritabrush_export.h"
#include "kis_brush.h"
class KoResourceLoaderThread;
typedef KoResourceServer<KisBrush, SharedPointerStoragePolicy<KisBrushSP> > KisBrushResourceServer;
typedef KoResourceServerAdapter<KisBrush, SharedPointerStoragePolicy<KisBrushSP> > KisBrushResourceServerAdapter;
......@@ -44,7 +42,7 @@ class BRUSH_EXPORT KisBrushServer : public QObject
public:
KisBrushServer();
~KisBrushServer() override;
KisBrushResourceServer* brushServer(bool block = true);
KisBrushResourceServer* brushServer();
static KisBrushServer* instance();
......@@ -53,14 +51,10 @@ public Q_SLOTS:
private:
KisBrushServer(const KisBrushServer&);
KisBrushServer operator=(const KisBrushServer&);
KisBrushResourceServer* m_brushServer;
private:
KoResourceLoaderThread *m_brushThread;
};
#endif
......@@ -45,7 +45,7 @@
#include <kis_filter_configuration.h>
#include <kis_properties_configuration.h>
#include <kis_config.h>
#include <kis_resource_server_provider.h>
#include <KisResourceServerProvider.h>
#include <kis_workspace_resource.h>
#include <brushengine/kis_paintop_preset.h>
#include <kis_brush_server.h>
......
......@@ -24,7 +24,7 @@
#include <ksharedconfig.h>
#include <kconfiggroup.h>
#include <kis_paintop_preset.h>
#include "kis_resource_server_provider.h"
#include "KisResourceServerProvider.h"
#include "Theme.h"
#include "PropertyContainer.h"
......
......@@ -21,7 +21,7 @@
#include <resources/KoColorSet.h>
#include <KoResourceServerAdapter.h>
#include <KoResourceServerProvider.h>
#include <kis_resource_server_provider.h>
#include <KisResourceServerProvider.h>
class PaletteModel::Private {
public:
......
......@@ -19,7 +19,7 @@
#include "PresetImageProvider.h"
#include <KoResourceServerAdapter.h>
#include <kis_resource_server_provider.h>
#include <KisResourceServerProvider.h>
#include <brushengine/kis_paintop_preset.h>
class PresetImageProvider::Private {
......
......@@ -19,7 +19,7 @@
#include "PresetModel.h"
#include <KoResourceServerAdapter.h>
#include <kis_resource_server_provider.h>
#include <KisResourceServerProvider.h>
#include <KisViewManager.h>
#include <kis_canvas_resource_provider.h>
#include <kis_canvas2.h>
......
......@@ -134,7 +134,8 @@ set(kritaui_LIB_SRCS
kis_popup_palette.cpp
kis_png_converter.cpp
kis_preference_set_registry.cpp
kis_resource_server_provider.cpp
KisResourceServerProvider.cpp
KisResourceBundleServerProvider.cpp
KisSelectedShapesProxy.cpp
kis_selection_decoration.cc
kis_selection_manager.cc
......
......@@ -84,7 +84,7 @@
#include <kis_debug.h>
#include "kis_action_registry.h"
#include <kis_brush_server.h>
#include <kis_resource_server_provider.h>
#include <KisResourceServerProvider.h>
#include <KoResourceServerProvider.h>
#include "kis_image_barrier_locker.h"
#include "opengl/kis_opengl.h"
......@@ -273,6 +273,7 @@ void KisApplication::addResourceTypes()
d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/tags/");
d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/asl/");
d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/bundles/");
d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/brushes/");
d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/gradients/");
d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/paintoppresets/");
d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/palettes/");
......@@ -293,37 +294,21 @@ void KisApplication::addResourceTypes()
void KisApplication::loadResources()
{
setSplashScreenLoadingText(i18n("Loading Gradients..."));
setSplashScreenLoadingText(i18n("Loading Resources..."));
processEvents();
KoResourceServerProvider::instance()->gradientServer(true);
// Load base resources
setSplashScreenLoadingText(i18n("Loading Patterns..."));
processEvents();
KoResourceServerProvider::instance()->patternServer(true);
setSplashScreenLoadingText(i18n("Loading Palettes..."));
processEvents();
KoResourceServerProvider::instance()->paletteServer(false);
KoResourceServerProvider::instance();
setSplashScreenLoadingText(i18n("Loading Brushes..."));
processEvents();
KisBrushServer::instance()->brushServer(true);
// load paintop presets
setSplashScreenLoadingText(i18n("Loading Paint Operations..."));
processEvents();
KisResourceServerProvider::instance()->paintOpPresetServer(true);
KisBrushServer::instance()->brushServer();
// load symbols
setSplashScreenLoadingText(i18n("Loading SVG Symbol Collections..."));
setSplashScreenLoadingText(i18n("Loading Brush Presets..."));
processEvents();
KoResourceServerProvider::instance()->svgSymbolCollectionServer(true);
KisResourceServerProvider::instance();
setSplashScreenLoadingText(i18n("Loading Resource Bundles..."));
setSplashScreenLoadingText(i18n("Loading Bundles..."));
processEvents();
KisResourceServerProvider::instance()->resourceBundleServer();
KisResourceBundleServerProvider::instance();
}
void KisApplication::loadPlugins()
......
......@@ -34,7 +34,7 @@
#include <resources/KoColorSet.h>
#include <resources/KoPattern.h>
#include "kis_resource_server_provider.h"
#include "KisResourceServerProvider.h"
#include "KisViewManager.h"
#include <QGridLayout>
#include <QLabel>
......@@ -81,13 +81,13 @@ void ColorSetDelegate::paint(QPainter * painter, const QStyleOptionViewItem & op
QRect rect(option.rect.x() + i*size, option.rect.y() + option.rect.height() - size, size, size);
painter->fillRect(rect, colorSet->getColorGlobal(i).color.toQColor());
}
painter->restore();
}
KisColorsetChooser::KisColorsetChooser(QWidget* parent): QWidget(parent)
{
KoResourceServer<KoColorSet> * rserver = KoResourceServerProvider::instance()->paletteServer(false);
KoResourceServer<KoColorSet> * rserver = KoResourceServerProvider::instance()->paletteServer();
QSharedPointer<KoAbstractResourceServerAdapter> adapter(new KoResourceServerAdapter<KoColorSet>(rserver));
m_itemChooser = new KoResourceItemChooser(adapter, this);
m_itemChooser->setItemDelegate(new ColorSetDelegate(this));
......@@ -102,7 +102,7 @@ KisColorsetChooser::KisColorsetChooser(QWidget* parent): QWidget(parent)
m_itemChooser->configureKineticScrolling(cfg.kineticScrollingGesture(),
cfg.kineticScrollingSensitivity(),
cfg.kineticScrollingScrollbar());
QPushButton* saveButton = new QPushButton(i18n("Save"));
connect(saveButton, SIGNAL(clicked(bool)), this, SLOT(slotSave()));
......
......@@ -103,7 +103,7 @@
#include "kis_statusbar.h"
#include "widgets/kis_progress_widget.h"
#include "kis_canvas_resource_provider.h"
#include "kis_resource_server_provider.h"
#include "KisResourceServerProvider.h"
#include "kis_node_manager.h"
#include "KisPart.h"
#include "KisApplication.h"
......
......@@ -133,7 +133,7 @@
#include "kis_paintop_box.h"
#include "KisPart.h"
#include "KisPrintJob.h"
#include "kis_resource_server_provider.h"
#include "KisResourceServerProvider.h"
#include "kis_signal_compressor_with_param.h"
#include "kis_statusbar.h"
#include "KisView.h"
......@@ -277,7 +277,7 @@ KisMainWindow::KisMainWindow()
: KXmlGuiWindow()
, d(new Private(this))
{
auto rserver = KisResourceServerProvider::instance()->workspaceServer(false);
auto rserver = KisResourceServerProvider::instance()->workspaceServer();
QSharedPointer<KoAbstractResourceServerAdapter> adapter(new KoResourceServerAdapter<KisWorkspaceResource>(rserver));
d->workspacemodel = new KoResourceModel(adapter, this);
connect(d->workspacemodel, &KoResourceModel::afterResourcesLayoutReset, this, [&]() { updateWindowMenu(); });
......@@ -2034,7 +2034,7 @@ void KisMainWindow::updateWindowMenu()
QMenu *workspaceMenu = d->workspaceMenu->menu();
workspaceMenu->clear();
auto workspaces = KisResourceServerProvider::instance()->workspaceServer(false)->resources();
auto workspaces = KisResourceServerProvider::instance()->workspaceServer()->resources();
auto m_this = this;
for (auto &w : workspaces) {
auto action = workspaceMenu->addAction(w->name());
......
......@@ -62,7 +62,7 @@
#include "KisDocument.h"
#include "kis_config.h"
#include "kis_shape_controller.h"
#include "kis_resource_server_provider.h"
#include "KisResourceServerProvider.h"
#include "kis_animation_cache_populator.h"
#include "kis_idle_watcher.h"
#include "kis_image.h"
......
......@@ -40,7 +40,7 @@
#include <resources/KoHashGeneratorProvider.h>
#include <resources/KoHashGenerator.h>
#include <kis_resource_server_provider.h>
#include <KisResourceServerProvider.h>
#include <kis_workspace_resource.h>
#include <brushengine/kis_paintop_preset.h>
#include <kis_brush_server.h>
......
......@@ -30,7 +30,7 @@
#include <resources/KoAbstractGradient.h>
#include "kis_brush_server.h"
#include "kis_resource_server_provider.h"
#include "KisResourceServerProvider.h"
#include <brushengine/kis_paintop_preset.h>
#include "kis_workspace_resource.h"
......
/*
* kis_resourceserver.cc - part of KImageShop
*
* Copyright (c) 1999 Matthias Elter <elter@kde.org>
* Copyright (c) 2003 Patrick Julien <freak@codepimps.org>
* Copyright (c) 2005 Sven Langkamp <sven.langkamp@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "KisResourceBundleServerProvider.h"
#include "KisResourceServerProvider.h"
#include <QDir>
#include <QApplication>
#include <QGlobalStatic>
#include <kis_debug.h>
#include <KoResourcePaths.h>
#include <resources/KoResource.h>
#include <KoResourceServer.h>
#include <KoResourceServerProvider.h>
#include <KoResourceServerAdapter.h>
#include <kis_debug.h>
Q_GLOBAL_STATIC(KisResourceBundleServerProvider, s_instance)
KisResourceBundleServerProvider::KisResourceBundleServerProvider()
{
m_resourceBundleServer = new KoResourceServerSimpleConstruction<KisResourceBundle>("kis_resourcebundles", "*.bundle");
m_resourceBundleServer->loadResources(KoResourceServerProvider::blacklistFileNames(m_resourceBundleServer->fileNames(), m_resourceBundleServer->blackListedFiles()));
Q_FOREACH (KisResourceBundle *bundle, m_resourceBundleServer->resources()) {
if (!bundle->install()) {
warnKrita << "Could not install resources for bundle" << bundle->name();
}
}
KisResourceServerProvider::instance()->paintOpPresetServer()->clearOldSystemTags();
}
KisResourceBundleServerProvider::~KisResourceBundleServerProvider()
{
delete m_resourceBundleServer;
}
KisResourceBundleServerProvider* KisResourceBundleServerProvider::instance()
{
return s_instance;
}
KoResourceServer<KisResourceBundle> *KisResourceBundleServerProvider::resourceBundleServer()
{
return m_resourceBundleServer;
}
/*
* kis_resource_server_provider.h - part of KImageShop
*
* Copyright (c) 1999 Matthias Elter <elter@kde.org>
* Copyright (c) 2003 Patrick Julien <freak@codepimps.org>
* Copyright (c) 2005 Sven Langkamp <sven.langkamp@gmail.com>
* Copyright (c) 2003-2008 Boudewijn Rempt <boud@valdyas.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KIS_RESOURCEBUNDLESERVERPROVIDER_H_
#define KIS_RESOURCEBUNDLESERVERPROVIDER_H_
#include <KoResourceServer.h>
#include <KoResourceServerAdapter.h>
#include <brushengine/kis_paintop_preset.h>
#include "KisResourceBundle.h"
#include "kritaui_export.h"
class KRITAUI_EXPORT KisResourceBundleServerProvider : public QObject
{
Q_OBJECT
public:
KisResourceBundleServerProvider();
~KisResourceBundleServerProvider() override;
static KisResourceBundleServerProvider* instance();
KoResourceServer<KisResourceBundle> *resourceBundleServer();
private:
KisResourceBundleServerProvider(const KisResourceBundleServerProvider&);
KisResourceBundleServerProvider operator=(const KisResourceBundleServerProvider&);
KoResourceServer<KisResourceBundle> *m_resourceBundleServer;
};
#endif // KIS_RESOURCESERVERPROVIDER_H_
......@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "kis_resource_server_provider.h"
#include "KisResourceServerProvider.h"
#include <QDir>
#include <QApplication>
......@@ -45,52 +45,21 @@
Q_GLOBAL_STATIC(KisResourceServerProvider, s_instance)
typedef KoResourceServerSimpleConstruction<KisPaintOpPreset, SharedPointerStoragePolicy<KisPaintOpPresetSP> > KisPaintOpPresetResourceServer;
typedef KoResourceServerAdapter<KisPaintOpPreset, SharedPointerStoragePolicy<KisPaintOpPresetSP> > KisPaintOpPresetResourceServerAdapter;
inline bool isRunningInKrita() {
return qApp->applicationName().contains(QLatin1String("krita"), Qt::CaseInsensitive);
}
KisResourceServerProvider::KisResourceServerProvider()
: m_resourceBundleServer(0)
{
KisBrushServer *brushServer = KisBrushServer::instance();
m_paintOpPresetServer = new KisPaintOpPresetResourceServer("kis_paintoppresets", "*.kpp");
if (!QFileInfo(m_paintOpPresetServer->saveLocation()).exists()) {
QDir().mkpath(m_paintOpPresetServer->saveLocation());
}
m_paintOpPresetThread = new KoResourceLoaderThread(m_paintOpPresetServer);
m_paintOpPresetThread->loadSynchronously();
// if (!isRunningInKrita()) {
// m_paintOpPresetThread->barrier();
// }
m_paintOpPresetServer->loadResources(KoResourceServerProvider::blacklistFileNames(m_paintOpPresetServer->fileNames(), m_paintOpPresetServer->blackListedFiles()));
m_workspaceServer = new KoResourceServerSimpleConstruction<KisWorkspaceResource>("kis_workspaces", "*.kws");
if (!QFileInfo(m_workspaceServer->saveLocation()).exists()) {
QDir().mkpath(m_workspaceServer->saveLocation());
}
m_workspaceThread = new KoResourceLoaderThread(m_workspaceServer);
m_workspaceThread->loadSynchronously();
// if (!isRunningInKrita()) {
// m_workspaceThread->barrier();
// }
m_workspaceServer->loadResources(KoResourceServerProvider::blacklistFileNames(m_workspaceServer->fileNames(), m_workspaceServer->blackListedFiles()));
m_layerStyleCollectionServer = new KoResourceServerSimpleConstruction<KisPSDLayerStyleCollectionResource>("psd_layer_style_collections", "*.asl");
if (!QFileInfo(m_layerStyleCollectionServer->saveLocation()).exists()) {
QDir().mkpath(m_layerStyleCollectionServer->saveLocation());
}
m_layerStyleCollectionThread = new KoResourceLoaderThread(m_layerStyleCollectionServer);
m_layerStyleCollectionThread->loadSynchronously();
// if (!isRunningInKrita()) {
// m_layerStyleCollectionThread->barrier();
// }
m_layerStyleCollectionServer->loadResources(KoResourceServerProvider::blacklistFileNames(m_layerStyleCollectionServer->fileNames(), m_layerStyleCollectionServer->blackListedFiles()));
connect(this, SIGNAL(notifyBrushBlacklistCleanup()),
brushServer, SLOT(slotRemoveBlacklistedResources()));
......@@ -99,10 +68,6 @@ KisResourceServerProvider::KisResourceServerProvider()
KisResourceServerProvider::~KisResourceServerProvider()
{
delete m_paintOpPresetThread;
delete m_workspaceThread;
delete m_layerStyleCollectionThread;
delete m_paintOpPresetServer;
delete m_workspaceServer;
delete m_layerStyleCollectionServer;
......@@ -113,41 +78,19 @@ KisResourceServerProvider* KisResourceServerProvider::instance()
return s_instance;
}
KoResourceServer<KisResourceBundle> *KisResourceServerProvider::resourceBundleServer()
{
if (!m_resourceBundleServer) {
m_resourceBundleServer = new KoResourceServerSimpleConstruction<KisResourceBundle>("kis_resourcebundles", "*.bundle");
KoResourceLoaderThread bundleLoader(m_resourceBundleServer);
bundleLoader.loadSynchronously();
Q_FOREACH (KisResourceBundle *bundle, m_resourceBundleServer->resources()) {
if (!bundle->install()) {
warnKrita << "Could not install resources for bundle" << bundle->name();
}
}
}
return m_resourceBundleServer;
}
KisPaintOpPresetResourceServer* KisResourceServerProvider::paintOpPresetServer(bool block)
KisPaintOpPresetResourceServer* KisResourceServerProvider::paintOpPresetServer()
{
if (block) m_paintOpPresetThread->barrier();
return m_paintOpPresetServer;
}
KoResourceServer< KisWorkspaceResource >* KisResourceServerProvider::workspaceServer(bool block)
KoResourceServer< KisWorkspaceResource >* KisResourceServerProvider::workspaceServer()
{
if (block) m_workspaceThread->barrier();
return m_workspaceServer;
}
KoResourceServer<KisPSDLayerStyleCollectionResource> *KisResourceServerProvider::layerStyleCollectionServer(bool block)
KoResourceServer<KisPSDLayerStyleCollectionResource> *KisResourceServerProvider::layerStyleCollectionServer()
{
if (block) m_layerStyleCollectionThread->barrier();
return m_layerStyleCollectionServer;
}
......@@ -155,4 +98,3 @@ void KisResourceServerProvider::brushBlacklistCleanup()
{
emit notifyBrushBlacklistCleanup();
}
......@@ -25,13 +25,12 @@
#include <KoResourceServer.h>
#include <KoResourceServerAdapter.h>
#include <KisResourceBundleServerProvider.h>
#include <brushengine/kis_paintop_preset.h>
#include "KisResourceBundle.h"
#include "kritaui_export.h"
class KoResourceLoaderThread;
class KisWorkspaceResource;
class KisPSDLayerStyleCollectionResource;
......@@ -48,10 +47,9 @@ public:
static KisResourceServerProvider* instance();
KoResourceServer<KisResourceBundle> *resourceBundleServer();
KisPaintOpPresetResourceServer* paintOpPresetServer(bool block = true);
KoResourceServer<KisWorkspaceResource>* workspaceServer(bool block = true);
KoResourceServer<KisPSDLayerStyleCollectionResource>* layerStyleCollectionServer(bool block = true);
KisPaintOpPresetResourceServer* paintOpPresetServer();
KoResourceServer<KisWorkspaceResource>* workspaceServer();
KoResourceServer<KisPSDLayerStyleCollectionResource>* layerStyleCollectionServer();
void brushBlacklistCleanup();
......@@ -66,14 +64,6 @@ private:
KisPaintOpPresetResourceServer *m_paintOpPresetServer;
KoResourceServer<KisWorkspaceResource> *m_workspaceServer;
KoResourceServer<KisPSDLayerStyleCollectionResource> *m_layerStyleCollectionServer;
KoResourceServer<KisResourceBundle> *m_resourceBundleServer;
private:
KoResourceLoaderThread *m_paintOpPresetThread;
KoResourceLoaderThread *m_workspaceThread;
KoResourceLoaderThread *m_layerStyleCollectionThread;
};
#endif // KIS_RESOURCESERVERPROVIDER_H_
......@@ -112,7 +112,7 @@
#include "KisPart.h"
#include "KisPrintJob.h"
#include <KoUpdater.h>
#include "kis_resource_server_provider.h"
#include "KisResourceServerProvider.h"
#include "kis_selection.h"
#include "kis_selection_manager.h"
#include "kis_shape_controller.h"
......
......@@ -18,7 +18,7 @@
*/
#include "kis_dlg_blacklist_cleanup.h"
#include <kis_resource_server_provider.h>
#include <KisResourceServerProvider.h>
#include <kis_icon.h>
#include <KoResourceServerProvider.h>
......
......@@ -104,7 +104,7 @@ KisDlgInternalColorSelector::KisDlgInternalColorSelector(QWidget *parent, KoColo
//TODO: Add disable signal as well. Might be not necessary...?
KisConfig cfg;
QString paletteName = cfg.readEntry("internal_selector_active_color_set", QString());
KoResourceServer<KoColorSet>* rServer = KoResourceServerProvider::instance()->paletteServer(false);
KoResourceServer<KoColorSet>* rServer = KoResourceServerProvider::instance()->paletteServer();
KoColorSet *savedPal = rServer->resourceByName(paletteName);
if (savedPal) {
this->slotChangePalette(savedPal);
......
......@@ -37,7 +37,7 @@
#include "kis_config.h"
#include "kis_cmb_contour.h"
#include "kis_cmb_gradient.h"
#include "kis_resource_server_provider.h"
#include "KisResourceServerProvider.h"
#include "kis_psd_layer_style_resource.h"
#include "kis_psd_layer_style.h"
......
......@@ -49,7 +49,7 @@
#include <kis_image.h>
#include <resources/KoPattern.h>
#include "kis_resource_server_provider.h"
#include "KisResourceServerProvider.h"
#include "kis_canvas_resource_provider.h"
#include "widgets/kis_iconwidget.h"
......@@ -86,7 +86,7 @@ KisControlFrame::KisControlFrame(KisViewManager *view, QWidget *parent, const ch
m_gradientWidget->setToolTip(i18n("Gradients"));
m_gradientWidget->setFixedSize(32, 32);
KoResourceServer<KoAbstractGradient> * rserver = KoResourceServerProvider::instance()->gradientServer(false);
KoResourceServer<KoAbstractGradient> * rserver = KoResourceServerProvider::instance()->gradientServer();
QSharedPointer<KoAbstractResourceServerAdapter> adapter (new KoResourceServerAdapter<KoAbstractGradient>(rserver));
m_gradientWidget->setResourceAdapter(adapter);
}
......
......@@ -40,7 +40,7 @@
#include "kis_painter.h"
#include <kis_debug.h>
#include "kis_resource_server_provider.h"
#include "KisResourceServerProvider.h"
#include "kis_paint_layer.h"
KisCustomPattern::KisCustomPattern(QWidget *parent, const char* name, const QString& caption, KisViewManager* view)
......@@ -53,7 +53,7 @@ KisCustomPattern::KisCustomPattern(QWidget *parent, const char* name, const QStr
preview->setScaledContents(true);
KoResourceServer<KoPattern>* rServer = KoResourceServerProvider::instance()->patternServer(false);
KoResourceServer<KoPattern>* rServer = KoResourceServerProvider::instance()->patternServer();
m_rServerAdapter = QSharedPointer<KoAbstractResourceServerAdapter>(new KoResourceServerAdapter<KoPattern>(rServer));
connect(addButton, SIGNAL(pressed()), this, SLOT(slotAddPredefined()));
......
......@@ -30,7 +30,7 @@
#include "kis_popup_palette.h"
#include "kis_paintop_box.h"
#include "KisViewManager.h"
#include "kis_resource_server_provider.h"
#include "KisResourceServerProvider.h"
#include "kis_min_heap.h"
#include "kis_config.h"
#include "kis_config_notifier.h"
......@@ -171,7 +171,7 @@ KisFavoriteResourceManager::KisFavoriteResourceManager(KisPaintopBox *paintopBox
m_maxPresets = cfg.favoritePresets();
m_colorList = new ColorDataList();
connect(KisConfigNotifier::instance(), SIGNAL(configChanged()), SLOT(configChanged()));
KisPaintOpPresetResourceServer * rServer = KisResourceServerProvider::instance()->paintOpPresetServer(false);
KisPaintOpPresetResourceServer * rServer = KisResourceServerProvider::instance()->paintOpPresetServer();
rServer->addObserver(this);
}
......@@ -323,7 +323,7 @@ void KisFavoriteResourceManager::updateFavoritePresets()
{
m_favoritePresetsList.clear();
KisPaintOpPresetResourceServer* rServer = KisResourceServerProvider::instance()->paintOpPresetServer(false);
KisPaintOpPresetResourceServer* rServer = KisResourceServerProvider::instance()->paintOpPresetServer();
QStringList presetFilenames = rServer->searchTag(m_currentTag);
for(int i = 0; i < qMin(m_maxPresets, presetFilenames.size()); i++) {
KisPaintOpPresetSP pr = rServer->resourceByFilename(presetFilenames.at(i));
......@@ -344,7 +344,7 @@ void KisFavoriteResourceManager::init()
{
if (!m_initialized) {
m_initialized = true;
KisResourceServerProvider::instance()->paintOpPresetServer(true);
KisResourceServerProvider::instance()->paintOpPresetServer();
m_currentTag = KisConfig().readEntry<QString>("favoritePresetsTag", "★ My Favorites");
updateFavoritePresets();
......
......@@ -65,7 +65,7 @@
#include "kis_node_manager.h"
#include "KisViewManager.h"
#include "kis_canvas_resource_provider.h"
#include "kis_resource_server_provider.h"
#include "KisResourceServerProvider.h"
#include "kis_favorite_resource_manager.h"
#include "kis_config.h"
......@@ -483,7 +483,7 @@ KisPaintopBox::KisPaintopBox(KisViewManager *view, QWidget *parent, const char *
slotInputDeviceChanged(KoToolManager::instance()->currentInputDevice());
KisPaintOpPresetResourceServer *rserver = KisResourceServerProvider::instance()->paintOpPresetServer(false);
KisPaintOpPresetResourceServer *rserver = KisResourceServerProvider::instance()->paintOpPresetServer();
m_eraserName = "eraser_circle";
m_defaultPresetName = "basic_tip_default";
bool foundEraser = false;
......@@ -774,7 +774,7 @@ void KisPaintopBox::slotInputDeviceChanged(const KoInputDevice& inputDevice)
</