From f7377e686f400126bb8e2a366bf8c304002738cf Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Fri, 14 Aug 2020 14:47:07 +0100 Subject: [PATCH] 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. --- CMakeLists.txt | 2 +- logbook/AD1CCty.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b0931ace..be835a24d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/logbook/AD1CCty.cpp b/logbook/AD1CCty.cpp index 23d34fb43..4112ddfb3 100644 --- a/logbook/AD1CCty.cpp +++ b/logbook/AD1CCty.cpp @@ -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)) {