SimbadSearcher.cpp   SimbadSearcher.cpp 
skipping to change at line 55 skipping to change at line 55
{ {
reply = netMgr->get(QNetworkRequest(url)); reply = netMgr->get(QNetworkRequest(url));
connect(reply, SIGNAL(finished()), this, SLOT(httpQueryFinished())); connect(reply, SIGNAL(finished()), this, SLOT(httpQueryFinished()));
} }
void SimbadLookupReply::httpQueryFinished() void SimbadLookupReply::httpQueryFinished()
{ {
if (reply->error()!=QNetworkReply::NoError) if (reply->error()!=QNetworkReply::NoError)
{ {
currentStatus = SimbadLookupErrorOccured; currentStatus = SimbadLookupErrorOccured;
errorString = q_("Network error: %1").arg(reply->errorString ()); errorString = QString("%1: %2").arg(q_("Network error")).arg (reply->errorString());
emit statusChanged(); emit statusChanged();
return; return;
} }
// No error, try to parse the Simbad result // No error, try to parse the Simbad result
QByteArray line; QByteArray line;
bool found = false; bool found = false;
//qDebug() << reply->readAll(); //qDebug() << reply->readAll();
reply->reset(); reply->reset();
while (!reply->atEnd()) while (!reply->atEnd())
skipping to change at line 134 skipping to change at line 134
// Get a I18n string describing the current status. // Get a I18n string describing the current status.
QString SimbadLookupReply::getCurrentStatusString() const QString SimbadLookupReply::getCurrentStatusString() const
{ {
switch (currentStatus) switch (currentStatus)
{ {
case SimbadLookupQuerying: case SimbadLookupQuerying:
return q_("Querying"); return q_("Querying");
case SimbadLookupErrorOccured: case SimbadLookupErrorOccured:
return q_("Error"); return q_("Error");
case SimbadLookupFinished: case SimbadLookupFinished:
return resultPositions.isEmpty() ? "Not found" : "Fo und"; return resultPositions.isEmpty() ? q_("Not found") : q_("Found");
} }
return QString(); return QString();
} }
SimbadSearcher::SimbadSearcher(QObject* parent) : QObject(parent) SimbadSearcher::SimbadSearcher(QObject* parent) : QObject(parent)
{ {
networkMgr = new QNetworkAccessManager(this); networkMgr = new QNetworkAccessManager(this);
} }
// Lookup in Simbad for the passed object name. // Lookup in Simbad for the passed object name.
SimbadLookupReply* SimbadSearcher::lookup(const QString& objectName, int ma xNbResult, int delayMs) SimbadLookupReply* SimbadSearcher::lookup(const QString& serverUrl, const Q String& objectName, int maxNbResult, int delayMs)
{ {
// Create the Simbad query // Create the Simbad query
QString url("http://simbad.u-strasbg.fr/simbad/sim-script?script=for QString url(serverUrl);
mat object \"%COO(d;A D)\\n%IDLIST(1)\"\n"); url += "simbad/sim-script?script=format object \"%COO(d;A D)\\n%IDLI
ST(1)\"\n";
url += QString("set epoch J2000\nset limit %1\n query id ").arg(maxN bResult); url += QString("set epoch J2000\nset limit %1\n query id ").arg(maxN bResult);
url += objectName; url += objectName;
return new SimbadLookupReply(url, networkMgr, delayMs); return new SimbadLookupReply(url, networkMgr, delayMs);
} }
 End of changes. 4 change blocks. 
5 lines changed or deleted 6 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/