Skip to content

Commit

Permalink
Hips: load the sources after proxy set-up
Browse files Browse the repository at this point in the history
I added a singlShot timer so that the loading starts on the next clock
tick, to make sure that the proxy has time to be set up before.
  • Loading branch information
guillaumechereau committed Mar 26, 2018
1 parent fab9a87 commit ac7282e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/core/modules/HipsMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include <QNetworkReply>
#include <QSettings>
#include <QTimer>

HipsMgr::HipsMgr()
{
Expand Down Expand Up @@ -56,11 +57,10 @@ HipsMgr::~HipsMgr()
conf->sync();
}

void HipsMgr::init()
void HipsMgr::loadSources()
{
QSettings* conf = StelApp::getInstance().getSettings();
conf->beginGroup("hips");
setFlagShow(conf->value("show", true).toBool());

// Start to load survey lists
QStringList sources;
Expand Down Expand Up @@ -93,10 +93,20 @@ void HipsMgr::init()
emit surveysChanged();
});
}
conf->endGroup();
}

void HipsMgr::init()
{
QSettings* conf = StelApp::getInstance().getSettings();
conf->beginGroup("hips");
setFlagShow(conf->value("show", true).toBool());
conf->endGroup();

addAction("actionShow_Hips_Surveys", N_("Display Options"), N_("Toggle Hierarchical Progressive Surveys (experimental)"), "flagShow", "Ctrl+Alt+D");

// Start loading the sources only after stellarium has time to set up the proxy.
QTimer::singleShot(0, this, SLOT(loadSources()));
}


Expand Down
2 changes: 2 additions & 0 deletions src/core/modules/HipsMgr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class HipsMgr : public StelModule
private slots:
// after loading survey list from network, restore the visible surveys from config.ini.
void restoreVisibleSurveys();
//! Start to load the default sources.
void loadSources();

private:
QList<HipsSurveyP> surveys;
Expand Down

0 comments on commit ac7282e

Please sign in to comment.