Commit 8c773beb authored by hjk's avatar hjk
Browse files

Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline

parents 943efa76 7e6aee9b
......@@ -54,6 +54,19 @@ TRANSLATOR qdesigner_internal::ResourceModel
namespace qdesigner_internal {
/******************************************************************************
** FileList
*/
bool FileList::containsFile(File *file)
{
foreach(File *tmpFile, *this)
if (tmpFile->name == file->name && tmpFile->prefix() == file->prefix())
return true;
return false;
}
/******************************************************************************
** ResourceFile
*/
......@@ -375,7 +388,7 @@ bool ResourceFile::contains(const QString &prefix, const QString &file) const
Prefix * const p = m_prefix_list.at(pref_idx);
Q_ASSERT(p);
File equalFile(p, absolutePath(file));
return p->file_list.contains(&equalFile);
return p->file_list.containsFile(&equalFile);
}
bool ResourceFile::contains(int pref_idx, const QString &file) const
......@@ -383,7 +396,7 @@ bool ResourceFile::contains(int pref_idx, const QString &file) const
Q_ASSERT(pref_idx >= 0 && pref_idx < m_prefix_list.count());
Prefix * const p = m_prefix_list.at(pref_idx);
File equalFile(p, absolutePath(file));
return p->file_list.contains(&equalFile);
return p->file_list.containsFile(&equalFile);
}
/*static*/ QString ResourceFile::fixPrefix(const QString &prefix)
......
......@@ -90,7 +90,12 @@ struct File : public Node {
QString name;
QString alias;
};
typedef QList<File *> FileList;
class FileList : public QList<File *>
{
public:
bool containsFile(File *file);
};
/*!
\class Prefix
......
Supports Markdown
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