mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
line 117: #define _WIN64 1 must be removed in ./compressed_archive/libp7zip/CPP/myWindows/StdAfx.h "cannot find -lpulse" compiling under Qt 5.0.2 can be fixed creating a symbolic link from libpulse.so.0 to libpulse.so (further research is needed)
39 lines
1.4 KiB
C++
39 lines
1.4 KiB
C++
#include "folderinfocontroller.h"
|
|
#include "db_helper.h" //get libraries
|
|
|
|
#include "folder.h"
|
|
#include "comic_db.h"
|
|
|
|
#include "template.h"
|
|
#include "../static.h"
|
|
|
|
|
|
FolderInfoController::FolderInfoController() {}
|
|
|
|
void FolderInfoController::service(HttpRequest& request, HttpResponse& response)
|
|
{
|
|
response.setHeader("Content-Type", "plain/text; charset=ISO-8859-1");
|
|
|
|
QString path = QUrl::fromPercentEncoding(request.getPath()).toLatin1();
|
|
QStringList pathElements = path.split('/');
|
|
int libraryId = pathElements.at(2).toInt();
|
|
QString libraryName = DBHelper::getLibraryName(libraryId);
|
|
qulonglong parentId = pathElements.at(4).toULongLong();
|
|
QList<LibraryItem *> folderContent = DBHelper::getFolderContentFromLibrary(libraryName,parentId);
|
|
QList<LibraryItem *> folderComics = DBHelper::getFolderComicsFromLibrary(libraryName,parentId);
|
|
|
|
Folder * currentFolder;
|
|
for(QList<LibraryItem *>::const_iterator itr = folderContent.constBegin();itr!=folderContent.constEnd();itr++)
|
|
{
|
|
currentFolder = (Folder *)(*itr);
|
|
response.writeText(QString("/library/%1/folder/%2/info\n").arg(libraryId).arg(currentFolder->id));
|
|
}
|
|
|
|
ComicDB * currentComic;
|
|
for(QList<LibraryItem *>::const_iterator itr = folderComics.constBegin();itr!=folderComics.constEnd();itr++)
|
|
{
|
|
currentComic = (ComicDB *)(*itr);
|
|
response.writeText(QString("/library/%1/comic/%2\n").arg(libraryId).arg(currentComic->id));
|
|
}
|
|
|
|
} |