#include "settings.h"
//#include "types.h"
+#if 0
struct RomIdentifier
{
const uint32 crc32;
const char name[128];
const char file[128];
};
+#endif
RomIdentifier romList[] = {
{ 0x0509C85E, "Raiden (World)", "" },
Maybe box art, screenshots will go as well...
*/
-FileThread::FileThread(QObject * parent/*= 0*/): QThread(parent), listWidget(NULL), abort(false)
+FileThread::FileThread(QObject * parent/*= 0*/): QThread(parent), /*listWidget(NULL),*/ abort(false)
{
}
wait();
}
-void FileThread::Go(QListWidget * lw)
+//void FileThread::Go(QListWidget * lw)
+void FileThread::Go(void)
{
QMutexLocker locker(&mutex);
- this->listWidget = lw;
+// this->listWidget = lw;
start();
}
+//
+// Here's the thread's actual execution path...
+//
void FileThread::run(void)
{
QDir romDir(vjs.ROMPath);
QFileInfoList list = romDir.entryInfoList();
+/*
+Another thing we'll probably have to do here is check for compressed files and
+decompress/fish around in them to find what we need. :-P
+*/
+
for(int i=0; i<list.size(); i++)
{
if (abort)
+#if 1
+{
+printf("FileThread: Aborting!!!\n");
+#endif
return;
+#if 1
+}
+#endif
QFileInfo fileInfo = list.at(i);
QFile file(romDir.filePath(fileInfo.fileName()));
if (index != 0xFFFFFFFF)
{
-printf("FileThread: Found match [%s]...\n", romList[index].name);
- new QListWidgetItem(QIcon(":/res/generic.png"), romList[index].name, listWidget);
-// break;
+//printf("FileThread: Found match [%s]...\n", romList[index].name);
+// new QListWidgetItem(QIcon(":/res/generic.png"), romList[index].name, listWidget);
+// emit FoundAFile(romList[index].crc32);
+ emit FoundAFile(index);
}
}
}
//
-// Find a CRC in the ROM list. If it's there, return the index, otherwise return $FFFFFFFF
+// Find a CRC in the ROM list (simple brute force algorithm).
+// If it's there, return the index, otherwise return $FFFFFFFF
//
uint32 FileThread::FindCRCIndexInFileList(uint32 crc)
{