mirror of
https://github.com/YACReader/yacreader
synced 2025-07-17 20:44:32 -04:00
Format code using clang-format
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
#include "librariescontroller_v2.h"
|
||||
#include "db_helper.h" //get libraries
|
||||
#include "db_helper.h" //get libraries
|
||||
#include "yacreader_libraries.h"
|
||||
|
||||
#include "template.h"
|
||||
@ -9,17 +9,17 @@
|
||||
|
||||
LibrariesControllerV2::LibrariesControllerV2() {}
|
||||
|
||||
void LibrariesControllerV2::service(HttpRequest& /* request */, HttpResponse& response)
|
||||
void LibrariesControllerV2::service(HttpRequest & /* request */, HttpResponse &response)
|
||||
{
|
||||
response.setHeader("Content-Type", "application/json");
|
||||
|
||||
YACReaderLibraries libraries = DBHelper::getLibraries();
|
||||
QList<QString> names = DBHelper::getLibrariesNames();
|
||||
YACReaderLibraries libraries = DBHelper::getLibraries();
|
||||
QList<QString> names = DBHelper::getLibrariesNames();
|
||||
|
||||
QJsonArray librariesJson;
|
||||
|
||||
int currentId = 0;
|
||||
foreach (QString name,names) {
|
||||
int currentId = 0;
|
||||
foreach (QString name, names) {
|
||||
currentId = libraries.getId(name);
|
||||
QJsonObject library;
|
||||
|
||||
@ -27,10 +27,10 @@ void LibrariesControllerV2::service(HttpRequest& /* request */, HttpResponse& re
|
||||
library["id"] = currentId;
|
||||
|
||||
librariesJson.append(library);
|
||||
}
|
||||
}
|
||||
|
||||
QJsonDocument output(librariesJson);
|
||||
|
||||
response.setStatus(200,"OK");
|
||||
response.write(output.toJson(QJsonDocument::Compact),true);
|
||||
response.setStatus(200, "OK");
|
||||
response.write(output.toJson(QJsonDocument::Compact), true);
|
||||
}
|
||||
|
Reference in New Issue
Block a user