This repository has been archived on 2021-01-14. You can view files and clone it, but cannot push or open issues or pull requests.
Passgen/pcore.cpp

48 lines
1.3 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "pcore.h"
#include <QString>
PCore::PCore()
{
dList = new QList<LSites*>(); //инициализация массива
}
/**
* @brief PCore::addPass запись пассов в базу
* @param название ресурса
* @param User Name
* @param Описание
* @param Собственно сам пасс
*/
void PCore::addPass(QString domain, QString UName, QString Desc, QString Pass)
{
int tempid = -1;
if (tempid == -1)
{
QList<PStr*> *pList;
pList = new QList<PStr*>();//временно объявили и инициализировали
PStr *tUser = new PStr();//инициализация структуры пассов
tUser->user = UName;
tUser->desc = Desc;
tUser->pass = Pass;
pList->append(tUser);
LSites *tDInf = new LSites();//инициализация структуры ресурсов
tDInf->domain = domain;
tDInf->passList = *pList;
dList->append(tDInf);
}
}
void PCore::addPass(QString domain, QString UName, QString Pass)
{
this->addPass(domain, UName, "No Desc", Pass);
}
void PCore::addPass(QString domain, QString Pass)
{
addPass(domain, "Anonymous", "No Desc", Pass);
}
QList<LSites *> *PCore::getASP()
{
return dList;
}