Commit graph

4528 commits

Author SHA1 Message Date
Dirk Hohndel
cb41f34826 Don't put cylinder widget in edit mode if deletion of cylinder failed
If the user tries to delete a cylinder that is in use and that action is
rejected, the cylinder widget (and the whole dive) should not be put into
edit mode. After all, nothing changed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-15 15:38:10 -07:00
Jan Mulder
a636e4f2c1 Add test dive to show erroneous pp graphs
Add simple test dive to show the erroneous pp graph in case of
multiple periods of high p02. See commit aa0cd792bb for the fix.

Signed-off-by: Jan Mulder <jlmulder@planet.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-15 15:01:08 -07:00
Dirk Hohndel
36ba353450 Correctly check if tank is in use
We always checked if the tank was in use by the planner / dive editor -
even if we were not in dive edit mode.

With this patch, when not in dive edit mode, we check our cylinder "used"
flag instead.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-15 14:56:32 -07:00
Dirk Hohndel
4a1b9312f3 Don't check for tank size information only on first tank
commit d681bdcb63 ("Only use default cylinder for first one") has a
stupid bug in that it only calls get_tanksize for the first tank. That's
of course completely bogus.

Thanks to Linus for catching this.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-15 13:46:35 -07:00
Dirk Hohndel
d681bdcb63 Only use default cylinder for first one
When downloading from a divecomputer it makes little sense to assume that
all tanks are the default cylinder.

There's a good case to be made for having a default first cylinder (you
always dive with your own cylinder, or you are always on a dive boat with
AL80 tanks), but in multi-cylinder situations this is much more likely to
cause unintended harm; for example for those dive computers that always
report their maximum number of cylinders, even if some of them aren't
used.  Here setting a default cylinder turns those entries from obviously
empty into something that appears to have meaning (i.e., cylinder type is
filled in) even though this was just a default added by Subsurface.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-15 13:16:03 -07:00
Dirk Hohndel
6ba140571e Only use a default cylinder if it is explicitly set
We used to fall back to an AL80 default cylinder, but that meant that a
user who doesn't want a default cylinder at all had no way to indicate
that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-15 13:09:36 -07:00
Jan Mulder
aa0cd792bb Bugfix: generalize pp graphs to allow for multi over-threshold periods
Especially in O2 decompression parts of a dive, the pp02 is typically very
close to the threshold value (normally 1.60 bar). The old implementation
of the pp profile graphs assumes that there is exacty 1 consecutive set of
samples that needs to be in the "warning color". This results in an
erroneous display of the mentioned graphs, connecting multiple episodes of
too high pp with bogus lines in between.

This fix generalizes the pp graph logic to allow for multiple segments of
high pp, each to been drawn seperately in the "warning color".

Signed-off-by: Jan Mulder <jlmulder@planet.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-15 12:07:34 -07:00
Willem Ferguson
ce6f2cdda4 User manual: Add the missing icons
Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-15 09:48:49 -07:00
Dirk Hohndel
781b2e35d4 Revert "If saving to a git repository fails, don't create oddly named XML file"
This reverts commit e70bbb637e

Linus' solution in commit 27c36ec4cf ("Improved handling of git syntax
names with no git repository") is much better and makes my hack
unnecessary.
2014-03-14 21:01:13 -07:00
Linus Torvalds
27c36ec4cf Improved handling of git syntax names with no git repository
This makes "is_git_repository()" return non-NULL for all file names that
match the git name pattern, even if we don't find an actual git
repository there.  That way, we won't fall back to writing out an XML
file with an odd filename.

If there is no actual git repository, we return a special invalid dummy
pointer, and then the git reading and writing routines will catch it and
return the appropriate error.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-14 20:54:20 -07:00
Dirk Hohndel
e70bbb637e If saving to a git repository fails, don't create oddly named XML file
Before this change when the user gave a git style filename, say
/tmp/mydives[myname], if Subsurface couldn't create a repository with that
branch, it instead saved an XML file to this exact name, with '[' and ']'.
That clearly is not the desired behavior, so report an error instead.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-14 16:01:52 -07:00
Dirk Hohndel
8650a6ef6c Make "save changes" dialog modal
This definitely seems to be a good candidate for a modal dialog.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-14 16:01:09 -07:00
Willem Ferguson
f4d56ddf6f Revision of Profile part of manual
The last figures in the manual using the Unity desktop have been replaced
with equivalent figures using Gnome 3. There should now be no figures
remaining from Unity.

