Make QmlPath in Outline configurable

Fixes a TODO in the code and has the slight advantage that we can
disable the Outline from integration tests by pointing to a not
existing file.
icc-effect-5.14.5
Martin Gräßlin 2016-01-29 09:50:52 +01:00
parent 1f7daa934d
commit 2a935c523f
1 changed files with 4 additions and 2 deletions

View File

@ -26,6 +26,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// KWin libs
#include <kwinxrenderutils.h>
#include "workspace.h"
// Frameworks
#include <KConfigGroup>
// Qt
#include <QDebug>
#include <QQmlComponent>
@ -150,8 +152,8 @@ void CompositedOutlineVisual::show()
}
if (m_qmlComponent.isNull()) {
m_qmlComponent.reset(new QQmlComponent(Scripting::self()->qmlEngine()));
// TODO: fileName should be configurable
const QString fileName = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral(KWIN_NAME "/outline/plasma/outline.qml"));
const QString fileName = QStandardPaths::locate(QStandardPaths::GenericDataLocation,
kwinApp()->config()->group(QStringLiteral("Outline")).readEntry("QmlPath", QStringLiteral(KWIN_NAME "/outline/plasma/outline.qml")));
if (fileName.isEmpty()) {
qCDebug(KWIN_CORE) << "Could not locate outline.qml";
return;