1 #include "directorymodel.h"
3 void DirectoryModel::clear()
10 void DirectoryModel::add_entry(const QString &name, EntryType type)
17 for(i=0; (i<entries.size() && entries[i]<entry); ++i) ;
19 beginInsertRows(QModelIndex(), i, i);
20 entries.insert(i, entry);
24 QHash<int, QByteArray> DirectoryModel::roleNames() const
26 QHash<int, QByteArray> names;
32 int DirectoryModel::rowCount(const QModelIndex &) const
34 return entries.size();
37 QVariant DirectoryModel::data(const QModelIndex &index, int role) const
44 return entries[i].name;
46 return entries[i].type;
52 bool DirectoryModel::Entry::operator<(const Entry &other) const
55 return type<other.type;
56 return name<other.name;