This is a revision of the profile part of the manual in the light of the
changes for V4.1. Text has been moved around, some new text added or
rewritten. Graphics has been replaced to reflect the UI for V4.1,
including Tomaz's button bar and Louisa's new buttons for that bar.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-14 15:31:37 -07:00
Linus Torvalds
609715ab69 Convert other users of showError() to the new world order
The "report_error()" interface is a lot simpler, although some of the
C++ code uses QStrings which make them a bit annoying, especially for
the varargs model.  Still, even with the explicit conversion to UTF8 and
"char *", the report_error() model is much nicer.

This also just makes refreshDisplay() do the error reporting in the UI
automatically, so a number of error paths don't even have to worry.  And
the multi-line model of error reporting means that it all automatically
does the right thing, and reports errors for each file rather than just
for the last file that failed to open.

So this removes closer to a hundred lines of cruft, while being a
simpler interface and doing better error reporting.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-14 12:36:06 -07:00
Linus Torvalds
ec33a95ad0 show the error string in the GUI rather than stderr
This makes the error string just be an internal "membuffer", which the
GUI can fetch and show when errors occur.  The error string keeps
accumulating until somebody retrieves it with "get_error_string()".

This should make any write errors actually show up to the user.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-14 10:49:56 -07:00
Linus Torvalds
b5d0cfd557 propagate save errors further, don't mark divelist unchanged
This at least avoids marking the dive list as unchanged on a failed
write, and propagates the error further up the stack.

We still don't show the error string in the GUI, though.  I'll start
doing that next, I think.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-14 10:49:53 -07:00
Linus Torvalds
76d4e3d916 error handling: return errors for save functions
Note! This just returns the error (and uses "report_error()" to generate
a string that is currently printed to stderr).  Nothing actually *uses*
that error return yet, and we don't show the error string in the GUI.

