[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [krita] krita/sketch: Fix Sketch start, KoResourcePaths::findResource("data") is broken somehow
From:       Friedrich W. H. Kossebau <kossebau () kde ! org>
Date:       2016-01-26 23:59:26
Message-ID: E1aODWA-0000jB-NX () scm ! kde ! org
[Download RAW message or body]

Git commit d82819a6f6ac2dc888a7d677e454d2aa266a6084 by Friedrich W. H. Kossebau.
Committed on 26/01/2016 at 23:59.
Pushed by kossebau into branch 'master'.

Fix Sketch start, KoResourcePaths::findResource("data") is broken somehow

M  +2    -2    krita/sketch/MainWindow.cpp
M  +3    -4    krita/sketch/Theme.cpp

http://commits.kde.org/krita/d82819a6f6ac2dc888a7d677e454d2aa266a6084

diff --git a/krita/sketch/MainWindow.cpp b/krita/sketch/MainWindow.cpp
index 18056f6..76b1187 100644
--- a/krita/sketch/MainWindow.cpp
+++ b/krita/sketch/MainWindow.cpp
@@ -24,8 +24,8 @@
 #include <QQmlContext>
 #include <QQmlEngine>
 #include <QFileInfo>
+#include <QStandardPaths>
 
-#include <KoResourcePaths.h>
 #include <KoDialog.h>
 #include <KoZoomController.h>
 
@@ -111,7 +111,7 @@ 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
-    QString mainqml = KoResourcePaths::findResource("data", \
"kritasketch/kritasketch.qml"); +    QString mainqml = \
QStandardPaths::locate(QStandardPaths::GenericDataLocation, \
"kritasketch/kritasketch.qml");  #endif
 
     Q_ASSERT(QFile::exists(mainqml));
diff --git a/krita/sketch/Theme.cpp b/krita/sketch/Theme.cpp
index 437a979..9ee7eb2 100644
--- a/krita/sketch/Theme.cpp
+++ b/krita/sketch/Theme.cpp
@@ -30,8 +30,7 @@
 #include <QApplication>
 #include <QWidget>
 #include <QQmlComponent>
-
-#include <KoResourcePaths.h>
+#include <QStandardPaths>
 
 #include "QmlGlobalEngine.h"
 
@@ -102,7 +101,7 @@ void Theme::setId(const QString& newValue)
 {
     if(newValue != d->id) {
         d->id = newValue;
-        const QString themeQmlPath = KoResourcePaths::findResource("data", \
QString("kritasketch/themes/%1/theme.qml").arg(d->id)); +        const QString \
themeQmlPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, \
QString("kritasketch/themes/%1/theme.qml").arg(d->id));  d->basePath = \
QFileInfo(themeQmlPath).dir().absolutePath();  emit idChanged();
     }
@@ -362,7 +361,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 = KoResourcePaths::findResource("data", \
QString("kritasketch/themes/%1/theme.qml").arg(id)); +    qml = \
QStandardPaths::locate(QStandardPaths::GenericDataLocation, \
QString("kritasketch/themes/%1/theme.qml").arg(id));  #endif
 
     QQmlComponent themeComponent(QmlGlobalEngine::instance()->engine(), parent);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic