mirror of
https://github.com/YACReader/yacreader
synced 2025-07-23 07:24:58 -04:00
Guardados en sesi?n los datos env?ados del cliente en el POST inicial.
Filtrado "de prueba" de los c?mics que ya estan en el dispositivo.
This commit is contained in:
@ -160,10 +160,11 @@ void HttpSession::setLastAccess() {
|
||||
}
|
||||
|
||||
//A<>ADIDO
|
||||
//sets
|
||||
bool HttpSession::isComicOnDevice(const QString & hash)
|
||||
{
|
||||
if(dataPtr)
|
||||
return dataPtr->yacreaderSessionData.downloadedComics.contains(hash);
|
||||
return dataPtr->yacreaderSessionData.comicsOnDevice.contains(hash);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
@ -174,6 +175,42 @@ bool HttpSession::isComicDownloaded(const QString & hash)
|
||||
else
|
||||
return false;
|
||||
}
|
||||
void HttpSession::setComicOnDevice(const QString & hash)
|
||||
{
|
||||
if(dataPtr)
|
||||
{
|
||||
dataPtr->yacreaderSessionData.comicsOnDevice.insert(hash);
|
||||
}
|
||||
}
|
||||
void HttpSession::setComicsOnDevice(const QSet<QString> & set)
|
||||
{
|
||||
if(dataPtr)
|
||||
{
|
||||
dataPtr->yacreaderSessionData.comicsOnDevice = set;
|
||||
}
|
||||
}
|
||||
void HttpSession::setDownloadedComic(const QString & hash)
|
||||
{
|
||||
if(dataPtr)
|
||||
{
|
||||
dataPtr->yacreaderSessionData.downloadedComics.insert(hash);
|
||||
}
|
||||
}
|
||||
QSet<QString> HttpSession::getComicsOnDevice()
|
||||
{
|
||||
if(dataPtr)
|
||||
return dataPtr->yacreaderSessionData.comicsOnDevice ;
|
||||
else
|
||||
return QSet<QString>();
|
||||
}
|
||||
QSet<QString> HttpSession::getDownloadedComics()
|
||||
{
|
||||
if(dataPtr)
|
||||
return dataPtr->yacreaderSessionData.downloadedComics ;
|
||||
else
|
||||
return QSet<QString>();
|
||||
}
|
||||
//current comic
|
||||
qulonglong HttpSession::getCurrentComicId()
|
||||
{
|
||||
if(dataPtr)
|
||||
@ -202,21 +239,6 @@ void HttpSession::dismissCurrentComic()
|
||||
dataPtr->yacreaderSessionData.comicId = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void HttpSession::setComicsOnDevice(const QSet<QString> & set)
|
||||
{
|
||||
if(dataPtr)
|
||||
{
|
||||
dataPtr->yacreaderSessionData.comicsOnDevice = set;
|
||||
}
|
||||
}
|
||||
void HttpSession::setDownloadedComic(const QString & hash)
|
||||
{
|
||||
if(dataPtr)
|
||||
{
|
||||
dataPtr->yacreaderSessionData.downloadedComics.insert(hash);
|
||||
}
|
||||
}
|
||||
void HttpSession::setCurrentComic(qulonglong id, Comic2 * comic)
|
||||
{
|
||||
if(dataPtr)
|
||||
@ -225,4 +247,35 @@ void HttpSession::setCurrentComic(qulonglong id, Comic2 * comic)
|
||||
dataPtr->yacreaderSessionData.comicId = id;
|
||||
dataPtr->yacreaderSessionData.comic = comic;
|
||||
}
|
||||
}
|
||||
|
||||
QString HttpSession::getDeviceType()
|
||||
{
|
||||
if(dataPtr)
|
||||
{
|
||||
return dataPtr->yacreaderSessionData.device;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
QString HttpSession::getDisplayType()
|
||||
{
|
||||
if(dataPtr)
|
||||
{
|
||||
return dataPtr->yacreaderSessionData.display;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
void HttpSession::setDeviceType(const QString & device)
|
||||
{
|
||||
if(dataPtr)
|
||||
{
|
||||
dataPtr->yacreaderSessionData.device = device;
|
||||
}
|
||||
}
|
||||
void HttpSession::setDisplayType(const QString & display)
|
||||
{
|
||||
if(dataPtr)
|
||||
{
|
||||
dataPtr->yacreaderSessionData.display = display;
|
||||
}
|
||||
}
|
@ -93,15 +93,26 @@ public:
|
||||
void setLastAccess();
|
||||
|
||||
//A<>ADIDO
|
||||
//sets
|
||||
void setComicsOnDevice(const QSet<QString> & set);
|
||||
void setComicOnDevice(const QString & hash);
|
||||
void setDownloadedComic(const QString & hash);
|
||||
bool isComicOnDevice(const QString & hash);
|
||||
bool isComicDownloaded(const QString & hash);
|
||||
QSet<QString> getComicsOnDevice();
|
||||
QSet<QString> getDownloadedComics();
|
||||
|
||||
//current comic
|
||||
qulonglong getCurrentComicId();
|
||||
Comic2 * getCurrentComic();
|
||||
void dismissCurrentComic();
|
||||
|
||||
void setComicsOnDevice(const QSet<QString> & set);
|
||||
void setDownloadedComic(const QString & hash);
|
||||
void setCurrentComic(qulonglong id, Comic2 * comic);
|
||||
|
||||
//device identification
|
||||
QString getDeviceType();
|
||||
QString getDisplayType();
|
||||
void setDeviceType(const QString & device);
|
||||
void setDisplayType(const QString & display);
|
||||
|
||||
private:
|
||||
|
||||
@ -111,6 +122,8 @@ private:
|
||||
//c<>mics que han sido descargados o est<73>n siendo descargados en esta sesi<73>n
|
||||
QSet<QString> downloadedComics;
|
||||
//c<>mic actual que est<73> siendo descargado
|
||||
QString device;
|
||||
QString display;
|
||||
qulonglong comicId;
|
||||
Comic2 * comic;
|
||||
};
|
||||
|
Reference in New Issue
Block a user