From aa2a0638f58b8059a465384d5b15e89a1030e092 Mon Sep 17 00:00:00 2001 From: Daniel Teske <daniel.teske@digia.com> Date: Mon, 17 Feb 2014 13:21:39 +0100 Subject: [PATCH] ResourceEditor: Remove even more dead code Change-Id: I5b2f01b5cdf512f2cc125481f0db999d111c3a54 Reviewed-by: hjk <hjk121@nokiamail.com> --- .../resourceeditor/qrceditor/resourcefile.cpp | 62 ------------------- .../resourceeditor/qrceditor/resourcefile_p.h | 9 --- 2 files changed, 71 deletions(-) diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp index 97e09d49222..a7cbea3b396 100644 --- a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp +++ b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp @@ -240,68 +240,6 @@ void ResourceFile::refresh() } } -bool ResourceFile::split(const QString &_path, QString *prefix, QString *file) const -{ - prefix->clear(); - file->clear(); - - QString path = _path; - if (!path.startsWith(QLatin1Char(':'))) - return false; - path = path.mid(1); - - for (int i = 0; i < m_prefix_list.size(); ++i) { - Prefix const * const &pref = m_prefix_list.at(i); - if (!path.startsWith(pref->name)) - continue; - - *prefix = pref->name; - if (pref->name == QString(QLatin1Char('/'))) - *file = path.mid(1); - else - *file = path.mid(pref->name.size() + 1); - - const QString filePath = absolutePath(*file); - - for (int j = 0; j < pref->file_list.count(); j++) { - File const * const &f = pref->file_list.at(j); - if (!f->alias.isEmpty()) { - if (absolutePath(f->alias) == filePath) { - *file = f->name; - return true; - } - } else if (f->name == filePath) - return true; - } - } - - return false; -} - -QString ResourceFile::resolvePath(const QString &path) const -{ - QString prefix, file; - if (split(path, &prefix, &file)) - return absolutePath(file); - - return QString(); -} - -bool ResourceFile::isEmpty() const -{ - return m_file_name.isEmpty() && m_prefix_list.isEmpty(); -} - -QStringList ResourceFile::fileList(int pref_idx) const -{ - QStringList result; - Q_ASSERT(pref_idx >= 0 && pref_idx < m_prefix_list.count()); - const FileList &abs_file_list = m_prefix_list.at(pref_idx)->file_list; - foreach (const File *abs_file, abs_file_list) - result.append(relativePath(abs_file->name)); - return result; -} - void ResourceFile::addFile(int prefix_idx, const QString &file, int file_idx) { Prefix * const p = m_prefix_list[prefix_idx]; diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile_p.h b/src/plugins/resourceeditor/qrceditor/resourcefile_p.h index 2541fc73cab..e110cdda5a4 100644 --- a/src/plugins/resourceeditor/qrceditor/resourcefile_p.h +++ b/src/plugins/resourceeditor/qrceditor/resourcefile_p.h @@ -139,11 +139,6 @@ public: QString errorMessage() const { return m_error_message; } void refresh(); -private: - QString resolvePath(const QString &path) const; - QStringList fileList(int pref_idx) const; - -public: int prefixCount() const; QString prefix(int idx) const; QString lang(int idx) const; @@ -178,10 +173,6 @@ public: QString absolutePath(const QString &rel_path) const; static QString fixPrefix(const QString &prefix); - bool split(const QString &path, QString *prefix, QString *file) const; - -private: - bool isEmpty() const; private: PrefixList m_prefix_list; -- GitLab