Commit 984af18b authored by Boudewijn Rempt's avatar Boudewijn Rempt

Port Krita to use KoResourcePaths

parent 02f6e3e8
......@@ -23,7 +23,7 @@
#include <klocalizedstring.h>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include <calligraversion.h>
#include <calligragitversion.h>
......@@ -98,11 +98,11 @@ void doRestart(MainWindow* mainWindow, bool resetConfig)
configDir.remove("kritarc");
}
{
QDir inputDir(KGlobal::dirs()->saveLocation("data", "krita/input/"));
QDir inputDir(KoResourcePaths::saveLocation("data", "krita/input/"));
foreach(QString entry, inputDir.entryList(QStringList("*.profile"))) {
inputDir.remove(entry);
}
QDir configDir(KGlobal::dirs()->saveLocation("config"));
QDir configDir(KoResourcePaths::saveLocation("config"));
configDir.remove("kritarc");
}
}
......@@ -224,7 +224,7 @@ MainWindow::MainWindow(const QString &dumpPath, const QString &id, QWidget *pare
setupUi(this);
progressBar->hide();
lblKiki->setPixmap(QPixmap(KGlobal::dirs()->findResource("data", "krita/pics/KikiNurse_sm.png")));
lblKiki->setPixmap(QPixmap(KoResourcePaths::findResource("data", "krita/pics/KikiNurse_sm.png")));
setWindowFlags(Qt::WindowStaysOnTopHint | windowFlags());
......@@ -321,7 +321,7 @@ void MainWindow::startUpload()
#endif
QFile f(QDesktopServices::storageLocation(QDesktopServices::TempLocation) + "/krita-opengl.txt");
dbgKrita << KGlobal::dirs()->saveLocation("config") + "/krita-opengl.txt" << f.exists();
dbgKrita << KoResourcePaths::saveLocation("config") + "/krita-opengl.txt" << f.exists();
if (f.exists()) {
f.open(QFile::ReadOnly);
......
......@@ -39,7 +39,7 @@
#include <QDesktopServices>
#include <QUrl>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include <kactioncollection.h>
#include <QMessageBox>
#include <kmenubar.h>
......@@ -168,8 +168,8 @@ public:
sketchView->engine()->addImportPath(appdir.canonicalPath() + "/lib64/calligra/imports");
QString mainqml = appdir.canonicalPath() + "/share/apps/kritagemini/kritagemini.qml";
#else
sketchView->engine()->addImportPath(KGlobal::dirs()->findDirs("lib", "calligra/imports").value(0));
QString mainqml = KGlobal::dirs()->findResource("data", "kritagemini/kritagemini.qml");
sketchView->engine()->addImportPath(KoResourcePaths::findDirs("lib", "calligra/imports").value(0));
QString mainqml = KoResourcePaths::findResource("data", "kritagemini/kritagemini.qml");
#endif
Q_ASSERT(QFile::exists(mainqml));
......
......@@ -31,7 +31,7 @@
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include <kiconloader.h>
#include "data/splash/splash_screen.xpm"
#include "MainWindow.h"
......
......@@ -304,7 +304,7 @@ set(einspline_SRCS
add_library(kritaimage SHARED ${kritaimage_LIB_SRCS} ${einspline_SRCS})
generate_export_header(kritaimage BASE_NAME kritaimage)
target_link_libraries(kritaimage koversion kritaglobal kritapsd koodf pigmentcms kundo2 kowidgetutils Qt5::Concurrent)
target_link_libraries(kritaimage koversion kowidgets kritaglobal kritapsd koodf pigmentcms kundo2 kowidgetutils Qt5::Concurrent)
target_link_libraries(kritaimage LINK_INTERFACE_LIBRARIES koversion kritaglobal kritapsd koodf pigmentcms kundo2 kowidgetutils Qt5::Concurrent)
target_link_libraries(kritaimage ${Boost_SYSTEM_LIBRARY})
......
......@@ -21,7 +21,7 @@
#include <QString>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include "kis_debug.h"
#include "kis_meta_data_schema_p.h"
......@@ -50,10 +50,10 @@ SchemaRegistry::SchemaRegistry()
: d(new Private)
{
KGlobal::dirs()->addResourceType("metadata_schema", "data", "krita/metadata/schemas/");
KoResourcePaths::addResourceType("metadata_schema", "data", "krita/metadata/schemas/");
QStringList schemasFilenames;
schemasFilenames += KGlobal::dirs()->findAllResources("metadata_schema", "*.schema");
schemasFilenames += KoResourcePaths::findAllResources("metadata_schema", "*.schema");
foreach(const QString& fileName, schemasFilenames) {
Schema* schema = new Schema();
......
......@@ -21,7 +21,7 @@
#include <QApplication>
#include <QGlobalStatic>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include <KoResource.h>
#include <KoResourceServerProvider.h>
......@@ -121,9 +121,9 @@ private:
KisBrushServer::KisBrushServer()
{
KGlobal::dirs()->addResourceType("kis_brushes", "data", "krita/brushes/");
KGlobal::dirs()->addResourceDir("kis_brushes", "/usr/share/create/brushes/gimp");
KGlobal::dirs()->addResourceDir("kis_brushes", QDir::homePath() + QString("/.create/brushes/gimp"));
KoResourcePaths::addResourceType("kis_brushes", "data", "krita/brushes/");
KoResourcePaths::addResourceDir("kis_brushes", "/usr/share/create/brushes/gimp");
KoResourcePaths::addResourceDir("kis_brushes", QDir::homePath() + QString("/.create/brushes/gimp"));
m_brushServer = new BrushResourceServer();
if (!QFileInfo(m_brushServer->saveLocation()).exists()) {
......
......@@ -99,7 +99,7 @@ TasksetDockerDock::TasksetDockerDock( ) : QDockWidget(i18n("Task Sets")), m_canv
chooserButton->setIcon(KisIconUtils::loadIcon("edit-copy"));
KGlobal::dirs()->addResourceType("kis_taskset", "data", "krita/taskset/");
KoResourcePaths::addResourceType("kis_taskset", "data", "krita/taskset/");
m_rserver = new KoResourceServerSimpleConstruction<TasksetResource>("kis_taskset", "*.kts");
if (!QFileInfo(m_rserver->saveLocation()).exists()) {
......
......@@ -27,7 +27,7 @@
#include <QMessageBox>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include <kis_debug.h>
#include <kpluginfactory.h>
#include <QTime>
......@@ -91,8 +91,8 @@ KisGmicPlugin::KisGmicPlugin(QObject *parent, const QVariantList &)
connect(action, SIGNAL(triggered()), this, SLOT(slotShowGmicDialog()));
addAction("gmic", action);
KGlobal::dirs()->addResourceType("gmic_definitions", "data", "krita/gmic/");
m_blacklistPath = KGlobal::dirs()->findResource("gmic_definitions", STANDARD_GMIC_DEFINITION + ".blacklist");
KoResourcePaths::addResourceType("gmic_definitions", "data", "krita/gmic/");
m_blacklistPath = KoResourcePaths::findResource("gmic_definitions", STANDARD_GMIC_DEFINITION + ".blacklist");
dumpCompiletimeFeatures();
......@@ -141,7 +141,7 @@ void KisGmicPlugin::dumpCompiletimeFeatures()
void KisGmicPlugin::setupDefinitionPaths()
{
m_definitionFilePaths = KGlobal::dirs()->findAllResources("gmic_definitions", "*.gmic");
m_definitionFilePaths = KoResourcePaths::findAllResources("gmic_definitions", "*.gmic");
QMutableStringListIterator it(m_definitionFilePaths);
// remove all instances of gmic_def.gmic and updateXXXX.gmic, they cause problems when merged/mixed
......@@ -162,10 +162,10 @@ void KisGmicPlugin::setupDefinitionPaths()
// if we don't have updateXXXX.gmic for current version, prepend standard gmic_def.gmic
int gmicVersion = gmic_version;
QString updateFileName = "update" + QString::number(gmicVersion) + ".gmic";
QString updatedGmicDefinitionFilePath = KGlobal::dirs()->findResource("gmic_definitions", updateFileName);
QString updatedGmicDefinitionFilePath = KoResourcePaths::findResource("gmic_definitions", updateFileName);
if (updatedGmicDefinitionFilePath.isEmpty())
{
QString standardGmicDefinitionFilePath = KGlobal::dirs()->findResource("gmic_definitions", STANDARD_GMIC_DEFINITION);
QString standardGmicDefinitionFilePath = KoResourcePaths::findResource("gmic_definitions", STANDARD_GMIC_DEFINITION);
m_definitionFilePaths.prepend(standardGmicDefinitionFilePath);
}
else
......
......@@ -29,7 +29,7 @@
#include <gmic.h>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
KisGmicUpdater::KisGmicUpdater(const QString &updateurl, QObject *parent): QObject(parent),m_url(updateurl)
{
......@@ -72,7 +72,7 @@ void KisGmicUpdater::finishedDownload(QNetworkReply*reply)
dbgPlugins << "bytes available: " << reply->bytesAvailable();
dbgPlugins << reply->url() << " finished";
QString path = KGlobal::dirs()->saveLocation("gmic_definitions");
QString path = KoResourcePaths::saveLocation("gmic_definitions");
QString fileName = reply->url().path().split("/").last();
QByteArray data = reply->readAll();
......
......@@ -40,7 +40,7 @@
#include <kis_gmic_applicator.h>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include <QDomDocument>
#include <kis_group_layer.h>
......@@ -76,11 +76,11 @@ const static QString BLACKLIST("gmic_def.gmic.blacklist");
void KisGmicTests::initTestCase()
{
KGlobal::dirs()->addResourceType("gmic_definitions", "data", "krita/gmic/");
KoResourcePaths::addResourceType("gmic_definitions", "data", "krita/gmic/");
QString standardSettings("gmic_def.gmic");
QString definitionFilePath = KGlobal::dirs()->findResource("gmic_definitions", STANDARD_SETTINGS);
m_blacklistFilePath = KGlobal::dirs()->findResource("gmic_definitions", STANDARD_SETTINGS + ".blacklist");
QString definitionFilePath = KoResourcePaths::findResource("gmic_definitions", STANDARD_SETTINGS);
m_blacklistFilePath = KoResourcePaths::findResource("gmic_definitions", STANDARD_SETTINGS + ".blacklist");
QStringList filePaths;
filePaths << definitionFilePath;
......@@ -631,7 +631,7 @@ void KisGmicTests::testFilterOnlySelection()
void KisGmicTests::testLoadingGmicCommands()
{
QString definitionFilePath = KGlobal::dirs()->findResource("gmic_definitions", STANDARD_SETTINGS);
QString definitionFilePath = KoResourcePaths::findResource("gmic_definitions", STANDARD_SETTINGS);
QByteArray data = KisGmicParser::extractGmicCommandsOnly(definitionFilePath);
QVERIFY(data.size() > 0);
}
......
......@@ -22,7 +22,7 @@
#include <QFile>
#include <klocalizedstring.h>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include <kis_debug.h>
......@@ -51,7 +51,7 @@ KisMetaDataEditor::KisMetaDataEditor(QWidget* parent, KisMetaData::Store* origin
d->originalStore = originalStore;
d->store = new KisMetaData::Store(*originalStore);
QStringList files = KGlobal::dirs()->findAllResources("data", "kritaplugins/metadataeditor/*.rc");
QStringList files = KoResourcePaths::findAllResources("data", "kritaplugins/metadataeditor/*.rc");
QMap<QString, QWidget*> widgets;
widgets["dublincore.ui"] = new WdgDublinCore(this);
......
......@@ -27,7 +27,7 @@
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include <QScopedPointer>
#include <QProcessEnvironment>
......@@ -288,7 +288,7 @@ bool ResourceBundle::save()
addMeta("updated", QDate::currentDate().toString("dd/MM/yyyy"));
QDir bundleDir = KGlobal::dirs()->saveLocation("data", "krita/bundles");
QDir bundleDir = KoResourcePaths::saveLocation("data", "krita/bundles");
bundleDir.cdUp();
QScopedPointer<KoStore> store(KoStore::createStore(filename(), KoStore::Write, "application/x-krita-resourcebundle", KoStore::Zip));
......
......@@ -29,7 +29,7 @@
#include <QGlobalStatic>
#include <klocalizedstring.h>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include <kpluginfactory.h>
#include <KoFileDialog.h>
......@@ -53,8 +53,8 @@ Q_GLOBAL_STATIC(ResourceBundleServerProvider, s_instance)
ResourceBundleServerProvider::ResourceBundleServerProvider()
{
// user-local
KGlobal::dirs()->addResourceType("kis_resourcebundles", "data", "krita/bundles/");
KGlobal::dirs()->addResourceDir("kis_resourcebundles", QDir::homePath() + QString("/.create/bundles"));
KoResourcePaths::addResourceType("kis_resourcebundles", "data", "krita/bundles/");
KoResourcePaths::addResourceDir("kis_resourcebundles", QDir::homePath() + QString("/.create/bundles"));
m_resourceBundleServer = new KoResourceServerSimpleConstruction<ResourceBundle>("kis_resourcebundles", "*.bundle");
if (!QFileInfo(m_resourceBundleServer->saveLocation()).exists()) {
QDir().mkpath(m_resourceBundleServer->saveLocation());
......
......@@ -27,7 +27,7 @@
#include <QPushButton>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include <kis_debug.h>
#include "kis_image.h"
......@@ -120,7 +120,7 @@ void KisClipboardBrushWidget::slotAddPredefined()
if(!m_brush)
return;
QString dir = KGlobal::dirs()->saveLocation("data", "krita/brushes");
QString dir = KoResourcePaths::saveLocation("data", "krita/brushes");
QString extension = ".gbr";
QString name = nameEdit->text();
......
......@@ -31,7 +31,7 @@
#include <QPixmap>
#include <QShowEvent>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include "kis_image.h"
#include "kis_layer.h"
......@@ -120,7 +120,7 @@ void KisCustomBrushWidget::slotAddPredefined()
{
// Save in the directory that is likely to be: ~/.kde/share/apps/krita/brushes
// a unique file with this brushname
QString dir = KGlobal::dirs()->saveLocation("data", "krita/brushes");
QString dir = KoResourcePaths::saveLocation("data", "krita/brushes");
QString extension;
if (brushStyle->currentIndex() == 0) {
......
......@@ -24,7 +24,7 @@
#include <QPoint>
#include "kis_global.h"
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
KisNormalPreviewWidget::KisNormalPreviewWidget(QWidget *parent)
: QLabel(parent)
......@@ -32,8 +32,8 @@ KisNormalPreviewWidget::KisNormalPreviewWidget(QWidget *parent)
m_redChannel = 0;
m_greenChannel = 2;
m_blueChannel = 4;
//TODO: this can be changed in frameworks to KGlobal::dirs()->findResource("kis_images", "krita-tangetnormal.png");
m_fileName = KGlobal::dirs()->findResource("kis_images", "krita-tangentnormal-preview.png");
//TODO: this can be changed in frameworks to KoResourcePaths::findResource("kis_images", "krita-tangetnormal.png");
m_fileName = KoResourcePaths::findResource("kis_images", "krita-tangentnormal-preview.png");
QImage preview = QImage(m_fileName);
setPixmap(QPixmap::fromImage(preview.scaled(200, 200, Qt::KeepAspectRatio, Qt::SmoothTransformation)));
}
......
......@@ -27,7 +27,7 @@
#include "ui_wdgtangenttiltoption.h"
#include "kis_global.h"
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
class KisTangentTiltOptionWidget: public QWidget, public Ui::WdgTangentTiltOptions
{
......
......@@ -22,7 +22,7 @@
#include <QPainter>
#include <QMatrix4x4>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include "kis_coordinates_converter.h"
#include "tool_transform_args.h"
......@@ -73,7 +73,7 @@ struct KisFreeTransformStrategy::Private
scaleCursors[6] = KisCursor::sizeVerCursor();
scaleCursors[7] = KisCursor::sizeBDiagCursor();
shearCursorPixmap.load(KStandardDirs::locate("data", "calligra/icons/cursor_shear.png"));
shearCursorPixmap.load(KoResourcePaths::locate("data", "calligra/icons/cursor_shear.png"));
}
......
......@@ -35,7 +35,7 @@
#include <QTimer>
#include <QUrl>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include <KoDialog.h>
#include <kis_debug.h>
......@@ -122,8 +122,8 @@ MainWindow::MainWindow(QStringList fileNames, QWidget* parent, Qt::WindowFlags f
view->engine()->addImportPath(appdir.canonicalPath() + "/lib64/calligra/imports");
QString mainqml = appdir.canonicalPath() + "/share/apps/kritasketch/kritasketch.qml";
#else
view->engine()->addImportPath(KGlobal::dirs()->findDirs("lib", "calligra/imports").value(0));
QString mainqml = KGlobal::dirs()->findResource("data", "kritasketch/kritasketch.qml");
view->engine()->addImportPath(KoResourcePaths::findDirs("lib", "calligra/imports").value(0));
QString mainqml = KoResourcePaths::findResource("data", "kritasketch/kritasketch.qml");
#endif
Q_ASSERT(QFile::exists(mainqml));
......
......@@ -21,7 +21,7 @@
#include <QDeclarativeItem>
#include <QSettings>
#include <QCoreApplication>
#include <KStandardDirs>
#include <KoResourcePaths.h>
#include <kis_config.h>
......@@ -47,7 +47,7 @@ PanelConfiguration::~PanelConfiguration()
void PanelConfiguration::componentComplete()
{
QString configFile = KStandardDirs::locate("config", "kritasketchpanelsrc");
QString configFile = KoResourcePaths::locate("config", "kritasketchpanelsrc");
QSettings panelConfig(configFile, QSettings::IniFormat);
int count = panelConfig.beginReadArray("Panels");
......@@ -99,7 +99,7 @@ void PanelConfiguration::restore()
void PanelConfiguration::save()
{
QString configFile = KStandardDirs::locateLocal("config", "kritasketchpanelsrc");
QString configFile = KoResourcePaths::locateLocal("config", "kritasketchpanelsrc");
QSettings panelConfig(configFile, QSettings::IniFormat);
panelConfig.beginWriteArray("Panels");
......
......@@ -28,7 +28,7 @@
#include <kcmdlineargs.h>
#include <kdesktopfile.h>
#include <QMessageBox>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include <kiconloader.h>
#include <kis_debug.h>
#include <kmimetype.h>
......
......@@ -32,7 +32,7 @@
#include <QDeclarativeComponent>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include <QUrl>
#include "QmlGlobalEngine.h"
......@@ -104,7 +104,7 @@ void Theme::setId(const QString& newValue)
{
if(newValue != d->id) {
d->id = newValue;
d->basePath = QUrl(KGlobal::dirs()->findResource("data", QString("kritasketch/themes/%1/theme.qml").arg(d->id))).directory();
d->basePath = QUrl(KoResourcePaths::findResource("data", QString("kritasketch/themes/%1/theme.qml").arg(d->id))).directory();
emit idChanged();
}
}
......@@ -363,7 +363,7 @@ Theme* Theme::load(const QString& id, QObject* parent)
appdir.cdUp();
qml = QString("%1/share/apps/kritasketch/themes/%2/theme.qml").arg(appdir.canonicalPath(), id);
#else
qml = KGlobal::dirs()->findResource("data", QString("kritasketch/themes/%1/theme.qml").arg(id));
qml = KoResourcePaths::findResource("data", QString("kritasketch/themes/%1/theme.qml").arg(id));
#endif
QDeclarativeComponent themeComponent(QmlGlobalEngine::instance()->engine(), parent);
......
......@@ -31,7 +31,7 @@
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include <kiconloader.h>
#include "MainWindow.h"
......
......@@ -447,7 +447,7 @@ QT5_WRAP_CPP(kritaui_HEADERS_MOC KisDocumentSectionPropertyAction_p.h)
add_library(kritaui SHARED ${kritaui_HEADERS_MOC} ${kritaui_LIB_SRCS} )
generate_export_header(kritaui BASE_NAME kritaui)
target_link_libraries(kritaui KF5::GlobalAccel KF5::I18n )
target_link_libraries(kritaui KF5::GlobalAccel KF5::I18n KF5::KDELibs4Support)
if (NOT WIN32)
target_link_libraries(kritaui ${X11_X11_LIB} ${X11_Xinput_LIB})
endif()
......@@ -477,7 +477,7 @@ if(X11_FOUND)
target_link_libraries(kritaui Qt5::X11Extras ${X11_LIBRARIES})
endif()
target_link_libraries(kritaui LINK_INTERFACE_LIBRARIES kritaimage kritalibbrush pigmentcms KF5::I18n ${GL_INTERFACE_LIBRARIES} )
target_link_libraries(kritaui LINK_INTERFACE_LIBRARIES kritaimage kritalibbrush pigmentcms KF5::I18n ${GL_INTERFACE_LIBRARIES} KF5::KDELibs4Support)
set_target_properties(kritaui
PROPERTIES VERSION ${GENERIC_CALLIGRA_LIB_VERSION} SOVERSION ${GENERIC_CALLIGRA_LIB_SOVERSION}
......
......@@ -34,7 +34,7 @@
#include <kcmdlineargs.h>
#include <kdesktopfile.h>
#include <QMessageBox>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include <kiconloader.h>
#include <kis_debug.h>
......@@ -156,12 +156,12 @@ KisApplication::KisApplication(const QString &key, int &argc, char **argv)
KoGlobal::initialize();
// for cursors
KGlobal::dirs()->addResourceType("kis_pics", "data", "krita/pics/");
KoResourcePaths::addResourceType("kis_pics", "data", "krita/pics/");
// for images in the paintop box
KGlobal::dirs()->addResourceType("kis_images", "data", "krita/images/");
KoResourcePaths::addResourceType("kis_images", "data", "krita/images/");
KGlobal::dirs()->addResourceType("icc_profiles", "data", "krita/profiles/");
KoResourcePaths::addResourceType("icc_profiles", "data", "krita/profiles/");
setWindowIcon(KisIconUtils::loadIcon("calligrakrita"));
......@@ -233,9 +233,9 @@ bool KisApplication::createNewDocFromTemplate(const QString &fileName, KisMainWi
QString desktopName(fileName);
const QString templatesResourcePath = KisPart::instance()->templatesResourcePath();
QStringList paths = KGlobal::dirs()->findAllResources("data", templatesResourcePath + "*/" + desktopName);
QStringList paths = KoResourcePaths::findAllResources("data", templatesResourcePath + "*/" + desktopName);
if (paths.isEmpty()) {
paths = KGlobal::dirs()->findAllResources("data", templatesResourcePath + desktopName);
paths = KoResourcePaths::findAllResources("data", templatesResourcePath + desktopName);
}
if (paths.isEmpty()) {
......@@ -283,7 +283,7 @@ void KisApplication::clearConfig()
// find user settings file
bool createDir = false;
QString kritarcPath = KStandardDirs::locateLocal("config", "kritarc", createDir);
QString kritarcPath = KoResourcePaths::locateLocal("config", "kritarc", createDir);
QFile configFile(kritarcPath);
if (configFile.exists()) {
......@@ -343,8 +343,8 @@ bool KisApplication::start(const KisApplicationArguments &args)
QDir appdir(applicationDirPath());
appdir.cdUp();
KGlobal::dirs()->addXdgDataPrefix(appdir.absolutePath() + "/share");
KGlobal::dirs()->addPrefix(appdir.absolutePath());
KoResourcePaths::addXdgDataPrefix(appdir.absolutePath() + "/share");
KoResourcePaths::addPrefix(appdir.absolutePath());
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
// If there's no kdehome, set it and restart the process.
......
......@@ -63,7 +63,7 @@
#include <krecentdocument.h>
#include <krecentfilesaction.h>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include <kstatusbar.h>
#include <QTemporaryFile>
#include <ktoggleaction.h>
......@@ -410,11 +410,11 @@ KisMainWindow::KisMainWindow()
configChanged();
QString doc;
QStringList allFiles = KGlobal::dirs()->findAllResources("data", "krita/krita.rc");
QStringList allFiles = KoResourcePaths::findAllResources("data", "krita/krita.rc");
KIS_ASSERT(allFiles.size() > 0); // We need at least one krita.rc file!
setXMLFile(findMostRecentXMLFile(allFiles, doc));
setLocalXMLFile(KStandardDirs::locateLocal("data", "krita/krita.rc"));
setLocalXMLFile(KoResourcePaths::locateLocal("data", "krita/krita.rc"));
guiFactory()->addClient(this);
......@@ -607,7 +607,7 @@ void KisMainWindow::addRecentURL(const QUrl &url)
bool ok = true;
if (url.isLocalFile()) {
QString path = url.adjusted(QUrl::StripTrailingSlash).toLocalFile();
const QStringList tmpDirs = KGlobal::dirs()->resourceDirs("tmp");
const QStringList tmpDirs = KoResourcePaths::resourceDirs("tmp");
for (QStringList::ConstIterator it = tmpDirs.begin() ; ok && it != tmpDirs.end() ; ++it)
if (path.contains(*it))
ok = false; // it's in the tmp resource
......
......@@ -43,7 +43,7 @@
#include "dialogs/KisShortcutsDialog.h"
#include <kis_debug.h>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include <kxmlguifactory.h>
#include <knotification.h>
#include <KoDialog.h>
......@@ -118,8 +118,8 @@ void KisPart::Private::loadActions()
{
actionCollection = new KActionCollection(part, "krita");
KGlobal::dirs()->addResourceType("kis_actions", "data", "krita/actions/");
QStringList actionDefinitions = KGlobal::dirs()->findAllResources("kis_actions", "*.action", KStandardDirs::Recursive | KStandardDirs::NoDuplicates);
KoResourcePaths::addResourceType("kis_actions", "data", "krita/actions/");
QStringList actionDefinitions = KoResourcePaths::findAllResources("kis_actions", "*.action", KoResourcePaths::Recursive | KoResourcePaths::NoDuplicates);
foreach(const QString &actionDefinition, actionDefinitions) {
QDomDocument doc;
......@@ -531,9 +531,9 @@ void KisPart::showStartUpWidget(KisMainWindow *mainWindow, bool alwaysShow)
QFileInfo fi(url.toLocalFile());
if (!fi.exists()) {
const QString templatesResourcePath = this->templatesResourcePath();
QString desktopfile = KGlobal::dirs()->findResource("data", templatesResourcePath + "*/" + fullTemplateName);
QString desktopfile = KoResourcePaths::findResource("data", templatesResourcePath + "*/" + fullTemplateName);
if (desktopfile.isEmpty()) {
desktopfile = KGlobal::dirs()->findResource("data", templatesResourcePath + fullTemplateName);
desktopfile = KoResourcePaths::findResource("data", templatesResourcePath + fullTemplateName);
}
if (desktopfile.isEmpty()) {
fullTemplateName.clear();
......
......@@ -28,7 +28,7 @@
#include <kis_debug.h>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include <KoNetAccess.h>
#include <klocalizedstring.h>
#include <kconfiggroup.h>
......@@ -61,7 +61,7 @@ void KisTemplateTree::readTemplateTree()
void KisTemplateTree::writeTemplateTree()
{
QString localDir = KGlobal::dirs()->saveLocation("data", m_templatesResourcePath);
QString localDir = KoResourcePaths::saveLocation("data", m_templatesResourcePath);
foreach (KisTemplateGroup *group, m_groups) {
//dbgUI <<"---------------------------------";
......@@ -77,7 +77,8 @@ void KisTemplateTree::writeTemplateTree()
//dbgUI <<"touched";
if (!group->isHidden()) {
//dbgUI <<"not hidden";
KStandardDirs::makeDir(localDir + group->name()); // create the local group dir
QDir path;
path.mkpath(localDir + group->name()); // create the local group dir
} else {
//dbgUI <<"hidden";
if (group->dirs().count() == 1 && group->dirs().contains(localDir)) {
......@@ -86,7 +87,8 @@ void KisTemplateTree::writeTemplateTree()
//dbgUI <<"removing:" << group->dirs().first();
} else {
//dbgUI <<"global";
KStandardDirs::makeDir(localDir + group->name());
QDir path;
path.mkpath(localDir + group->name());
}
}
}
......@@ -138,7 +140,7 @@ KisTemplateGroup *KisTemplateTree::find(const QString &name) const
void KisTemplateTree::readGroups()
{
QStringList dirs = KGlobal::dirs()->findDirs("data", m_templatesResourcePath);
QStringList dirs = KoResourcePaths::findDirs("data", m_templatesResourcePath);
foreach(const QString & dirName, dirs) {
//dbgUI <<"dir:" << *it;
QDir dir(dirName);
......
......@@ -51,7 +51,7 @@
#include <kmenu.h>
#include <QMessageBox>
#include <kservice.h>
#include <kstandarddirs.h>
#include <KoResourcePaths.h>
#include <kstatusbar.h>
#include <QUrl>
#include <kselectaction.h>
......@@ -1216,7 +1216,7 @@ void KisViewManager::toggleTabletLogger()
void KisViewManager::openResourcesDirectory()
{
QString dir = KStandardDirs::locateLocal("data", "krita");
QString dir = KoResourcePaths::locateLocal("data", "krita");
QDesktopServices::openUrl(QUrl::fromLocalFile(dir));
}
......
......@@ -31,8 +31,7 @@
#include <QPushButton>
#include <QDialogButtonBox>
#include <KStandardDirs>
#include <KoResourcePaths.h>
#include "filter/kis_filter.h"
#include "kis_config_widget.h"
......@@ -66,7 +65,7 @@ KisDlgAdjustmentLayer::KisDlgAdjustmentLayer(KisNodeSP node,
setMainWidget(page);
wdgFilterNodeCreation.filterGalleryToggle->setChecked(wdgFilterNodeCreation.filterSelector->isFilterGalleryVisible());
wdgFilterNodeCreation.filterGalleryToggle->setIcon(QPixmap(KGlobal::dirs()->findResource("data", "krita/pics/sidebaricon.png")));
wdgFilterNodeCreation.filterGalleryToggle->setIcon(QPixmap(KoResourcePaths::findResource("data", "krita/pics/sidebaricon.png")));
wdgFilterNodeCreation.filterGalleryToggle->setMaximumWidth(wdgFilterNodeCreation.filterGalleryToggle->height());
connect(wdgFilterNodeCreation.filterSelector, SIGNAL(sigFilterGalleryToggled(bool)), wdgFilterNodeCreation.filterGalleryToggle, SLOT(setChecked(bool)));
connect(wdgFilterNodeCreation.filterGalleryToggle, SIGNAL(toggled(bool)), wdgFilterNodeCreation.filterSelector, SLOT(showFilterGallery(bool)));
......