Whitespace: fix indentation in subsurfacewebservices.* to use tabs

Signed-off-by: Thiago Macieira <thiago@macieira.org>
General fixes and improvements
Make the QNetworkAccessManager a singleton available to all

One of the rules of using QNetworkAccessManager is to share it among all
users, since sockets and other state can be shared. Looks like Marble
doesn't allow us to set it, though, and it creates multiple instances.
I'll prepare an upstream patch to fix that sometime.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
webservices: Move the static functions to the top of the file

Just my OCD asserting itself. It looks cleaner this way, if the static
functions aren't interleaved in the middle of the WebServices class.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Improve the status message in the download dialog

This also fixes a typo (untill -> until).

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Properly reset the state of the download dialog before dismissing

Re-enable buttons that should be enabled by default, disable the others,
set the status to empty, make the progress bar go back to zero.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Set the download reply pointer to NULL after dismissing it

QNetworkReply might emit signals after it's been told to go away. We
don't want to change the status after that.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Add support for timing the download out

The time out is 30 seconds from the start of the request or from the
last time we got any data from the server.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Make the text in the download status selectable

So I can copy any URLs it shows there in order to test elsewhere...

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Implement the network part of the support for divelogs.de

This implements support for:
 * uploading a zip file containing dives - untested
   (the zip file must have been prepared elsewhere)
 * downloading the dive list and the dive XML files

The networking part is finished, but it's missing the actual import of
the XML files sent by divelogs.de.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Webservices: fix QString argument for zip_open()

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Add some limits to the GF's

Sets the limit for GF's in the preferences panel to 1<=x<=150 and color
it read if gf > 100. Remove the % in the diveplanner view that was
rejected for the preferences view.
The 150 maximum is needed because QSpinBox defaults to maximum 99.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Cleanup some uninitialized variables

I can't really see any point in passing a local loop variable around,
and copying a uninitialized pointer. Better use local variables there
and let the compiler optimize them away if it feels for doing that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Merge branch 'improve-subsurfaceweb' of git://github.com/thiagomacieira/subsurface
Compile fix

Otherwise errno is undefined (at least for me on Linux).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>