jce-manager/src/appDatabase/savedata.h

61 lines
1.1 KiB
C
Raw Normal View History

2014-06-18 23:44:46 +00:00
#ifndef SAVEDATA_H
#define SAVEDATA_H
/**
* SaveData Class
* --------------------------------------
*
2014-09-22 18:54:16 +00:00
* Uses QMap
2014-06-18 23:44:46 +00:00
*
2014-09-22 18:54:16 +00:00
* key : vale
*
* Keys:
* "username"
* "password"
2014-10-13 23:45:11 +00:00
* "locale"
2014-09-22 18:54:16 +00:00
* "calendar"
*
* Note that the password will be encrypted using the SimpleCrypt class!
2014-06-18 23:44:46 +00:00
*
2014-09-22 18:54:16 +00:00
* SimpleCrypt class was found at the qt projects forms - and been fixed by Sagi Dayan.
2014-06-18 23:44:46 +00:00
*
*/
/* QT libs */
#include <QString>
#include <QFile>
#include <QTextStream>
#include <QDebug>
#include <QMap>
#include "simplecrypt.h"
2014-06-18 23:44:46 +00:00
2014-09-22 18:54:16 +00:00
#define FILE_NAME "JM.dat"
2014-06-18 23:44:46 +00:00
class SaveData
{
public:
SaveData();
bool isSaved();
void reset();
void setUsername(QString username);
void setPassword(QString password);
void setCal(QString cal);
2014-10-13 23:45:11 +00:00
void setLocale(QString locale);
QString getUsername();
QString getPassword();
QString getCal();
2014-10-13 23:45:11 +00:00
QString getLocale();
2014-06-18 23:44:46 +00:00
private:
QMap<QString, QString> DB;
void load();
void save();
void createDB();
QString encrypt(QString pass);
QString decrypte(QString pass);
2014-06-18 23:44:46 +00:00
};
#endif // SAVEDATA_H
2014-08-31 17:54:33 +00:00