mirror of
https://github.com/YACReader/yacreader
synced 2025-07-14 02:54:46 -04:00
Update server code integration for QtWebApp 1.7.11
- Adapt server code for QtWebapp namespace 'stefanfrings' - Implement custom modifications needed by v1 controller via template engine - Unify iphone and ipad templates
This commit is contained in:
@ -16,6 +16,11 @@
|
||||
|
||||
#include "QsLog.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
using stefanfrings::HttpSession;
|
||||
using stefanfrings::Template;
|
||||
|
||||
struct LibraryItemSorter {
|
||||
bool operator()(const LibraryItem *a, const LibraryItem *b) const
|
||||
{
|
||||
@ -41,8 +46,14 @@ void FolderController::service(HttpRequest &request, HttpResponse &response)
|
||||
//QString y = session.get("xxx").toString();
|
||||
//response.writeText(QString("session xxx : %1 <br/>").arg(y));
|
||||
|
||||
Template t = Static::templateLoader->getTemplate("folder_" + ySession->getDeviceType(), request.getHeader("Accept-Language"));
|
||||
Template t = Static::templateLoader->getTemplate("folder", request.getHeader("Accept-Language"));
|
||||
t.enableWarnings();
|
||||
|
||||
// set device type for templates
|
||||
t.setVariable("device", ySession->getDeviceType());
|
||||
t.setVariable("display", ySession->getDisplayType());
|
||||
t.setCondition("device.ipad", ySession->getDeviceType() == "ipad");
|
||||
|
||||
QString path = QUrl::fromPercentEncoding(request.getPath()).toUtf8();
|
||||
QStringList pathElements = path.split('/');
|
||||
int libraryId = pathElements.at(2).toInt();
|
||||
|
Reference in New Issue
Block a user