Skip to content

Commit

Permalink
Code refactoring (cosmetic fixes)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-w committed Jun 27, 2018
1 parent 8c24bd7 commit f3449d7
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions src/core/StelMovementMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ StelMovementMgr::StelMovementMgr(StelCore* acore)
, mouseZoomSpeed(30)
, flagEnableZoomKeys(true)
, flagEnableMoveKeys(true)
, keyMoveSpeed(0.00025)
, keyZoomSpeed(0.00025)
, keyMoveSpeed(0.00025f)
, keyZoomSpeed(0.00025f)
, flagMoveSlow(false)
, movementsSpeedFactor(1.0)
, move()
Expand Down Expand Up @@ -128,7 +128,7 @@ void StelMovementMgr::init()
flagIndicationMountMode = conf->value("gui/flag_indication_mount_mode", false).toBool();

minFov = conf->value("navigation/min_fov",0.001389).toDouble(); // default: minimal FOV = 5"
initFov = conf->value("navigation/init_fov",60.f).toFloat();
initFov = conf->value("navigation/init_fov",60.0).toDouble();
currentFov = initFov;


Expand Down
30 changes: 15 additions & 15 deletions src/core/modules/NebulaMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,31 +237,31 @@ void NebulaMgr::init()

nebulaFont.setPixelSize(StelApp::getInstance().getBaseFontSize());
// Load circle texture
Nebula::texCircle = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb.png");
Nebula::texCircle = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb.png");
// Load circle texture for large DSO
Nebula::texCircleLarge = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_lrg.png");
Nebula::texCircleLarge = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_lrg.png");
// Load ellipse texture
Nebula::texGalaxy = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_gal.png");
Nebula::texGalaxy = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_gal.png");
// Load ellipse texture for large galaxies
Nebula::texGalaxyLarge = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_gal_lrg.png");
Nebula::texGalaxyLarge = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_gal_lrg.png");
// Load open cluster marker texture
Nebula::texOpenCluster = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_ocl.png");
// Load open cluster marker texture for large objects
Nebula::texOpenClusterLarge = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_ocl_lrg.png");
Nebula::texOpenClusterLarge = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_ocl_lrg.png");
// Load open cluster marker texture for extra large objects
Nebula::texOpenClusterXLarge = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_ocl_xlrg.png");
Nebula::texOpenClusterXLarge = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_ocl_xlrg.png");
// Load globular cluster marker texture
Nebula::texGlobularCluster = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_gcl.png");
Nebula::texGlobularCluster = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_gcl.png");
// Load globular cluster marker texture for large GCls
Nebula::texGlobularClusterLarge = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_gcl_lrg.png");
Nebula::texGlobularClusterLarge = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_gcl_lrg.png");
// Load planetary nebula marker texture
Nebula::texPlanetaryNebula = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_pnb.png");
// Load diffuse nebula marker texture
Nebula::texDiffuseNebula = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_dif.png");
Nebula::texDiffuseNebula = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_dif.png");
// Load diffuse nebula marker texture for large DSO
Nebula::texDiffuseNebulaLarge = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_dif_lrg.png");
Nebula::texDiffuseNebulaLarge = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_dif_lrg.png");
// Load diffuse nebula marker texture for extra large DSO
Nebula::texDiffuseNebulaXLarge = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_dif_xlrg.png");
Nebula::texDiffuseNebulaXLarge = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_dif_xlrg.png");
// Load dark nebula marker texture
Nebula::texDarkNebula = StelApp::getInstance().getTextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures/neb_drk.png");
// Load dark nebula marker texture for large DSO
Expand All @@ -275,8 +275,8 @@ void NebulaMgr::init()

setFlagShow(conf->value("astro/flag_nebula",true).toBool());
setFlagHints(conf->value("astro/flag_nebula_name",false).toBool());
setHintsAmount(conf->value("astro/nebula_hints_amount", 3).toFloat());
setLabelsAmount(conf->value("astro/nebula_labels_amount", 3).toFloat());
setHintsAmount(conf->value("astro/nebula_hints_amount", 3.0).toDouble());
setLabelsAmount(conf->value("astro/nebula_labels_amount", 3.0).toDouble());
setHintsProportional(conf->value("astro/flag_nebula_hints_proportional", false).toBool());
setFlagOutlines(conf->value("astro/flag_dso_outlines_usage", false).toBool());
setFlagAdditionalNames(conf->value("astro/flag_dso_additional_names",true).toBool());
Expand Down Expand Up @@ -399,7 +399,7 @@ void NebulaMgr::init()

