Move bundled cty.dat from resources FS to installation data dir

This file is only used at start up so there is little point to keeping
it in program memory.
This commit is contained in:
Bill Somerville 2020-08-14 14:47:07 +01:00
parent 7eb229ecde
commit f7377e686f
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F
2 changed files with 3 additions and 3 deletions

View File

@ -748,7 +748,6 @@ set (all_C_and_CXXSRCS
)
set (TOP_LEVEL_RESOURCES
cty.dat
icons/Darwin/wsjtx.iconset/icon_128x128.png
contrib/gpl-v3-logo.svg
artwork/splash.png
@ -1574,6 +1573,7 @@ install (FILES
)
install (FILES
cty.dat
contrib/Ephemeris/JPLEPH
DESTINATION ${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME}
#COMPONENT runtime

View File

@ -319,12 +319,12 @@ AD1CCty::AD1CCty (Configuration const * configuration)
{
Q_ASSERT (configuration);
// TODO: G4WJS - consider doing the following asynchronously to
// speed up startup. Not urgent as it takes less than 1s on a Core
// speed up startup. Not urgent as it takes less than 0.5s on a Core
// i7 reading BIG CTY.DAT.
QDir dataPath {QStandardPaths::writableLocation (QStandardPaths::DataLocation)};
m_->path_ = dataPath.exists (file_name)
? dataPath.absoluteFilePath (file_name) // user override
: QString {":/"} + file_name; // or original in the resources FS
: configuration->data_dir ().absoluteFilePath (file_name); // or original
QFile file {m_->path_};
if (file.open (QFile::ReadOnly))
{