Baby steps.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-14 10:49:07 -07:00
Linus Torvalds
717f4ef102 git access: allow arbitrary revision specifiers on reading
Commit 13e2210d75 ("Allow remote branch names when reading a git
object tree") made it possible to read (but not write) remote branches,
which is very convenient when you just want to look at somebody elses
dives in a shared repository.

However, it was really quite stupidly done - both overly complicated,
and overly restrictive.

It's much better and simpler to just allow general git revision
specifications, which includes branches (both remote and local) as a
simple case, but also allows general git revision expressions.  So you
can tag things, and use a tag-name instead.  Or you can say that you
want to look at the previous save, by using the "branchname^" syntax.

Or, you can use the git reflog, and do things like

   subsurface ~/scuba/[linus@{two.days.ago}]

to see the dives that your repository contained two days ago.

Obviously, you will not be able to save to this kind of ref-spec (and I
really will have to make error handling work better), but for browsing
state it's quite useful.

And in git terms, this is actually simpler than the "lets try to first
see if we have a local branch of that name, and then if we have a remote
one", as shown by the fact that this removes more lines than it adds.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-14 10:48:18 -07:00
Linus Torvalds
3fe0019bc2 git object format: make sure parenthood isn't lost when saving
This makes subsurface remember the git source commit of the dive data.

If you save to an existing branch, subsurface will now complain and
refuse to save if you try to save if the existing branch is not related
to the original source.  That would destroy the history of the dive
data, which in turn would make it impossible to do sane merging of the
data.

If you save to a new branch, it will see if the previous parent commit
is known in the repository you are saving to, and will save parenthood
information if so.  Otherwise it will save it as a new parentless commit
("root commit" in git parlance).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-13 20:48:31 -07:00
Luisa Pires
0b114a198e New icons
These are contributed to Subsurface under GPL.

Signed-off-by: Luisa Pires <luisapiresdesign@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-13 16:14:51 -07:00
Dirk Hohndel
ae2f18678d New profile: fix Information overlay location
By simply storing the coordinates based on the scene (instead of trying to
map them to real coordinates) the overlay position is correctly restored.

Also remove the redundant positioning before readPos is called.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-13 10:28:15 -07:00
Linus Torvalds
13e2210d75 Allow remote branch names when reading a git object tree
This is the quick hack to read from a remote branch, which allows you to
look at other peoples branches when sharing a git tree.

Note that the "remote" part of "remote branch" is the _git_ meaning of a
remote branch: it is the local cached copy from a remote.  This does not
imply any kind of network traffic - but if you have done a "git fetch"
to get branches from some other source, you can now use the remote
branch-name to see them in subsurface.

Also notice that you should *NOT* save the end result.  It will "work",
but it won't do what you think it does.  Saving does not update the
remote branch, it would create a new *local* branch with that same
branch-name, and since it's a new branch, it would do so with no
parenthood information. So you'll be very very confused.

I think I'll add code to remember the parent when loading from a git
repository, and then use that remembered information when saving.  So
then you could create a real local branch with real history.  But that's
an independent issue from this loading case.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-13 08:18:32 -07:00
Miika Turkia
7a999a875e Create Documentation directory if missing
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-12 19:54:38 -07:00
Linus Torvalds
7902af246c Stop using the "git descriptor file" model
Instead, just encode the git repository information in the filename.

We want to make it much harder to make it match a real filename, but to
still allow easy browsing with the file manager interface.  So the git
repository "filename" format is the path to the git repository
directory, with the branch name encoded as "[branch]" at the end rather
than the "path:branch" format that we used in the descriptor file.

[ For example, on Windows, a filename like "c:\my.xml" could be
  interpreted as the branchame "\my.xml" in the repository in the
  directory "c" ]

In particular, with this model, no filename that ends with ".xml" could
possibly ever be considered a git repository name, since the last
character of a git pathname is always ']'.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-12 19:41:19 -07:00
Lubomir I. Ivanov
5b3dab719e MainWindow: maintain one window instance of the yearly statistics
This is a bit tricky because we are using a plain widget for
a window and don't have a class for it (req. more source files).
Also for the table model to update we need to create a new
YearlyStatisticsModel instance each time. At least, in that regard
we can re-create the model each time refreshDisplay() is called.

This patch adds a couple of private variables that are used
to manage the memory of the yearly statistics model and window
and also close that same window on MainWindow::closeEvent().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-12 12:12:13 -07:00
Lubomir I. Ivanov
4abe9d5c8b Profile2: place the ruler and tooltip on top (Z order)
The topmost Z order of items in the profile should be:
- background (poster / logo)
- toolTipItem
- rulerItem
...

This mostly fixes the ruler being under other elements.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-12 11:25:23 -07:00
Lubomir I. Ivanov
f2bfc72648 Ruler: change how the ruler text drawing works
A couple of problems with the ruler:
- the rotated text doesn't look very well at all and interpolation doesn't
  help it much
- measuring towards the right most part of the profile makes the text go
  out of the screen

To solve these issues and attempt to improve the ruler this patch does the
following:
- place the text at the bottom of the lowest of the start and end points.
  this way the line will never intersect with the text
- clamp the x position, so that the text doesn't ever leave the screen
  horizontally
- place a white background behind the text so that it will cover text and
  graphics under the ruler item

(TODO: place the ruler on top of everything else)

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-12 11:24:20 -07:00
Dirk Hohndel
07cd62425d Update and add translations
Only the change to subsurface.pro is authored by me.
The rest is generated (subsurface_source.ts) or created by the translators
on Transifex.

This adds Greek, Hungarian (partial), Latvian (partial), Romanian, and
Turkish (partial) translations.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-12 10:34:12 -07:00
Lubomir I. Ivanov
7ee1884f6e Make some dialogs modal to MainWindow
For most dialogs it would be much safer to make them Qt::WindowModal to
the parent (MainWindow).
For now we are not doing this for the preferences dialog as there are
situations where the user might want to be able to move it around and even
interact with the main window.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-12 10:14:17 -07:00
Linus Torvalds
809a6e784c git-save: don't create a redundant new commits with no changes
If the newly created save tree is identical to the parent commit tree,
don't bother creating a new commit.  We are already fully up-to-date.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-11 17:49:31 -07:00
Linus Torvalds
4af254776e git-save: don't save the subsurface version string in the object tree
I didn't think that one through: the version string is already saved in
the commit message, and so saving it in the tree object is redundant.

Now a little redundancy doesn't hurt, but having the tree object depend
on th esubsurface version _does_ end up being annoying: it means that as
you update the subsurface version, doing a data save will result in a
different tree SHA1 even if none of the data changed.

Which doesn't actually matter right now, since we always create a new
commit anyway, but my plan was to skip the commit creation if nothing
changed in the tree.  And saving the version string defeats that if you
are a subsurface developer and the subsurface version keeps changing.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-11 17:49:21 -07:00
Linus Torvalds
b1fa82804a git-load: Add trips to the trip list on loading
We don't actually much use the trip list any more, and it's possible we
should simply get rid of it.  I hadn't added the trips to the trip list
when loading them, and everything worked fine.

Well, *almost* everything worked fine.

There is one use of the list of trips, and that's the "clear the trip
index for each trip before saving them".  That literally seems to be the
only non-debug use of this list, but when we didn't add the trips to the
list, the trip index never got cleared before saving trips.

And even that is unnoticeable for the *first* save event, because the
trip index will have been clear before that.

But on the *second* save event, if the trip index doesn't get cleared
before saving, the saving code will look at the index, say "Hey, I
already saved this" and skip the trip.

So if you loaded the trips from a git repository, and then saved things,
everything worked fine.  But it you saved things a *second* time,
nothing would get saved at all, because all the trips were marked as
saved already.

Anyway, I think the real solution is to get rid of the pointless trip
list, and just use "for_each_dive()" to find all the trips, since that
list clearly is just more pain than gain.  But in the meantime, this
makes the git loading add the trips properly to the list.

Signed-off-by: Linus "oops" Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-11 17:48:43 -07:00
Tomaz Canabrava
9cc942376e Only anim if not first dive when openning subsurface with a divelog.
The animation appeared when the user started subsurface with a default
file, wich was a little annoying since it didn't had a 'from' position
to go and it was also increasing it's size on some window managers
that do subtle windows animations when a program starts. This patch
treats the first dive opened when the program loads with a divelog pa
rameter differently as the following ones storing the velocity value
on a temporary, and reassigning it later.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-11 17:42:42 -07:00
Tomaz Canabrava
b758210c19 Defer mainwindow->show()
The mainwindow->show(); was being called before we parsed
the dives, so in the case of a large dive file, we got a
very quick, but spottable, gray background on the profile.

The mainwindow->show(); now is called just before the
Qt main-loop starts.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-11 17:41:41 -07:00
Tomaz Canabrava
751c76a578 Support save / load for the Animation Speed on the Preferences
User can now fine-tune the animation speed on the preferences,
a value of zero disables it completely.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-11 17:41:41 -07:00
Tomaz Canabrava
9f37bac07a Support Animation Speed via Settings.
This is very userfull for a ( yet to be implemented )
preference dialog about the animation speed, so the
user can enable / disable the animations or make it a bit
faster for it's taste.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-11 17:41:41 -07:00
Lubomir I. Ivanov
466f160c01 Profile2: provide means to disable the tool buttons
Once the poster is displayed when there are no dives in the list,
we may also want to disable the QToolButtons (PO2, SAC, etc..),
until a new dive is loaded and the profile is redrawn.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-11 11:30:31 -07:00
Lubomir I. Ivanov
b382228b7d MainWindow: close all windows once we close the main one
This is useful if we have more non-modal windows and we want
them simply to close with the main one without explicitly
creating class member variables to point to such instances.

A practical example would be the debug window created in
ProfileWidget2() (diveDepthTableView) which holds
the depth profile values.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-11 11:25:46 -07:00
Lakshman
6e4466aa0a Show temperature units in the label when editing dive
Currently when user wants to add a new dive information,
the ways to know what unit system is being used are

 - Through preferences panel.
 - Save the dive information, which displays units in
   the text field.

This patch provides an option to the user to show current
unit system by displaying the unit on the side of the label
when the user is editing the fields.

This feature can be enabled or disabled by using the new
checkbox option i.e. `Show units in text labels` included
in `preferences->units` section.

Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-10 21:10:27 -07:00
Linus Torvalds
eb47b2a8d8 Get rid of crazy empty tag_list element at the start
So this is totally unrelated to the git repository format, except for
the fact that I noticed it while writing the git saving code.

The subsurface divetag list handling is being stupid, and has a
initial dummy entry at the head of the list for no good reason.

I say "no good reason", because there *is* a reason for it: it allows
code to avoid the special case of empty list and adding entries to
before the first entry etc etc.  But that reason is a really *bad*
reason, because it's valid only because people don't understand basic
list manipulation and pointers to pointers.

So get rid of the dummy element, and do things right instead - by
passing a *pointer* to the list, instead of the list. And then when
traversing the list and looking for a place to insert things, don't go
to the next entry - just update the "pointer to pointer" to point to
the address of the next entry. Each entry in a C linked list is no
different than the list itself, so you can use the pointer to the
pointer to the next entry as a pointer to the list.

This is a pet peeve of mine. The real beauty of pointers can never be
understood unless you understand the indirection they allow. People
who grew up with Pascal and were corrupted by that mindset are
mentally stunted. Niklaus Wirth has a lot to answer for!

But never fear. You too can overcome that mental limitation, it just
needs some brain exercise. Reading this patch may help. In particular,
contemplate the new "taglist_add_divetag()".

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-10 11:36:17 -07:00
Lakshman
e8ee701d35 Fixed Subsurface coding style for classes in vim.
With the current suggested settings in `CodingStyle` content
of class blocks gets indented. To avoid this, value `g0` is
added to cinoptions. In addition to this `TODO` thing, few
additional options are suggested.

 - Included the value `(0` to cinoptions, to comply with the
   discontinuation of continuous lines as per Subsurface
   coding style recommendations.

Add two options that aren't exactly about coding style but about
convenience:

 - `hls` option to highlight all search options.
 - `is` option to do incremental search

Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-10 11:34:49 -07:00
Lubomir I. Ivanov
41cec17cff Profile2: reset the zoom level when a new profile is drawn
If the user has zoomed in but then changes to a new dive,
we may want to reset the scale back to the original value (1.0)
based on the current zoomLevel, so that the profile is not stuck
in zoomed mode.

This patch adds a snippet that resets the QGraphicsView scale,
zoomLevel variable and also the toolTip position.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-10 09:02:31 -07:00
Lubomir I. Ivanov
324b8cbff1 Profile2: use a different image when no profile is visible
This patch adds a new image resource named poster.png which,
is shown instead of the 3 posters. The main reason for that
is due to the poster text not being visible. This new image
is pretty much the Subsurface logo only.

It also removes the grid lines, while the poster is visible.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-10 09:02:25 -07:00
Lubomir I. Ivanov
7d9849cfed Profile2: use an implicit initializer for a struct array
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-10 09:02:01 -07:00
Lubomir I. Ivanov
0325b267ee Profile2: fix some initializer list order warnings
Such can be disabled with -Wno-reorder and are clearly
more of a nuisance, but C++98 12.6.2.5 says the order should be
the same as in the class declaration.

On theory this would only speed the compile times a tiny amount.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-10 09:01:58 -07:00
Dirk Hohndel
b1d1c88822 Fix uninitialized variable
s could be used without being set.

Also convert the file to utf-8 - for some reason it was created as
iso8859.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-09 21:25:20 -07:00
Dirk Hohndel
7f32f930ef Increase static buffer size
While 100 was almost certainly long enough for all the non-string data
that we'd find on a single line, it was a little too close for comfort.
So let's go total overkill and not worry about it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-09 21:06:18 -07:00
Linus Torvalds
1fc783aed5 Read salinity from git objects
Simple oversight on the reading side.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-09 21:04:05 -07:00
Linus Torvalds
4312b155e1 parse divecomputer model nickname/firmware/serial information
This was the final piece we didn't read.  I can now read my XML file,
write it to a git repository, read it back, and write it to a new XML
file, and the final XML file is bit-for-bit identical with the original
one.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-09 19:36:40 -07:00
Linus Torvalds
6f3be56d8d Add event parsing to the git object tree loader
This makes us parse everything we save, and I can load my XML file, save
it as a git file, load that git file, save it as a new XML file, and the
end result is identical.

Well...  *ALMOST* identical.  We currently don't save the dive computer
nickname and serial/firmware information in the git repository, so that
does get lost in translation.  But all the actual dive data is there.

NOTE! I have currently only worked with my own dive files.  They are
reasonably complex and complete, and do have a lot of the interesting
cases covered (like multiple dive computers etc), but there's no CCR
information, and all the dives are in trips, so this does need more
testing. It's at the very least very close.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-09 19:36:39 -07:00