From cc6cc53737ffc32ed6a7c6b1e06c9358dcf6b12a Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Tue, 8 Mar 2011 21:05:57 +0000 Subject: Fix wrong theme base path when loading a wps. When loading a wps in the Theme Editor without having a theme cfg loaded the base path derived from it would be wrong. Make sure to start from the wps files folder when deriving it. Still assumes the wps file to be in the standard layout, i.e. in a folder called wps/. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29545 a1c6a512-1295-4272-9138-f99709370657 --- utils/themeeditor/models/parsetreemodel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/themeeditor/models/parsetreemodel.cpp b/utils/themeeditor/models/parsetreemodel.cpp index e456797a4d..37ec9b01da 100644 --- a/utils/themeeditor/models/parsetreemodel.cpp +++ b/utils/themeeditor/models/parsetreemodel.cpp @@ -289,7 +289,8 @@ RBScene* ParseTreeModel::render(ProjectModel* project, /* Setting themebase if it can't be derived from the project */ if(settings.value("themebase", "") == "" && file && QFile::exists(*file)) { - QDir base(*file); + QFileInfo wpsfile(*file); + QDir base(wpsfile.canonicalPath()); base.cdUp(); settings.insert("themebase", base.canonicalPath()); } -- cgit v1.2.3