summaryrefslogtreecommitdiffstats
path: root/utils/themeeditor/projectfiles.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-06-09 20:28:51 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-06-09 20:28:51 +0000
commit1cc95c541bd7bafe5d33ef0145887cb7ddd8a6d7 (patch)
treef1e3080c0a876e95b4ba76b855e54a338bd55300 /utils/themeeditor/projectfiles.cpp
parent70b9ab484f5cddea5cb9a94c93dfbbdf6eea472a (diff)
downloadrockbox-1cc95c541bd7bafe5d33ef0145887cb7ddd8a6d7.tar.gz
rockbox-1cc95c541bd7bafe5d33ef0145887cb7ddd8a6d7.tar.bz2
rockbox-1cc95c541bd7bafe5d33ef0145887cb7ddd8a6d7.zip
Theme Editor: Got project viewer displaying WPS files
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26731 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/projectfiles.cpp')
-rw-r--r--utils/themeeditor/projectfiles.cpp52
1 files changed, 51 insertions, 1 deletions
diff --git a/utils/themeeditor/projectfiles.cpp b/utils/themeeditor/projectfiles.cpp
index 441ff1169e..b7168ac47d 100644
--- a/utils/themeeditor/projectfiles.cpp
+++ b/utils/themeeditor/projectfiles.cpp
@@ -21,8 +21,26 @@
#include "projectfiles.h"
-ProjectFiles::ProjectFiles(ProjectNode* parent): parentLink(parent)
+ProjectFiles::ProjectFiles(QHash<QString, QString>& settings,
+ ProjectNode* parent): parentLink(parent)
{
+ QList<QString> keys;
+ keys.append("wps");
+ keys.append("rwps");
+ keys.append("sbs");
+ keys.append("rsbs");
+ keys.append("fms");
+ keys.append("rfms");
+
+ for(int i = 0; i < keys.count(); i++)
+ {
+ QString file = settings.value(keys[i], "");
+ if(file != "" && file != "-")
+ {
+ file.replace("/.rockbox/", "");
+ children.append(new ProjectFile(file, this));
+ }
+ }
}
ProjectFiles::~ProjectFiles()
@@ -75,3 +93,35 @@ void ProjectFiles::activated()
}
+/* Project File functions */
+ProjectFile::ProjectFile(QString file, ProjectNode* parent) :
+ parentLink(parent), file(file)
+{
+
+}
+
+ProjectFile::~ProjectFile()
+{
+
+}
+
+QVariant ProjectFile::data(int column) const
+{
+ if(column == 0)
+ return file;
+ else
+ return QVariant();
+}
+
+Qt::ItemFlags ProjectFile::flags(int column) const
+{
+ if(column == 0)
+ return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
+ else
+ return 0;
+}
+
+void ProjectFile::activated()
+{
+}
+