From 33c17d0fd892ba7ab6b3fe6511b33eed4a42b9f4 Mon Sep 17 00:00:00 2001
From: Boudewijn Rempt Created By
"); - QFile fileDevelopers(QStandardPaths::locate(QStandardPaths::AppDataLocation, "aboutdata/developers.txt")); + QFile fileDevelopers(":/developers.txt"); Q_ASSERT(fileDevelopers.exists()); fileDevelopers.open(QIODevice::ReadOnly); @@ -82,7 +82,7 @@ KisAboutApplication::KisAboutApplication(QWidget *parent) "
"); - QFile fileBackers(QStandardPaths::locate(QStandardPaths::AppDataLocation, "aboutdata/backers.txt")); + QFile fileBackers(":/backers.txt"); Q_ASSERT(fileBackers.exists()); fileBackers.open(QIODevice::ReadOnly); foreach(const QByteArray &backer, fileBackers.readAll().split('\n')) { @@ -104,7 +104,7 @@ KisAboutApplication::KisAboutApplication(QWidget *parent) "
"); - QFile fileCredits(QStandardPaths::locate(QStandardPaths::AppDataLocation, "aboutdata/credits.txt")); + QFile fileCredits(":/credits.txt"); Q_ASSERT(fileCredits.exists()); fileCredits.open(QIODevice::ReadOnly); @@ -145,7 +145,7 @@ KisAboutApplication::KisAboutApplication(QWidget *parent) "to trial or educational versions of commercial software that will forbid your work in commercial situations.
" ""); - QFile licenseFile(QStandardPaths::locate(QStandardPaths::AppDataLocation, "aboutdata/LICENSE")); + QFile licenseFile(":/LICENSE"); Q_ASSERT(licenseFile.exists()); licenseFile.open(QIODevice::ReadOnly); QByteArray ba = licenseFile.readAll(); diff --git a/krita/ui/opengl/kis_opengl_canvas2.cpp b/krita/ui/opengl/kis_opengl_canvas2.cpp index 54c730c63a..389c43f215 100644 --- a/krita/ui/opengl/kis_opengl_canvas2.cpp +++ b/krita/ui/opengl/kis_opengl_canvas2.cpp @@ -337,8 +337,8 @@ QOpenGLShaderProgram *KisOpenGLCanvas2::getCursorShader() { if (d->cursorShader == 0) { d->cursorShader = new QOpenGLShaderProgram(); - d->cursorShader->addShaderFromSourceFile(QOpenGLShader::Vertex, KoResourcePaths::findResource("data", "krita/shaders/cursor.vert")); - d->cursorShader->addShaderFromSourceFile(QOpenGLShader::Fragment, KoResourcePaths::findResource("data", "krita/shaders/cursor.frag")); + d->cursorShader->addShaderFromSourceFile(QOpenGLShader::Vertex, ":/cursor.vert"); + d->cursorShader->addShaderFromSourceFile(QOpenGLShader::Fragment, ":/cursor.frag"); d->cursorShader->bindAttributeLocation("a_vertexPosition", PROGRAM_VERTEX_ATTRIBUTE); if (! d->cursorShader->link()) { dbgUI << "OpenGL error" << glGetError(); @@ -666,11 +666,11 @@ void KisOpenGLCanvas2::initializeCheckerShader() QString fragmentShaderName; if (KisOpenGL::supportsGLSL13()) { - vertexShaderName = KoResourcePaths::findResource("data", "krita/shaders/matrix_transform.vert"); - fragmentShaderName = KoResourcePaths::findResource("data", "krita/shaders/simple_texture.frag"); + vertexShaderName = ":/matrix_transform.vert"; + fragmentShaderName = ":/simple_texture.frag"; } else { - vertexShaderName = KoResourcePaths::findResource("data", "krita/shaders/matrix_transform_legacy.vert"); - fragmentShaderName = KoResourcePaths::findResource("data", "krita/shaders/simple_texture_legacy.frag"); + vertexShaderName = ":/matrix_transform_legacy.vert"; + fragmentShaderName = ":/simple_texture_legacy.frag"; } bool result; @@ -748,9 +748,9 @@ void KisOpenGLCanvas2::initializeDisplayShader() reportShaderLinkFailedAndExit(result, "Display fragment shader", d->displayShader->log()); if (KisOpenGL::supportsGLSL13()) { - result = d->displayShader->addShaderFromSourceFile(QOpenGLShader::Vertex, KoResourcePaths::findResource("data", "krita/shaders/matrix_transform.vert")); + result = d->displayShader->addShaderFromSourceFile(QOpenGLShader::Vertex, ":/matrix_transform.vert"); } else { - result = d->displayShader->addShaderFromSourceFile(QOpenGLShader::Vertex, KoResourcePaths::findResource("data", "krita/shaders/matrix_transform_legacy.vert")); + result = d->displayShader->addShaderFromSourceFile(QOpenGLShader::Vertex, ":/matrix_transform_legacy.vert"); } reportShaderLinkFailedAndExit(result, "Display vertex shader", d->displayShader->log()); diff --git a/libs/widgetutils/KoResourcePaths.cpp b/libs/widgetutils/KoResourcePaths.cpp index 34edec0dee..39280a6e0d 100644 --- a/libs/widgetutils/KoResourcePaths.cpp +++ b/libs/widgetutils/KoResourcePaths.cpp @@ -51,7 +51,7 @@ QString getInstallationPrefix() { CFStringGetSystemEncoding()); QString bundlePath = QString::fromLatin1(pathPtr); - qDebug() << "1" << bundlePath << (bundlePath + QString::fromLatin1("/Contents/MacOS/share")); +// qDebug() << "1" << bundlePath << (bundlePath + QString::fromLatin1("/Contents/MacOS/share")); if (QFile(bundlePath + QString::fromLatin1("/Contents/MacOS/share")).exists()) { // qDebug() << "running from a deployed bundle"; bundlePath += QString::fromLatin1("/Contents/MacOS/"); @@ -291,7 +291,7 @@ QStringList KoResourcePaths::findAllResourcesInternal(const QString &type, bool noDuplicates = options & KoResourcePaths::NoDuplicates; bool recursive = options & KoResourcePaths::Recursive; - qDebug() << "findAllResources: type" << type << "filter" << _filter << "no dups" << noDuplicates << "recursive" << recursive; +// qDebug() << "findAllResources: type" << type << "filter" << _filter << "no dups" << noDuplicates << "recursive" << recursive; QStringList aliases = d->aliases(type); QString filter = _filter; -- GitLab