setFlagUseTypeFilters(conf->value("astro/flag_use_type_filter", false).toBool());

Nebula::CatalogGroup catalogFilters = Nebula::CatalogGroup(0);
Nebula::CatalogGroup catalogFilters = Nebula::CatalogGroup(Q_NULLPTR);

conf->beginGroup("dso_catalog_filters");
if (conf->value("flag_show_ngc", true).toBool())
Expand Down Expand Up @@ -451,7 +451,7 @@ void NebulaMgr::init()
// NB: nebula set loaded inside setter of catalog filter
setCatalogFilters(catalogFilters);

Nebula::TypeGroup typeFilters = Nebula::TypeGroup(0);
Nebula::TypeGroup typeFilters = Nebula::TypeGroup(Q_NULLPTR);

conf->beginGroup("dso_type_filters");
if (conf->value("flag_show_galaxies", true).toBool())
Expand Down
6 changes: 3 additions & 3 deletions src/gui/ConfigurationDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void ConfigurationDialog::createDialogContent()
#endif

// Selected object info
if (gui->getInfoTextFilters() == StelObject::InfoStringGroup(0))
if (gui->getInfoTextFilters() == StelObject::InfoStringGroup(Q_NULLPTR))
{
ui->noSelectedInfoRadio->setChecked(true);
}
Expand Down Expand Up @@ -482,7 +482,7 @@ void ConfigurationDialog::setSphericMirror(bool b)

void ConfigurationDialog::setNoSelectedInfo(void)
{
gui->setInfoTextFilters(StelObject::InfoStringGroup(0));
gui->setInfoTextFilters(StelObject::InfoStringGroup(Q_NULLPTR));
updateSelectedInfoCheckBoxes();
}

Expand Down Expand Up @@ -808,7 +808,7 @@ void ConfigurationDialog::saveAllSettings()

// configuration dialog / selected object info tab
const StelObject::InfoStringGroup& flags = gui->getInfoTextFilters();
if (flags == StelObject::InfoStringGroup(0))
if (flags == StelObject::InfoStringGroup(Q_NULLPTR))
conf->setValue("gui/selected_object_info", "none");
else if (flags == StelObject::InfoStringGroup(StelObject::ShortInfo))
conf->setValue("gui/selected_object_info", "short");
Expand Down
4 changes: 2 additions & 2 deletions src/gui/SkyGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ InfoPanel::InfoPanel(QGraphicsItem* parent) : QGraphicsTextItem("", parent),
}
else if (objectInfo == "none")
{
infoTextFilters = StelObject::InfoStringGroup(0);
infoTextFilters = StelObject::InfoStringGroup(Q_NULLPTR);
}
else if (objectInfo == "custom")
{
infoTextFilters = StelObject::InfoStringGroup(0);
infoTextFilters = StelObject::InfoStringGroup(Q_NULLPTR);

conf->beginGroup("custom_selected_info");
if (conf->value("flag_show_name", false).toBool())
Expand Down
2 changes: 1 addition & 1 deletion src/scripting/StelMainScriptAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ void StelMainScriptAPI::setSelectedObjectInfo(const QString& level)
else if (level == "ShortInfo")
StelApp::getInstance().getGui()->setInfoTextFilters(StelObject::InfoStringGroup(StelObject::ShortInfo));
else if (level == "None")
StelApp::getInstance().getGui()->setInfoTextFilters((StelObject::InfoStringGroup)0);
StelApp::getInstance().getGui()->setInfoTextFilters(StelObject::InfoStringGroup(Q_NULLPTR));
else
qWarning() << "setSelectedObjectInfo unknown level string \"" << level << "\"";
}
Expand Down

0 comments on commit f3449d7

Please sign in to comment.