Commit 28bd01593abc7a641cb4bcfb135e9daf9f4b1ffa
1 parent
803b997f
Fix loss of application name and version (#1835)
The application name and version were cleared in a call of the GApplication::clear() method, but these properties should be conserved. Now they are, and a call of the GApplication::clear() will perform the same actions than a call of the name and version constructor.
Showing
4 changed files
with
28 additions
and
3 deletions
ChangeLog
| 1 | -2016-08-03 | 1 | +2016-08-04 |
| 2 | 2 | ||
| 3 | * Version 1.2.0 released | 3 | * Version 1.2.0 released |
| 4 | ========================= | 4 | ========================= |
| 5 | 5 | ||
| 6 | + Fix loss of application name and version (#1835) | ||
| 6 | Add methods for logging in applications (#1828) | 7 | Add methods for logging in applications (#1828) |
| 7 | Fix removal of Python wrappers after make clean (#1826) | 8 | Fix removal of Python wrappers after make clean (#1826) |
| 8 | Add GModelSpectralExpInvPlaw class (#1800) | 9 | Add GModelSpectralExpInvPlaw class (#1800) |
NEWS
| 1 | New Features and Important Changes in GammaLib 1.2.0 | 1 | New Features and Important Changes in GammaLib 1.2.0 |
| 2 | 2 | ||
| 3 | -3 August 2016 | 3 | +4 August 2016 |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | 1. Introduction | 6 | 1. Introduction |
| @@ -58,6 +58,10 @@ log_header2(), and log_header3() have been introduced. There are three | @@ -58,6 +58,10 @@ log_header2(), and log_header3() have been introduced. There are three | ||
| 58 | variants of log_value() for strings, integers and double precision values | 58 | variants of log_value() for strings, integers and double precision values |
| 59 | (#1828). | 59 | (#1828). |
| 60 | 60 | ||
| 61 | +The application name and version and now conserved in a GApplication::clear() | ||
| 62 | +method call and the application is properly initialised like in the call of | ||
| 63 | +a constructor (#1835). | ||
| 64 | + | ||
| 61 | 65 | ||
| 62 | 5. Base module | 66 | 5. Base module |
| 63 | -------------- | 67 | -------------- |
README.md
| 1 | GammaLib information | 1 | GammaLib information |
| 2 | ==================== | 2 | ==================== |
| 3 | -* Version: 1.2.0.dev1 (3 August 2016) | 3 | +* Version: 1.2.0.dev1 (4 August 2016) |
| 4 | * Author: Juergen Knoedlseder (jurgen.knodlseder@irap.omp.eu) | 4 | * Author: Juergen Knoedlseder (jurgen.knodlseder@irap.omp.eu) |
| 5 | 5 | ||
| 6 | [](https://cta-jenkins.irap.omp.eu/job/gammalib-integrate-os/) | 6 | [](https://cta-jenkins.irap.omp.eu/job/gammalib-integrate-os/) |
src/app/GApplication.cpp
| @@ -238,12 +238,32 @@ GApplication& GApplication::operator=(const GApplication& app) | @@ -238,12 +238,32 @@ GApplication& GApplication::operator=(const GApplication& app) | ||
| 238 | ***************************************************************************/ | 238 | ***************************************************************************/ |
| 239 | void GApplication::clear(void) | 239 | void GApplication::clear(void) |
| 240 | { | 240 | { |
| 241 | + // Save application name and version as we need them to reconstruct | ||
| 242 | + // the application after freeing and initialising its members | ||
| 243 | + std::string name = m_name; | ||
| 244 | + std::string version = m_version; | ||
| 245 | + | ||
| 241 | // Free members | 246 | // Free members |
| 242 | free_members(); | 247 | free_members(); |
| 243 | 248 | ||
| 244 | // Initialise members | 249 | // Initialise members |
| 245 | init_members(); | 250 | init_members(); |
| 246 | 251 | ||
| 252 | + // Recover saved application name and version | ||
| 253 | + m_name = name; | ||
| 254 | + m_version = version; | ||
| 255 | + | ||
| 256 | + // Set default parfile and logfile name | ||
| 257 | + m_parfile = name+".par"; | ||
| 258 | + m_logfile = name+".log"; | ||
| 259 | + | ||
| 260 | + // Initialise application parameters | ||
| 261 | + m_pars.load(par_filename()); | ||
| 262 | + | ||
| 263 | + // Set log filename and chattiness | ||
| 264 | + set_log_filename(); | ||
| 265 | + set_log_chatter(); | ||
| 266 | + | ||
| 247 | // Return | 267 | // Return |
| 248 | return; | 268 | return; |
| 249 | } | 269 | } |