aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/resourceeditor
diff options
context:
space:
mode:
authorDaniel Teske <daniel.teske@digia.com>2014-02-17 12:41:45 +0100
committerDaniel Teske <daniel.teske@digia.com>2014-02-18 12:39:55 +0100
commit3780a703cd4a470345fe7ef32969532e0cb639ac (patch)
treed761ce7d5ceb09f8fdf4146addfeb9ee88deb336 /src/plugins/resourceeditor
parentb5be4d286628a131899a0ce48cd12a5dbb0589b3 (diff)
ResourceEditor: Fix saving of multiple prefixes with different languages
Also fix the quadratic peformance. Change-Id: I7287bd23438b4b018a4bf8ee891a4532ec9b4ba8 Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/plugins/resourceeditor')
-rw-r--r--src/plugins/resourceeditor/qrceditor/resourcefile.cpp23
-rw-r--r--src/plugins/resourceeditor/qrceditor/resourcefile_p.h1
2 files changed, 4 insertions, 20 deletions
diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp
index f4f89f32e75..97e09d49222 100644
--- a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp
+++ b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp
@@ -194,17 +194,10 @@ bool ResourceFile::save()
QDomElement root = doc.createElement(QLatin1String("RCC"));
doc.appendChild(root);
- const QStringList name_list = prefixList();
-
- foreach (const QString &name, name_list) {
- FileList file_list;
- QString lang;
- foreach (const Prefix *pref, m_prefix_list) {
- if (pref->name == name){
- file_list += pref->file_list;
- lang = pref->lang;
- }
- }
+ foreach (const Prefix *pref, m_prefix_list) {
+ FileList file_list = pref->file_list;
+ const QString &name = pref->name;
+ const QString &lang = pref->lang;
QDomElement relt = doc.createElement(QLatin1String("qresource"));
root.appendChild(relt);
@@ -294,14 +287,6 @@ QString ResourceFile::resolvePath(const QString &path) const
return QString();
}
-QStringList ResourceFile::prefixList() const
-{
- QStringList result;
- for (int i = 0; i < m_prefix_list.size(); ++i)
- result.append(m_prefix_list.at(i)->name);
- return result;
-}
-
bool ResourceFile::isEmpty() const
{
return m_file_name.isEmpty() && m_prefix_list.isEmpty();
diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile_p.h b/src/plugins/resourceeditor/qrceditor/resourcefile_p.h
index f64ecc4e86d..2541fc73cab 100644
--- a/src/plugins/resourceeditor/qrceditor/resourcefile_p.h
+++ b/src/plugins/resourceeditor/qrceditor/resourcefile_p.h
@@ -141,7 +141,6 @@ public:
private:
QString resolvePath(const QString &path) const;
- QStringList prefixList() const;
QStringList fileList(int pref_idx) const;
public: