summaryrefslogtreecommitdiff
path: root/utils/themeeditor/models
diff options
context:
space:
mode:
Diffstat (limited to 'utils/themeeditor/models')
-rw-r--r--utils/themeeditor/models/projectmodel.h2
-rw-r--r--utils/themeeditor/models/targetdata.cpp11
-rw-r--r--utils/themeeditor/models/targetdata.h9
3 files changed, 15 insertions, 7 deletions
diff --git a/utils/themeeditor/models/projectmodel.h b/utils/themeeditor/models/projectmodel.h
index 4cc531b88f..4afca2837e 100644
--- a/utils/themeeditor/models/projectmodel.h
+++ b/utils/themeeditor/models/projectmodel.h
@@ -35,7 +35,7 @@ public:
35 35
36 static QString fileFilter() 36 static QString fileFilter()
37 { 37 {
38 return QObject::tr("Project Files (*.cfg);;All Files (*.*)"); 38 return QObject::tr("Project Files (*.cfg);;All Files (*)");
39 } 39 }
40 40
41 ProjectModel(QString config, EditorWindow* mainWindow, QObject *parent = 0); 41 ProjectModel(QString config, EditorWindow* mainWindow, QObject *parent = 0);
diff --git a/utils/themeeditor/models/targetdata.cpp b/utils/themeeditor/models/targetdata.cpp
index 70d231988b..b44f1e67b3 100644
--- a/utils/themeeditor/models/targetdata.cpp
+++ b/utils/themeeditor/models/targetdata.cpp
@@ -22,11 +22,17 @@
22#include "targetdata.h" 22#include "targetdata.h"
23 23
24#include <QStringList> 24#include <QStringList>
25#include <QSettings>
25 26
26const QString TargetData::reserved = "{}:#\n"; 27const QString TargetData::reserved = "{}:#\n";
27 28
28TargetData::TargetData(QString file) 29TargetData::TargetData()
29{ 30{
31 QSettings settings;
32 settings.beginGroup("TargetData");
33 QString file = settings.value("targetDbPath", "").toString();
34 settings.endGroup();
35
30 if(!QFile::exists(file)) 36 if(!QFile::exists(file))
31 file = ":/targets/targetdb"; 37 file = ":/targets/targetdb";
32 38
@@ -132,7 +138,8 @@ TargetData::TargetData(QString file)
132 /* Checking for the closing '}' and adding the entry */ 138 /* Checking for the closing '}' and adding the entry */
133 if(require('}', data, cursor)) 139 if(require('}', data, cursor))
134 { 140 {
135 entries.append(Entry(name, size, depth, rSize, rDepth, fm, record)); 141 entries.append(Entry(id, name, size, depth, rSize, rDepth,
142 fm, record));
136 indices.insert(id, index); 143 indices.insert(id, index);
137 index++; 144 index++;
138 } 145 }
diff --git a/utils/themeeditor/models/targetdata.h b/utils/themeeditor/models/targetdata.h
index 09276c5966..89bb78bdc3 100644
--- a/utils/themeeditor/models/targetdata.h
+++ b/utils/themeeditor/models/targetdata.h
@@ -39,7 +39,7 @@ public:
39 None 39 None
40 }; 40 };
41 41
42 TargetData(QString file = ""); 42 TargetData();
43 virtual ~TargetData(); 43 virtual ~TargetData();
44 44
45 int count(){ return indices.count(); } 45 int count(){ return indices.count(); }
@@ -57,11 +57,12 @@ public:
57private: 57private:
58 struct Entry 58 struct Entry
59 { 59 {
60 Entry(QString name, QRect size, ScreenDepth depth, QRect rSize, 60 Entry(QString id, QString name, QRect size, ScreenDepth depth,
61 ScreenDepth rDepth, bool fm, bool record) 61 QRect rSize, ScreenDepth rDepth, bool fm, bool record)
62 : name(name), size(size), depth(depth), rSize(rSize), 62 : id(id), name(name), size(size), depth(depth), rSize(rSize),
63 rDepth(rDepth), fm(fm), record(record){ } 63 rDepth(rDepth), fm(fm), record(record){ }
64 64
65 QString id;
65 QString name; 66 QString name;
66 QRect size; 67 QRect size;
67 ScreenDepth depth; 68 ScreenDepth depth;