X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Ffilelistmodel.cpp;h=a975b82cc2e66f860ef7bdf37082086648869bd0;hb=47c26d5d9daba6072bc580029e711292393d3158;hp=b509957d144a9d10014139735aac24e49a02f8e6;hpb=8549cdb01f45764f69a6483285dc0771ea66c007;p=virtualjaguar diff --git a/src/gui/filelistmodel.cpp b/src/gui/filelistmodel.cpp index b509957..a975b82 100644 --- a/src/gui/filelistmodel.cpp +++ b/src/gui/filelistmodel.cpp @@ -26,17 +26,20 @@ FileListModel::FileListModel(QObject * parent/*= 0*/): QAbstractListModel(parent int FileListModel::rowCount(const QModelIndex & parent/*= QModelIndex()*/) const { - return pixList.size(); +// return pixList.size(); + return dbIndex.size(); } QVariant FileListModel::data(const QModelIndex & index, int role) const { // return QVariant(); - return pixList.at(index.row()); +// return pixList.at(index.row()); + return (uint)dbIndex.at(index.row()); } QVariant FileListModel::headerData(int section, Qt::Orientation orientation, int role/*= Qt::DisplayRole*/) const { +#if 0 // Not sure that this is necessary for our purposes... // Especially since this model would never make use of this info... if (role != Qt::DisplayRole) @@ -46,6 +49,13 @@ QVariant FileListModel::headerData(int section, Qt::Orientation orientation, int return QString("Column %1").arg(section); else return QString("Row %1").arg(section); +#else + // This seems more like what we want... + if (role == Qt::SizeHintRole) + return QSize(1, 1); + + return QVariant(); +#endif } void FileListModel::AddData(QIcon pix) @@ -54,6 +64,12 @@ void FileListModel::AddData(QIcon pix) reset(); } +void FileListModel::AddData(unsigned long index) +{ + dbIndex.push_back(index); + reset(); +} + #if 0