mirror of
https://github.com/YACReader/yacreader
synced 2025-07-26 17:04:45 -04:00
fixed levels browsing in web library (up and drill down)
This commit is contained in:
@ -335,59 +335,47 @@ void HttpSession::setDisplayType(const QString & display)
|
||||
|
||||
void HttpSession::clearNavigationPath()
|
||||
{
|
||||
if(dataPtr)
|
||||
dataPtr->yacreaderSessionData.navigationPath.clear();
|
||||
if(dataPtr)
|
||||
dataPtr->yacreaderSessionData.navigationPath.clear();
|
||||
}
|
||||
|
||||
int HttpSession::popPage()
|
||||
QPair<qulonglong, quint32> HttpSession::popNavigationItem()
|
||||
{
|
||||
if(dataPtr && !(dataPtr->yacreaderSessionData.navigationPath.isEmpty()))
|
||||
return dataPtr->yacreaderSessionData.navigationPath.pop();
|
||||
return 0;
|
||||
if(dataPtr && !(dataPtr->yacreaderSessionData.navigationPath.isEmpty()))
|
||||
return dataPtr->yacreaderSessionData.navigationPath.pop();
|
||||
return QPair<qulonglong, quint32>();
|
||||
}
|
||||
|
||||
void HttpSession::pushPage(int page)
|
||||
QPair<qulonglong, quint32> HttpSession::topNavigationItem()
|
||||
{
|
||||
if(dataPtr)
|
||||
dataPtr->yacreaderSessionData.navigationPath.push(page);
|
||||
if(dataPtr && !(dataPtr->yacreaderSessionData.navigationPath.isEmpty()))
|
||||
return dataPtr->yacreaderSessionData.navigationPath.top();
|
||||
return QPair<qulonglong, quint32>();
|
||||
}
|
||||
|
||||
int HttpSession::topPage()
|
||||
{
|
||||
if(dataPtr)
|
||||
return dataPtr->yacreaderSessionData.navigationPath.top();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void HttpSession::clearFoldersPath()
|
||||
void HttpSession::pushNavigationItem(const QPair<qulonglong, quint32> &item)
|
||||
{
|
||||
if(dataPtr)
|
||||
dataPtr->yacreaderSessionData.foldersPath.clear();
|
||||
dataPtr->yacreaderSessionData.navigationPath.push(item);
|
||||
}
|
||||
|
||||
int HttpSession::popFolder()
|
||||
void HttpSession::updateTopItem(const QPair<qulonglong, quint32> &item)
|
||||
{
|
||||
if(dataPtr && !(dataPtr->yacreaderSessionData.foldersPath.isEmpty()))
|
||||
return dataPtr->yacreaderSessionData.foldersPath.pop();
|
||||
return 0;
|
||||
if(dataPtr && !(dataPtr->yacreaderSessionData.navigationPath.isEmpty()))
|
||||
{
|
||||
dataPtr->yacreaderSessionData.navigationPath.pop();
|
||||
dataPtr->yacreaderSessionData.navigationPath.push(item);
|
||||
} else if(dataPtr)
|
||||
{
|
||||
dataPtr->yacreaderSessionData.navigationPath.push(item);
|
||||
}
|
||||
}
|
||||
|
||||
void HttpSession::pushFolder(int page)
|
||||
QStack<QPair<qulonglong, quint32> > HttpSession::getNavigationPath()
|
||||
{
|
||||
if(dataPtr)
|
||||
dataPtr->yacreaderSessionData.foldersPath.push(page);
|
||||
return dataPtr->yacreaderSessionData.navigationPath;
|
||||
else
|
||||
return QStack<QPair<qulonglong, quint32> >();
|
||||
}
|
||||
|
||||
int HttpSession::topFolder()
|
||||
{
|
||||
if(dataPtr)
|
||||
return dataPtr->yacreaderSessionData.foldersPath.top();
|
||||
return 0;
|
||||
}
|
||||
|
||||
QStack<int> HttpSession::getFoldersPath()
|
||||
{
|
||||
if(dataPtr)
|
||||
return dataPtr->yacreaderSessionData.foldersPath;
|
||||
return QStack<int>();
|
||||
}
|
||||
|
@ -121,8 +121,8 @@ public:
|
||||
void setDeviceType(const QString & device);
|
||||
void setDisplayType(const QString & display);
|
||||
|
||||
void clearNavigationPath();
|
||||
int popPage();
|
||||
|
||||
/*int popPage();
|
||||
void pushPage(int page);
|
||||
int topPage();
|
||||
|
||||
@ -130,7 +130,19 @@ public:
|
||||
int popFolder();
|
||||
void pushFolder(int page);
|
||||
int topFolder();
|
||||
QStack<int> getFoldersPath();
|
||||
QStack<int> getFoldersPath();*/
|
||||
|
||||
void clearNavigationPath();
|
||||
QPair<qulonglong, quint32> popNavigationItem();
|
||||
QPair<qulonglong, quint32> topNavigationItem();
|
||||
void pushNavigationItem(const QPair<qulonglong, quint32> & item);
|
||||
void updateTopItem(const QPair<qulonglong, quint32> & item);
|
||||
|
||||
//TODO replace QPair by a custom class for storing folderId, page and folderName(save some DB accesses)
|
||||
QStack<QPair<qulonglong, quint32> > getNavigationPath();
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@ -145,8 +157,8 @@ private:
|
||||
qulonglong comicId;
|
||||
qulonglong remoteComicId;
|
||||
|
||||
QStack<int> navigationPath;
|
||||
QStack<int> foldersPath;
|
||||
//folder_id, page_number
|
||||
QStack<QPair<qulonglong, quint32> > navigationPath;
|
||||
|
||||
Comic * comic;
|
||||
Comic * remoteComic;
|
||||
|
Reference in New Issue
Block a user