Pulsars.cpp   Pulsars.cpp 
skipping to change at line 85 skipping to change at line 85
info.version = PULSARS_PLUGIN_VERSION; info.version = PULSARS_PLUGIN_VERSION;
return info; return info;
} }
/* /*
Constructor Constructor
*/ */
Pulsars::Pulsars() Pulsars::Pulsars()
: PsrCount(0) : PsrCount(0)
, updateState(CompleteNoUpdates) , updateState(CompleteNoUpdates)
, downloadMgr(NULL) , downloadMgr(Q_NULLPTR)
, updateTimer(0) , updateTimer(Q_NULLPTR)
, messageTimer(0) , messageTimer(Q_NULLPTR)
, updatesEnabled(false) , updatesEnabled(false)
, updateFrequencyDays(0) , updateFrequencyDays(0)
, enableAtStartup(false) , enableAtStartup(false)
, flagShowPulsars(false) , flagShowPulsars(false)
, flagShowPulsarsButton(false) , flagShowPulsarsButton(false)
, OnIcon(NULL) , OnIcon(Q_NULLPTR)
, OffIcon(NULL) , OffIcon(Q_NULLPTR)
, GlowIcon(NULL) , GlowIcon(Q_NULLPTR)
, toolbarButton(NULL) , toolbarButton(Q_NULLPTR)
, progressBar(NULL) , progressBar(Q_NULLPTR)
{ {
setObjectName("Pulsars"); setObjectName("Pulsars");
configDialog = new PulsarsDialog(); configDialog = new PulsarsDialog();
conf = StelApp::getInstance().getSettings(); conf = StelApp::getInstance().getSettings();
font.setPixelSize(StelApp::getInstance().getBaseFontSize()); font.setPixelSize(StelApp::getInstance().getBaseFontSize());
} }
/* /*
Destructor Destructor
*/ */
skipping to change at line 297 skipping to change at line 297
} }
} }
} }
return result; return result;
} }
StelObjectP Pulsars::searchByName(const QString& englishName) const StelObjectP Pulsars::searchByName(const QString& englishName) const
{ {
if (!flagShowPulsars) if (!flagShowPulsars)
return NULL; return Q_NULLPTR;
foreach(const PulsarP& pulsar, psr) foreach(const PulsarP& pulsar, psr)
{ {
if (pulsar->getEnglishName().toUpper() == englishName.toUppe r()) if (pulsar->getEnglishName().toUpper() == englishName.toUppe r())
return qSharedPointerCast<StelObject>(pulsar); return qSharedPointerCast<StelObject>(pulsar);
} }
return NULL; return Q_NULLPTR;
} }
StelObjectP Pulsars::searchByNameI18n(const QString& nameI18n) const StelObjectP Pulsars::searchByNameI18n(const QString& nameI18n) const
{ {
if (!flagShowPulsars) if (!flagShowPulsars)
return NULL; return Q_NULLPTR;
foreach(const PulsarP& pulsar, psr) foreach(const PulsarP& pulsar, psr)
{ {
if (pulsar->getNameI18n().toUpper() == nameI18n.toUpper()) if (pulsar->getNameI18n().toUpper() == nameI18n.toUpper())
return qSharedPointerCast<StelObject>(pulsar); return qSharedPointerCast<StelObject>(pulsar);
} }
return NULL; return Q_NULLPTR;
} }
QStringList Pulsars::listMatchingObjects(const QString& objPrefix, int maxN bItem, bool useStartOfWords, bool inEnglish) const QStringList Pulsars::listMatchingObjects(const QString& objPrefix, int maxN bItem, bool useStartOfWords, bool inEnglish) const
{ {
QStringList result; QStringList result;
if (flagShowPulsars) if (flagShowPulsars)
{ {
result = StelObjectModule::listMatchingObjects(objPrefix, ma xNbItem, useStartOfWords, inEnglish); result = StelObjectModule::listMatchingObjects(objPrefix, ma xNbItem, useStartOfWords, inEnglish);
} }
return result; return result;
skipping to change at line 516 skipping to change at line 516
} }
catch (std::runtime_error& e) catch (std::runtime_error& e)
{ {
qDebug() << "[Pulsars] File format is wrong! Error:" << e.wh at(); qDebug() << "[Pulsars] File format is wrong! Error:" << e.wh at();
return false; return false;
} }
return true; return true;
} }
PulsarP Pulsars::getByID(const QString& id) PulsarP Pulsars::getByID(const QString& id) const
{ {
foreach(const PulsarP& pulsar, psr) foreach(const PulsarP& pulsar, psr)
{ {
if (pulsar->initialized && pulsar->designation == id) if (pulsar->initialized && pulsar->designation == id)
return pulsar; return pulsar;
} }
return PulsarP(); return PulsarP();
} }
bool Pulsars::configureGui(bool show) bool Pulsars::configureGui(bool show)
skipping to change at line 625 skipping to change at line 625
{ {
qDebug() << "[Pulsars] Starting update..."; qDebug() << "[Pulsars] Starting update...";
} }
lastUpdate = QDateTime::currentDateTime(); lastUpdate = QDateTime::currentDateTime();
conf->setValue("Pulsars/last_update", lastUpdate.toString(Qt::ISODat e)); conf->setValue("Pulsars/last_update", lastUpdate.toString(Qt::ISODat e));
updateState = Pulsars::Updating; updateState = Pulsars::Updating;
emit(updateStateChanged(updateState)); emit(updateStateChanged(updateState));
if (progressBar==NULL) if (progressBar==Q_NULLPTR)
progressBar = StelApp::getInstance().addProgressBar(); progressBar = StelApp::getInstance().addProgressBar();
progressBar->setValue(0); progressBar->setValue(0);
progressBar->setRange(0, 100); progressBar->setRange(0, 100);
progressBar->setFormat("Update pulsars"); progressBar->setFormat("Update pulsars");
QNetworkRequest request; QNetworkRequest request;
request.setUrl(QUrl(updateUrl)); request.setUrl(QUrl(updateUrl));
request.setRawHeader("User-Agent", QString("Mozilla/5.0 (Stellarium Pulsars Plugin %1; http://stellarium.org/)").arg(PULSARS_PLUGIN_VERSION).to Utf8()); request.setRawHeader("User-Agent", QString("Mozilla/5.0 (Stellarium Pulsars Plugin %1; http://stellarium.org/)").arg(PULSARS_PLUGIN_VERSION).to Utf8());
downloadMgr->get(request); downloadMgr->get(request);
skipping to change at line 673 skipping to change at line 673
{ {
jsonFile.write(reply->readAll()); jsonFile.write(reply->readAll());
jsonFile.close(); jsonFile.close();
} }
} }
if (progressBar) if (progressBar)
{ {
progressBar->setValue(100); progressBar->setValue(100);
StelApp::getInstance().removeProgressBar(progressBar); StelApp::getInstance().removeProgressBar(progressBar);
progressBar=NULL; progressBar=Q_NULLPTR;
} }
} }
void Pulsars::displayMessage(const QString& message, const QString hexColor ) void Pulsars::displayMessage(const QString& message, const QString hexColor )
{ {
messageIDs << GETSTELMODULE(LabelMgr)->labelScreen(message, 30, 30 + (20*messageIDs.count()), true, 16, hexColor); messageIDs << GETSTELMODULE(LabelMgr)->labelScreen(message, 30, 30 + (20*messageIDs.count()), true, 16, hexColor);
messageTimer->start(); messageTimer->start();
} }
void Pulsars::messageTimeout(void) void Pulsars::messageTimeout(void)
skipping to change at line 707 skipping to change at line 707
if (!conf->contains("Pulsars/enable_at_startup")) if (!conf->contains("Pulsars/enable_at_startup"))
conf->setValue("Pulsars/enable_at_startup", b); conf->setValue("Pulsars/enable_at_startup", b);
conf->remove("Pulsars/flag_show_pulsars"); conf->remove("Pulsars/flag_show_pulsars");
} }
} }
// Define whether the button toggling pulsars should be visible // Define whether the button toggling pulsars should be visible
void Pulsars::setFlagShowPulsarsButton(bool b) void Pulsars::setFlagShowPulsarsButton(bool b)
{ {
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( )); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( ));
if (gui!=NULL) if (gui!=Q_NULLPTR)
{ {
if (b==true) { if (b==true) {
if (toolbarButton==NULL) { if (toolbarButton==Q_NULLPTR) {
// Create the pulsars button // Create the pulsars button
toolbarButton = new StelButton(NULL, *OnIcon , *OffIcon, *GlowIcon, "actionShow_Pulsars"); toolbarButton = new StelButton(Q_NULLPTR, *O nIcon, *OffIcon, *GlowIcon, "actionShow_Pulsars");
} }
gui->getButtonBar()->addButton(toolbarButton, "065-p luginsGroup"); gui->getButtonBar()->addButton(toolbarButton, "065-p luginsGroup");
} else { } else {
gui->getButtonBar()->hideButton("actionShow_Pulsars" ); gui->getButtonBar()->hideButton("actionShow_Pulsars" );
} }
} }
flagShowPulsarsButton = b; flagShowPulsarsButton = b;
} }
bool Pulsars::getDisplayMode() bool Pulsars::getDisplayMode()
 End of changes. 12 change blocks. 
18 lines changed or deleted 18 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/