"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/GUI/QtLauncher.cxx" between
flightgear-2020.1.1.tar.bz2 and flightgear-2020.1.2.tar.bz2

About: FlightGear is a multi-platform, cooperative flight simulator development project.

QtLauncher.cxx  (flightgear-2020.1.1.tar.bz2):QtLauncher.cxx  (flightgear-2020.1.2.tar.bz2)
skipping to change at line 114 skipping to change at line 114
if (cache->isRebuildRequired()) { if (cache->isRebuildRequired()) {
QProgressDialog rebuildProgress(baseLabel, QProgressDialog rebuildProgress(baseLabel,
QString() /* cancel text */, QString() /* cancel text */,
0, 100, Q_NULLPTR, 0, 100, Q_NULLPTR,
Qt::Dialog Qt::Dialog
| Qt::CustomizeWindowHint | Qt::CustomizeWindowHint
| Qt::WindowTitleHint | Qt::WindowTitleHint
| Qt::WindowSystemMenuHint | Qt::WindowSystemMenuHint
| Qt::MSWindowsFixedSizeDialogHint); | Qt::MSWindowsFixedSizeDialogHint);
rebuildProgress.setWindowModality(Qt::WindowModal); rebuildProgress.setWindowModality(Qt::WindowModal);
rebuildProgress.setMinimumWidth(600);
rebuildProgress.setAutoReset(false);
rebuildProgress.setAutoClose(false);
rebuildProgress.show(); rebuildProgress.show();
NavDataCache::RebuildPhase phase = cache->rebuild(); QTimer updateTimer;
updateTimer.setInterval(100);
while (phase != NavDataCache::REBUILD_DONE) { QObject::connect(&updateTimer, &QTimer::timeout, [&cache, &rebuildProgre
// sleep to give the rebuild thread more time ss, &baseLabel]() {
SGTimeStamp::sleepForMSec(50); auto phase = cache->rebuild();
phase = cache->rebuild(); if (phase == NavDataCache::REBUILD_DONE) {
rebuildProgress.done(0);
return;
}
auto it = std::find_if(progressStrings.begin(), progressStrings.end( ), [phase] auto it = std::find_if(progressStrings.begin(), progressStrings.end( ), [phase]
(const ProgressLabel& l) { return l.phase == phase; }); (const ProgressLabel& l) { return l.phase == phase; });
if (it == progressStrings.end()) { if (it == progressStrings.end()) {
rebuildProgress.setLabelText(baseLabel); rebuildProgress.setLabelText(baseLabel);
} else { } else {
QString trans = qApp->translate("initNavCache", it->label); QString trans = qApp->translate("initNavCache", it->label);
rebuildProgress.setLabelText(trans); rebuildProgress.setLabelText(trans);
} }
if (phase == NavDataCache::REBUILD_UNKNOWN) { if (phase == NavDataCache::REBUILD_UNKNOWN) {
rebuildProgress.setValue(0); rebuildProgress.setValue(0);
rebuildProgress.setMaximum(0); rebuildProgress.setMaximum(0);
} else { } else {
rebuildProgress.setValue(static_cast<int>(cache->rebuildPhaseCom pletionPercentage())); rebuildProgress.setValue(static_cast<int>(cache->rebuildPhaseCom pletionPercentage()));
rebuildProgress.setMaximum(100); rebuildProgress.setMaximum(100);
} }
});
QCoreApplication::processEvents(); updateTimer.start(); // timer won't actually run until we process events
} rebuildProgress.exec();
updateTimer.stop();
} }
} }
class NaturalEarthDataLoaderThread : public QThread class NaturalEarthDataLoaderThread : public QThread
{ {
Q_OBJECT Q_OBJECT
public: public:
NaturalEarthDataLoaderThread() : NaturalEarthDataLoaderThread() :
m_lineInsertCount(0) m_lineInsertCount(0)
 End of changes. 4 change blocks. 
8 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)