Skip to content

Fix bugs involving the reading and writing of user's notes (logs) on objects

Akarsh Simha requested to merge asimha/kstars:user/akarsh/fix_userlog into master

The user log functionality allows a user to make notes on objects within KStars, for example in the observation planner or in the details dialog. These notes are intended to be free-form multiline text.

However, there were two problems:

  1. The log file was read from share/kstars/userlog.dat but was written into share/kstarsuserlog.dat (missing path joiner).

  2. The log-reading code made several assumptions about the entries, such as the lack of ] in the object name as well as in the text. This is a problem because many object designations do have [ and ] in them, and it is typical for people to want to include these brackets in the notes as well.

This change fixes both problems. In particular, it supports balanced square brackets in the names of objects and it supports unbalanced square brackets in the user's notes. The keywords [KSLABEL: and [KSLogEnd] are reserved for parsing.

More information about problem 2:

When objects are described in a research paper, SIMBAD as well as NED typically put the authors' first initials in square brackets followed by the year of the paper. Here are some examples:

[CS82] C39 -- the brightest globular in M33
[MSB 2017] -- candidate dwarf galaxy that's a satellite of M63

So it is unwise to assume that object names will not contain [,].

The present code will raise parsing issues rather than quietly proceeding.

Edited by Akarsh Simha

Merge request reports