LocationSearchService.cpp   LocationSearchService.cpp 
skipping to change at line 32 skipping to change at line 32
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelLocationMgr.hpp" #include "StelLocationMgr.hpp"
#include <QJsonArray> #include <QJsonArray>
#include <QJsonDocument> #include <QJsonDocument>
#include <QJsonObject> #include <QJsonObject>
#include <QRegExp> #include <QRegExp>
LocationSearchService::LocationSearchService(const QByteArray &serviceName, LocationSearchService::LocationSearchService(QObject *parent)
QObject *parent) : AbstractAPIService(parent), locMgr(LocationList())
: AbstractAPIService(serviceName,parent), locMgr(LocationList())
{ {
//this is run in the main thread //this is run in the main thread
connect(&StelApp::getInstance().getLocationMgr(), SIGNAL(locationLis tChanged()), this, SLOT(mainLocationManagerUpdated())); connect(&StelApp::getInstance().getLocationMgr(), SIGNAL(locationLis tChanged()), this, SLOT(mainLocationManagerUpdated()));
mainLocationManagerUpdated(); mainLocationManagerUpdated();
} }
void LocationSearchService::mainLocationManagerUpdated() void LocationSearchService::mainLocationManagerUpdated()
{ {
//this is run in the main thread //this is run in the main thread
locMgrMutex.lock(); locMgrMutex.lock();
//copy the contents of the location manager //copy the contents of the location manager
locMgr.setLocations(StelApp::getInstance().getLocationMgr().getAll() ); locMgr.setLocations(StelApp::getInstance().getLocationMgr().getAll() );
locMgrMutex.unlock(); locMgrMutex.unlock();
} }
void LocationSearchService::getImpl(const QByteArray& operation, const APIP arameters &parameters, APIServiceResponse &response) void LocationSearchService::get(const QByteArray& operation, const APIParam eters &parameters, APIServiceResponse &response)
{ {
if(operation=="search") if(operation=="search")
{ {
//parameter must be named "term" to be compatible with jQuer y UI autocomplete without further JS code //parameter must be named "term" to be compatible with jQuer y UI autocomplete without further JS code
QString term = QString::fromUtf8(parameters.value("term")); QString term = QString::fromUtf8(parameters.value("term"));
if(term.isEmpty()) if(term.isEmpty())
{ {
response.writeRequestError("needs non-empty 'term' p arameter"); response.writeRequestError("needs non-empty 'term' p arameter");
return; return;
 End of changes. 2 change blocks. 
4 lines changed or deleted 3 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/