+ else if (role == Qt::DisplayRole)
+ {
+ // The QListView uses this role to do keyboard based searching,
+ // so we help it along by giving it what it needs to do the job. :-)
+ unsigned long dbIndex = list.at(index.row()).dbIndex;
+ QString filename = list.at(index.row()).filename;
+ QString nameToMatch;
+
+ // Pull name from file DB, otherwise, use the filename...
+ if (dbIndex != 0xFFFFFFFF)
+ nameToMatch = romList[dbIndex].name;
+ else
+ {
+ int lastSlashPos = filename.lastIndexOf('/');
+ nameToMatch = filename.mid(lastSlashPos + 1);
+ }
+
+ return nameToMatch;
+ }