Quasars.cpp   Quasars.cpp 
skipping to change at line 85 skipping to change at line 85
info.version = QUASARS_PLUGIN_VERSION; info.version = QUASARS_PLUGIN_VERSION;
return info; return info;
} }
/* /*
Constructor Constructor
*/ */
Quasars::Quasars() Quasars::Quasars()
: QsrCount(0) : QsrCount(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)
, flagShowQuasars(false) , flagShowQuasars(false)
, flagShowQuasarsButton(false) , flagShowQuasarsButton(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("Quasars"); setObjectName("Quasars");
configDialog = new QuasarsDialog(); configDialog = new QuasarsDialog();
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 298 skipping to change at line 298
} }
} }
} }
return result; return result;
} }
StelObjectP Quasars::searchByName(const QString& englishName) const StelObjectP Quasars::searchByName(const QString& englishName) const
{ {
if (!flagShowQuasars) if (!flagShowQuasars)
return NULL; return Q_NULLPTR;
foreach(const QuasarP& quasar, QSO) foreach(const QuasarP& quasar, QSO)
{ {
if (quasar->getEnglishName().toUpper() == englishName.toUppe r()) if (quasar->getEnglishName().toUpper() == englishName.toUppe r())
return qSharedPointerCast<StelObject>(quasar); return qSharedPointerCast<StelObject>(quasar);
} }
return NULL; return Q_NULLPTR;
} }
StelObjectP Quasars::searchByNameI18n(const QString& nameI18n) const StelObjectP Quasars::searchByNameI18n(const QString& nameI18n) const
{ {
if (!flagShowQuasars) if (!flagShowQuasars)
return NULL; return Q_NULLPTR;
foreach(const QuasarP& quasar, QSO) foreach(const QuasarP& quasar, QSO)
{ {
if (quasar->getNameI18n().toUpper() == nameI18n.toUpper()) if (quasar->getNameI18n().toUpper() == nameI18n.toUpper())
return qSharedPointerCast<StelObject>(quasar); return qSharedPointerCast<StelObject>(quasar);
} }
return NULL; return Q_NULLPTR;
} }
QStringList Quasars::listMatchingObjects(const QString& objPrefix, int maxN bItem, bool useStartOfWords, bool inEnglish) const QStringList Quasars::listMatchingObjects(const QString& objPrefix, int maxN bItem, bool useStartOfWords, bool inEnglish) const
{ {
QStringList result; QStringList result;
if (flagShowQuasars) if (flagShowQuasars)
{ {
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 518 skipping to change at line 518
} }
catch (std::runtime_error& e) catch (std::runtime_error& e)
{ {
qDebug() << "[Quasars] File format is wrong! Error:" << e.wh at(); qDebug() << "[Quasars] File format is wrong! Error:" << e.wh at();
return false; return false;
} }
return true; return true;
} }
QuasarP Quasars::getByID(const QString& id) QuasarP Quasars::getByID(const QString& id) const
{ {
foreach(const QuasarP& quasar, QSO) foreach(const QuasarP& quasar, QSO)
{ {
if (quasar->initialized && quasar->designation == id) if (quasar->initialized && quasar->designation == id)
return quasar; return quasar;
} }
return QuasarP(); return QuasarP();
} }
bool Quasars::configureGui(bool show) bool Quasars::configureGui(bool show)
skipping to change at line 621 skipping to change at line 621
{ {
qDebug() << "[Quasars] Starting update..."; qDebug() << "[Quasars] Starting update...";
} }
lastUpdate = QDateTime::currentDateTime(); lastUpdate = QDateTime::currentDateTime();
conf->setValue("Quasars/last_update", lastUpdate.toString(Qt::ISODat e)); conf->setValue("Quasars/last_update", lastUpdate.toString(Qt::ISODat e));
updateState = Quasars::Updating; updateState = Quasars::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 quasars"); progressBar->setFormat("Update quasars");
QNetworkRequest request; QNetworkRequest request;
request.setUrl(QUrl(updateUrl)); request.setUrl(QUrl(updateUrl));
request.setRawHeader("User-Agent", QString("Mozilla/5.0 (Stellarium Quasars Plugin %1; http://stellarium.org/)").arg(QUASARS_PLUGIN_VERSION).to Utf8()); request.setRawHeader("User-Agent", QString("Mozilla/5.0 (Stellarium Quasars Plugin %1; http://stellarium.org/)").arg(QUASARS_PLUGIN_VERSION).to Utf8());
downloadMgr->get(request); downloadMgr->get(request);
skipping to change at line 669 skipping to change at line 669
{ {
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 Quasars::displayMessage(const QString& message, const QString hexColor ) void Quasars::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 Quasars::messageTimeout(void) void Quasars::messageTimeout(void)
skipping to change at line 703 skipping to change at line 703
if (!conf->contains("Quasars/enable_at_startup")) if (!conf->contains("Quasars/enable_at_startup"))
conf->setValue("Quasars/enable_at_startup", b); conf->setValue("Quasars/enable_at_startup", b);
conf->remove("Quasars/flag_show_quasars"); conf->remove("Quasars/flag_show_quasars");
} }
} }
// Define whether the button toggling quasars should be visible // Define whether the button toggling quasars should be visible
void Quasars::setFlagShowQuasarsButton(bool b) void Quasars::setFlagShowQuasarsButton(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 quasars button // Create the quasars button
toolbarButton = new StelButton(NULL, *OnIcon , *OffIcon, *GlowIcon, "actionShow_Quasars"); toolbarButton = new StelButton(Q_NULLPTR, *O nIcon, *OffIcon, *GlowIcon, "actionShow_Quasars");
} }
gui->getButtonBar()->addButton(toolbarButton, "065-p luginsGroup"); gui->getButtonBar()->addButton(toolbarButton, "065-p luginsGroup");
} else { } else {
gui->getButtonBar()->hideButton("actionShow_Quasars" ); gui->getButtonBar()->hideButton("actionShow_Quasars" );
} }
} }
flagShowQuasarsButton = b; flagShowQuasarsButton = b;
} }
bool Quasars::getDisplayMode() bool Quasars::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/