diff options
Diffstat (limited to 'utils/themeeditor/models')
| -rw-r--r-- | utils/themeeditor/models/projectmodel.h | 2 | ||||
| -rw-r--r-- | utils/themeeditor/models/targetdata.cpp | 11 | ||||
| -rw-r--r-- | utils/themeeditor/models/targetdata.h | 9 |
3 files changed, 15 insertions, 7 deletions
diff --git a/utils/themeeditor/models/projectmodel.h b/utils/themeeditor/models/projectmodel.h index 4cc531b..4afca28 100644 --- a/utils/themeeditor/models/projectmodel.h +++ b/utils/themeeditor/models/projectmodel.h @@ -35,7 +35,7 @@ public: static QString fileFilter() { - return QObject::tr("Project Files (*.cfg);;All Files (*.*)"); + return QObject::tr("Project Files (*.cfg);;All Files (*)"); } ProjectModel(QString config, EditorWindow* mainWindow, QObject *parent = 0); diff --git a/utils/themeeditor/models/targetdata.cpp b/utils/themeeditor/models/targetdata.cpp index 70d2319..b44f1e6 100644 --- a/utils/themeeditor/models/targetdata.cpp +++ b/utils/themeeditor/models/targetdata.cpp @@ -22,11 +22,17 @@ #include "targetdata.h" #include <QStringList> +#include <QSettings> const QString TargetData::reserved = "{}:#\n"; -TargetData::TargetData(QString file) +TargetData::TargetData() { + QSettings settings; + settings.beginGroup("TargetData"); + QString file = settings.value("targetDbPath", "").toString(); + settings.endGroup(); + if(!QFile::exists(file)) file = ":/targets/targetdb"; @@ -132,7 +138,8 @@ TargetData::TargetData(QString file) /* Checking for the closing '}' and adding the entry */ if(require('}', data, cursor)) { - entries.append(Entry(name, size, depth, rSize, rDepth, fm, record)); + entries.append(Entry(id, name, size, depth, rSize, rDepth, + fm, record)); indices.insert(id, index); index++; } diff --git a/utils/themeeditor/models/targetdata.h b/utils/themeeditor/models/targetdata.h index 09276c5..89bb78b 100644 --- a/utils/themeeditor/models/targetdata.h +++ b/utils/themeeditor/models/targetdata.h @@ -39,7 +39,7 @@ public: None }; - TargetData(QString file = ""); + TargetData(); virtual ~TargetData(); int count(){ return indices.count(); } @@ -57,11 +57,12 @@ public: private: struct Entry { - Entry(QString name, QRect size, ScreenDepth depth, QRect rSize, - ScreenDepth rDepth, bool fm, bool record) - : name(name), size(size), depth(depth), rSize(rSize), + Entry(QString id, QString name, QRect size, ScreenDepth depth, + QRect rSize, ScreenDepth rDepth, bool fm, bool record) + : id(id), name(name), size(size), depth(depth), rSize(rSize), rDepth(rDepth), fm(fm), record(record){ } + QString id; QString name; QRect size; ScreenDepth depth; |