Commit aa2a0638 authored by Daniel Teske's avatar Daniel Teske
Browse files

ResourceEditor: Remove even more dead code



Change-Id: I5b2f01b5cdf512f2cc125481f0db999d111c3a54
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 3780a703
......@@ -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];
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment