Commit graph

11 commits

Author SHA1 Message Date
Robert C. Helling
a241393e7b Print paths to internal files in verbose mode
When run with -v option, this prints local file names like the path
to the local git repository and the hash file.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-04 16:29:31 +01:00
Dirk Hohndel
aeedc2a619 Add helper function to safely move away file or directory
Try numberical suffix until you find one that isn't used yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 05:10:43 -07:00
Robert C. Helling
d0145621a1 Hash images upon loading divelog file rather than when loading image
Up to now, we only computed hashes of images upon actually displaying the images.

With this patch we start to compute hashes once we load the xml or from git. This
happens in the background, so the user should note an increased CPU load only once
per divelog.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-17 08:56:25 -07:00
Dirk Hohndel
174cb1ffb1 HTML export: need to work harder to find the pictures
Simply looking at the filename in the picture structure isn't enough (now,
arguably one might say that it should be and that that data structure
should be updated, but that's not how other parts of Subsurface have
implemented things so I don't want to break that assumption here).

So instead we look up where the pictures actually was loaded from and then
copy that file into the right location.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21 12:49:05 -07:00
Dirk Hohndel
31fbc16785 Git storage: implement picture loading from git
The interesting challenge here is what to do with the picture data stored
in the git repository. If the pictures are already in the file system (for
example because Subsurface is runnin on the same machine that this data
file was saved on) it would be silly to extract them again every time the
dive log is opened.

So instead we try to figure out if the pictures can be located and only
create local copies of them if that isn't the case.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21 12:49:05 -07:00
Dirk Hohndel
c9d48c9a72 Add helper function to return local filename of picture as C string
This way we can actually find the picture that we are showing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21 12:49:05 -07:00
Dirk Hohndel
b27538feba Move helper declarations into a better header file
This way the helpers can be more easily used by other modules.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21 07:45:22 -07:00
Dirk Hohndel
f6981f0210 Add helper function to create a directory
Yes, this could easily done from the C code. But this seems just so much
easier and I don't have to worry about the oddities of Windows and all
that.

I'm lazy. So sue me.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-13 18:26:34 -07:00
Dirk Hohndel
df255e2573 Don't show an error if you fail to open the cloud storage
The lower level functions will already report that things didn't connect
successfully, no reason to repeat it here (which then exposes the git
URL).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-13 09:14:48 -07:00
Dirk Hohndel
ef95bd9a27 Indicate that there are unsaved changes with a '*' in the window title
This seems to be a fairly common way to indicate this property.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-12 10:21:16 -07:00
Dirk Hohndel
57f2c81125 Add header for Qt helpers used from C functions
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-12 10:20:57 -07:00