2010-12-08 08:26:18 +01:00
|
|
|
#ifndef SAVELOADTHREAD_H
|
|
|
|
#define SAVELOADTHREAD_H
|
|
|
|
|
2011-01-02 07:15:26 +01:00
|
|
|
//#include "savelistitem.h"
|
|
|
|
#include "../WiiQt/includes.h"
|
|
|
|
#include "../WiiQt/nanddump.h"
|
|
|
|
#define DESC_VERSION 1
|
2010-12-08 08:26:18 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
LOAD_SNEEK = 0x111,
|
|
|
|
LOAD_PC
|
|
|
|
};
|
2011-01-02 07:15:26 +01:00
|
|
|
|
|
|
|
//little struct to hold the info about all the saves for 1 game backed up on the PC
|
|
|
|
struct PcSaveInfo
|
|
|
|
{
|
|
|
|
QString tid;
|
|
|
|
QByteArray banner;
|
|
|
|
QList<quint32> sizes;
|
|
|
|
QStringList descriptions;
|
|
|
|
QStringList paths;
|
|
|
|
};
|
|
|
|
|
2010-12-08 08:26:18 +01:00
|
|
|
class SaveLoadThread : public QThread
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2011-01-02 07:15:26 +01:00
|
|
|
public:
|
|
|
|
SaveLoadThread( QObject *parent = 0 );
|
|
|
|
~SaveLoadThread();
|
2010-12-08 08:26:18 +01:00
|
|
|
|
2011-01-02 07:15:26 +01:00
|
|
|
//get banners
|
|
|
|
//if no path is given, it will try to get them from NandDump, otherwise it will use the path on the PC ( not implemented yet )
|
|
|
|
void GetBanners( const QString &bPath = QString() );
|
2010-12-08 08:26:18 +01:00
|
|
|
|
2011-01-02 07:15:26 +01:00
|
|
|
//set this object's extracted nand path
|
|
|
|
bool SetNandPath( const QString &bPath );
|
2010-12-08 08:26:18 +01:00
|
|
|
|
2011-01-02 07:15:26 +01:00
|
|
|
//TODO: these arent done on the work thread, but instead in the calling thread
|
|
|
|
bool DeleteSaveFromSneekNand( quint64 tid );
|
2011-01-04 06:37:50 +01:00
|
|
|
bool InstallSaveToSneekNand( SaveGame save );
|
2011-01-02 07:15:26 +01:00
|
|
|
SaveGame GetSave( quint64 tid );
|
2011-01-04 06:37:50 +01:00
|
|
|
const QString NandBasePath();
|
2010-12-08 08:26:18 +01:00
|
|
|
|
|
|
|
|
2011-01-02 07:15:26 +01:00
|
|
|
void ForceQuit();
|
2010-12-08 08:26:18 +01:00
|
|
|
|
2011-01-02 07:15:26 +01:00
|
|
|
protected:
|
|
|
|
void run();
|
|
|
|
NandDump nand;
|
|
|
|
void GetSavesFromNandDump();
|
|
|
|
void GetSavesFromPC();
|
|
|
|
void GetPCSaves();
|
2010-12-08 08:26:18 +01:00
|
|
|
|
2011-01-02 07:15:26 +01:00
|
|
|
signals:
|
|
|
|
void SendProgress( int );
|
|
|
|
void SendDone( int );
|
|
|
|
void SendSneekItem( QByteArray, const QString&, int );
|
|
|
|
//void SendPcItem( QByteArray, const QString&, const QStringList&, int );
|
|
|
|
void SendPcItem( PcSaveInfo );
|
2010-12-08 08:26:18 +01:00
|
|
|
|
2011-01-02 07:15:26 +01:00
|
|
|
private:
|
|
|
|
QMutex mutex;
|
|
|
|
QWaitCondition condition;
|
|
|
|
QString basePath;
|
|
|
|
int type;
|
|
|
|
|
|
|
|
bool abort;
|
|
|
|
|
|
|
|
int GetFolderSize( const QString& path );
|
|
|
|
};
|
2010-12-08 08:26:18 +01:00
|
|
|
|
|
|
|
#endif // SAVELOADTHREAD_H
|