MultiLevelJsonBase.cpp   MultiLevelJsonBase.cpp 
skipping to change at line 59 skipping to change at line 59
if (networkAccessManager==NULL) if (networkAccessManager==NULL)
{ {
networkAccessManager = new QNetworkAccessManager(&StelApp::g etInstance()); networkAccessManager = new QNetworkAccessManager(&StelApp::g etInstance());
// #if QT_VERSION >= 0x040500 // #if QT_VERSION >= 0x040500
// QNetworkDiskCache* cache = new QNetworkDiskCache(networkAcce ssManager); // QNetworkDiskCache* cache = new QNetworkDiskCache(networkAcce ssManager);
// QString cachePath = QDesktopServices::storageLocation(QDeskt opServices::CacheLocation); // QString cachePath = QDesktopServices::storageLocation(QDeskt opServices::CacheLocation);
// if (cachePath.isEmpty()) // if (cachePath.isEmpty())
// { // {
// cachePath = StelApp::getInstance().getFileMgr().getU serDir()+"/cache"; // cachePath = StelApp::getInstance().getFileMgr().getU serDir()+"/cache";
// } // }
// //qDebug() << cachePath;
// cache->setCacheDirectory(cachePath+"/JSONCache"); // cache->setCacheDirectory(cachePath+"/JSONCache");
// networkAccessManager->setCache(cache); // networkAccessManager->setCache(cache);
// #endif // #endif
connect(networkAccessManager, SIGNAL(finished(QNetworkReply* )), &StelApp::getInstance(), SLOT(reportFileDownloadFinished(QNetworkReply* ))); connect(networkAccessManager, SIGNAL(finished(QNetworkReply* )), &StelApp::getInstance(), SLOT(reportFileDownloadFinished(QNetworkReply* )));
} }
return *networkAccessManager; return *networkAccessManager;
} }
/************************************************************************* /*************************************************************************
Class used to load a JSON file in a thread Class used to load a JSON file in a thread
skipping to change at line 179 skipping to change at line 178
if (url.startsWith("http://")) if (url.startsWith("http://"))
{ {
qurl.setUrl(url); qurl.setUrl(url);
} }
else else
{ {
Q_ASSERT(parent->getBaseUrl().startsWith("http://")) ; Q_ASSERT(parent->getBaseUrl().startsWith("http://")) ;
qurl.setUrl(parent->getBaseUrl()+url); qurl.setUrl(parent->getBaseUrl()+url);
} }
Q_ASSERT(httpReply==NULL); Q_ASSERT(httpReply==NULL);
httpReply = getNetworkAccessManager().get(QNetworkRequest(qu QNetworkRequest req(qurl);
rl)); req.setRawHeader("User-Agent", StelApp::getApplicationName()
.toAscii());
httpReply = getNetworkAccessManager().get(req);
//qDebug() << "Started downloading " << httpReply->request() .url().path(); //qDebug() << "Started downloading " << httpReply->request() .url().path();
Q_ASSERT(httpReply->error()==QNetworkReply::NoError); Q_ASSERT(httpReply->error()==QNetworkReply::NoError);
//qDebug() << httpReply->attribute(QNetworkRequest::SourceIs FromCacheAttribute).toBool(); //qDebug() << httpReply->attribute(QNetworkRequest::SourceIs FromCacheAttribute).toBool();
connect(httpReply, SIGNAL(finished()), this, SLOT(downloadFi nished())); connect(httpReply, SIGNAL(finished()), this, SLOT(downloadFi nished()));
//connect(httpReply, SIGNAL(error(QNetworkReply::NetworkErro r)), this, SLOT(downloadError(QNetworkReply::NetworkError))); //connect(httpReply, SIGNAL(error(QNetworkReply::NetworkErro r)), this, SLOT(downloadError(QNetworkReply::NetworkError)));
//connect(httpReply, SIGNAL(destroyed()), this, SLOT(replyDe stroyed())); //connect(httpReply, SIGNAL(destroyed()), this, SLOT(replyDe stroyed()));
downloading = true; downloading = true;
QString turl = qurl.toString(); QString turl = qurl.toString();
baseUrl = turl.left(turl.lastIndexOf('/')+1); baseUrl = turl.left(turl.lastIndexOf('/')+1);
} }
 End of changes. 2 change blocks. 
3 lines changed or deleted 4 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/