mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Replaced the no longer existing HttpResponse::writeText
with HttpResponse::write
.
This commit is contained in:
parent
0b9e840bf0
commit
d94f9201ee
@ -81,8 +81,8 @@ void ComicController::service(HttpRequest& request, HttpResponse& response)
|
|||||||
|
|
||||||
response.setHeader("Content-Type", "text/plain; charset=utf-8");
|
response.setHeader("Content-Type", "text/plain; charset=utf-8");
|
||||||
//TODO this field is not used by the client!
|
//TODO this field is not used by the client!
|
||||||
response.writeText(QString("library:%1\r\n").arg(libraryName));
|
response.write(QString("library:%1\r\n").arg(libraryName).toUtf8());
|
||||||
response.writeText(QString("libraryId:%1\r\n").arg(libraryId));
|
response.write(QString("libraryId:%1\r\n").arg(libraryId).toUtf8());
|
||||||
if(remoteComic) //send previous and next comics id
|
if(remoteComic) //send previous and next comics id
|
||||||
{
|
{
|
||||||
QList<LibraryItem *> siblings = DBHelper::getFolderComicsFromLibrary(libraryId, comic.parentId, true);
|
QList<LibraryItem *> siblings = DBHelper::getFolderComicsFromLibrary(libraryId, comic.parentId, true);
|
||||||
@ -99,9 +99,9 @@ void ComicController::service(HttpRequest& request, HttpResponse& response)
|
|||||||
if(found)
|
if(found)
|
||||||
{
|
{
|
||||||
if(i>0)
|
if(i>0)
|
||||||
response.writeText(QString("previousComic:%1\r\n").arg(siblings.at(i-1)->id));
|
response.write(QString("previousComic:%1\r\n").arg(siblings.at(i-1)->id).toUtf8());
|
||||||
if(i<siblings.length()-1)
|
if(i<siblings.length()-1)
|
||||||
response.writeText(QString("nextComic:%1\r\n").arg(siblings.at(i+1)->id));
|
response.write(QString("nextComic:%1\r\n").arg(siblings.at(i+1)->id).toUtf8());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -109,7 +109,7 @@ void ComicController::service(HttpRequest& request, HttpResponse& response)
|
|||||||
}
|
}
|
||||||
qDeleteAll(siblings);
|
qDeleteAll(siblings);
|
||||||
}
|
}
|
||||||
response.writeText(comic.toTXT(),true);
|
response.write(comic.toTXT().toUtf8(),true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -21,6 +21,6 @@ void ComicDownloadInfoController::service(HttpRequest& request, HttpResponse& re
|
|||||||
ComicDB comic = DBHelper::getComicInfo(libraryId, comicId);
|
ComicDB comic = DBHelper::getComicInfo(libraryId, comicId);
|
||||||
|
|
||||||
//TODO: check if the comic wasn't found;
|
//TODO: check if the comic wasn't found;
|
||||||
response.writeText(QString("fileName:%1\r\n").arg(comic.getFileName()));
|
response.write(QString("fileName:%1\r\n").arg(comic.getFileName()).toUtf8());
|
||||||
response.writeText(QString("fileSize:%1\r\n").arg(comic.getFileSize()),true);
|
response.write(QString("fileSize:%1\r\n").arg(comic.getFileSize()).toUtf8(),true);
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ void FolderContentController::service(HttpRequest& request, HttpResponse& respon
|
|||||||
|
|
||||||
serviceContent(libraryId, parentId, response);
|
serviceContent(libraryId, parentId, response);
|
||||||
|
|
||||||
response.writeText("",true);
|
response.write("",true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FolderContentController::serviceContent(const int &library, const qulonglong &folderId, HttpResponse &response)
|
void FolderContentController::serviceContent(const int &library, const qulonglong &folderId, HttpResponse &response)
|
||||||
@ -54,17 +54,17 @@ void FolderContentController::serviceContent(const int &library, const qulonglon
|
|||||||
if((*itr)->isDir())
|
if((*itr)->isDir())
|
||||||
{
|
{
|
||||||
currentFolder = (Folder *)(*itr);
|
currentFolder = (Folder *)(*itr);
|
||||||
response.writeText(QString("f\t%1\t%2\t%3\t%4\t%5\r\n").arg(library).arg(currentFolder->id).arg(currentFolder->name).arg(currentFolder->getNumChildren()).arg(currentFolder->getFirstChildHash()));
|
response.write(QString("f\t%1\t%2\t%3\t%4\t%5\r\n").arg(library).arg(currentFolder->id).arg(currentFolder->name).arg(currentFolder->getNumChildren()).arg(currentFolder->getFirstChildHash()).toUtf8());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
currentComic = (ComicDB *)(*itr);
|
currentComic = (ComicDB *)(*itr);
|
||||||
response.writeText(QString("c\t%1\t%2\t%3\t%4\t%5\r\n").arg(library).arg(currentComic->id).arg(currentComic->getFileName()).arg(currentComic->getFileSize()).arg(currentComic->info.hash));
|
response.write(QString("c\t%1\t%2\t%3\t%4\t%5\r\n").arg(library).arg(currentComic->id).arg(currentComic->getFileName()).arg(currentComic->getFileSize()).arg(currentComic->info.hash).toUtf8());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
clock_t end = clock();
|
clock_t end = clock();
|
||||||
double msecs = double(end - begin);
|
double msecs = double(end - begin);
|
||||||
|
|
||||||
response.writeText(QString("%1ms").arg(msecs));
|
response.write(QString("%1ms").arg(msecs).toUtf8());
|
||||||
}
|
}
|
||||||
|
@ -316,6 +316,5 @@ void FolderController::service(HttpRequest& request, HttpResponse& response)
|
|||||||
t.setVariable("page",QString("%1").arg(page+1));
|
t.setVariable("page",QString("%1").arg(page+1));
|
||||||
t.setVariable("pages",QString("%1").arg(numPages));
|
t.setVariable("pages",QString("%1").arg(numPages));
|
||||||
|
|
||||||
response.writeText(t, true);
|
response.write(t.toUtf8(), true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ void FolderInfoController::service(HttpRequest& request, HttpResponse& response)
|
|||||||
|
|
||||||
serviceComics(libraryId, parentId, response);
|
serviceComics(libraryId, parentId, response);
|
||||||
|
|
||||||
response.writeText("",true);
|
response.write("",true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FolderInfoController::serviceComics(const int &library, const qulonglong &folderId, HttpResponse &response)
|
void FolderInfoController::serviceComics(const int &library, const qulonglong &folderId, HttpResponse &response)
|
||||||
@ -34,7 +34,7 @@ void FolderInfoController::serviceComics(const int &library, const qulonglong &f
|
|||||||
for(QList<LibraryItem *>::const_iterator itr = folderComics.constBegin();itr!=folderComics.constEnd();itr++)
|
for(QList<LibraryItem *>::const_iterator itr = folderComics.constBegin();itr!=folderComics.constEnd();itr++)
|
||||||
{
|
{
|
||||||
currentComic = (ComicDB *)(*itr);
|
currentComic = (ComicDB *)(*itr);
|
||||||
response.writeText(QString("/library/%1/comic/%2:%3:%4\r\n").arg(library).arg(currentComic->id).arg(currentComic->getFileName()).arg(currentComic->getFileSize()));
|
response.write(QString("/library/%1/comic/%2:%3:%4\r\n").arg(library).arg(currentComic->id).arg(currentComic->getFileName()).arg(currentComic->getFileSize()).toUtf8());
|
||||||
delete currentComic;
|
delete currentComic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,5 +36,5 @@ void LibrariesController::service(HttpRequest& request, HttpResponse& response)
|
|||||||
}
|
}
|
||||||
|
|
||||||
response.setStatus(200,"OK");
|
response.setStatus(200,"OK");
|
||||||
response.writeText(t,true);
|
response.write(t.toUtf8(),true);
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ void SyncController::service(HttpRequest &request, HttpResponse &response)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
response.setStatus(412,"No comic info received");
|
response.setStatus(412,"No comic info received");
|
||||||
response.writeText("",true);
|
response.write("",true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,8 +23,8 @@ void TagsController::service(HttpRequest& request, HttpResponse& response)
|
|||||||
|
|
||||||
foreach(LabelItem * tag, tags)
|
foreach(LabelItem * tag, tags)
|
||||||
{
|
{
|
||||||
response.writeText(QString("%1\t%2\t%3\r\n").arg(tag->getId()).arg(tag->name()).arg(labelColorToRGBString(tag->colorid())));
|
response.write(QString("%1\t%2\t%3\r\n").arg(tag->getId()).arg(tag->name()).arg(labelColorToRGBString(tag->colorid())).toUtf8());
|
||||||
}
|
}
|
||||||
|
|
||||||
response.writeText("",true);
|
response.write("",true);
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ void UpdateComicController::service(HttpRequest &request, HttpResponse &response
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
response.setStatus(412,"No comic info received");
|
response.setStatus(412,"No comic info received");
|
||||||
response.writeText("",true);
|
response.write("",true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,5 +6,5 @@ void VersionController::service(HttpRequest& request, HttpResponse& response)
|
|||||||
{
|
{
|
||||||
Q_UNUSED(request);
|
Q_UNUSED(request);
|
||||||
|
|
||||||
response.writeText(SERVER_VERSION_NUMBER,true);
|
response.write(SERVER_VERSION_NUMBER,true);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user