forked from len0rd/rockbox
Theme Editor: Got project viewer displaying WPS files
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26731 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
70b9ab484f
commit
1cc95c541b
4 changed files with 121 additions and 4 deletions
|
@ -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()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue