Commit graph

69 commits

Author SHA1 Message Date
jan Iversen
c6998ee926 desktop-widgets/facebook: remove SettingsObjectWrapper
remove use of SettingsObjectWrapper::
remove include of SettingsObjectWrapper.h
use qPrefFoo:: for setters and getters
replace prefs.foo with qPrefXYZ::foo() where feasible
(this expands to the same code, but gives us more control
over the variable).

Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-15 16:11:39 -07:00
Berthold Stoeger
1c4a859c8d Cleanup: remove all override modifiers
Commit df156a56c0 replaced "virtual"
by "override" where appropriate. Unfortunately, this had the
unintended consequence of producing numerous clang warnings. If
clang finds a override-modified function in a class definition,
it warns for *all* overriden virtual functions without the override
modifier.

To solve this, go the easy route and remove all overrides. At least
it is consistent.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-08-01 06:30:00 -07:00
Berthold Stoeger
df156a56c0 Cleanup: replace virtual by override where appropriate
The keyword "virtual" signalizes that the function is virtual,
i.e. the function of the derived class is called, even if the
call is on the parent class.

It is not necessary to repeat the "virtual" keyword in derived
classes. To highlight derived virtual functions, the keyword
"override" should be used instead. It results in a hard compile-
error, if no function is overridden, thus avoiding subtle bugs.

Replace "virtual" by "override" where appropriate. Moreover,
replace Q_DECL_OVERRIDE by override, since we require reasonably
recent compilers anyway. Likewise, replace /* reimp */ by
"override" for consistency and compiler support.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-07-31 11:02:34 +02:00
jan Iversen
f175890632 core: activate qPrefFacebook
remove Facebook from SettingsObjectWrapper and reference qPrefFacebook

update files using SettingsObjectWrapper/Facebook to use qPrefFacebook

this activated qPrefFacebook and removed the similar class from
SettingsObjectWrapper.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-27 12:36:20 -07:00
Berthold Stoeger
36b9e5e31e Cleanup: fold core/helpers.h into core/qthelper.h
helpers.h included qthelper.h and all functions declared in helpers.h
were defined in qthelper.h. Therefore fold the former into the latter,
since the split seems completely arbitrary.

While doing so, change the return-type of get_dc_nichname from
"const QString" to "QString".

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-06-04 08:50:10 -07:00
jan Iversen
2b84482787 desktop-widgets/.../facebook: Change Q_UNUSED to no parameter name
C++ permits use of parameters without name, which signals unused

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 12:48:04 -07:00
Berthold Stoeger
2105d3c7d0 Cleanup: consistently use toUtf8() instead of toLocal8Bit()
These do the same, since the text-codex is set to UTF-8 on startup.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-14 13:55:36 +02:00
Jan Mulder
0852f9a2ab cleanup: remove unused private variable
CID 208307

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-29 09:14:20 -08:00
Martin Měřinský
0855f6f315 Use icons relative path.
Icon paths are defined in one place only - application's embedded resources.

Signed-off-by: Martin Měřinský <mermar@centrum.cz>
2017-11-30 23:14:46 -08:00
Dirk Hohndel
fd9c905ba3 Revert "Use icons relative path."
This reverts commit b0d98f6e26.
2017-11-29 14:05:07 -08:00
Martin Měřinský
b0d98f6e26 Use icons relative path.
Icon paths are defined in one place only - application's embedded resources.

Signed-off-by: Martin Měřinský <mermar@centrum.cz>
2017-11-29 11:46:35 +01:00
Berthold Stoeger
d1d4b4edb1 Initialize Facebook page only when dialog is shown
Quick hack to avoid Facebook access on every program start. Move the initialization
of the login page from the FacebookConnectWidget constructor to the show event handler.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-10 10:04:28 -08:00
Guillaume GARDET
5d12143a6a [Facebook] Back to previous behavior when we were able to upload data,
even without album creation permission
2017-10-23 10:05:23 -04:00
Guillaume GARDET
ee1e03c774 [Facebook] add more debug when we are not able to create a new album 2017-10-23 10:05:23 -04:00
Dirk Hohndel
59bf217157 Turn off Facebook debug messages unless verbose
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-20 06:51:51 -04:00
Tomaz Canabrava
aca8fea2a9 [Facebook] Enable the send button on edit
Not when you press enter.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:54:03 -07:00
Tomaz Canabrava
527078e277 [Facebook] Use statusbar instead of popup messages
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:54:03 -07:00
Tomaz Canabrava
3e2a86cf80 [Facebook] More debug calls
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:54:03 -07:00
Tomaz Canabrava
3a564f412c [Facebook] Use correct albumName variable
and code cleanup

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:54:03 -07:00
Tomaz Canabrava
5595d9a8b0 [Facebook] Lots of debug messages
Important debug messages, don't remove.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:54:03 -07:00
Tomaz Canabrava
15c4fadde9 [Facebook] Use the nonblocking calls to post on fb
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:54:03 -07:00
Tomaz Canabrava
e662ce1cec [Facebook] Fill the info struct
This will be used to send the profile to Facebook

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:54:03 -07:00
Tomaz Canabrava
dd17c6355d [Facebook] Remove broken function
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:54:03 -07:00
Tomaz Canabrava
1d8eb0d78a [Facebook] Code organization
Create the variable near its use.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:54:03 -07:00
Tomaz Canabrava
df166247af [Facebook] Signal that the album is found
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:53:59 -07:00
Tomaz Canabrava
a2734e6aaf [Facebook] New method, grabProfilePixmap
Just some code organization

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:52:03 -07:00
Tomaz Canabrava
5778dceb52 [Facebook] Prepare the FacebookInfo struct
This will hold the information for the profile upload.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:51:53 -07:00
Tomaz Canabrava
ba8e6878a8 [Facebook] Remove dead code
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:51:19 -07:00
Dirk Hohndel
571918feaa Random whitespace cleanup
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:57:34 -07:00
Tomaz Canabrava
f159802053 [Facebook] Add hability to choose size of profile
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:57:34 -07:00
Tomaz Canabrava
9b1a949a39 [Facebook] Resize the profile before sending it
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:57:34 -07:00
Tomaz Canabrava
2db4f626ed [Facebook] Only mark as connected if user id is received
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:57:34 -07:00
Tomaz Canabrava
a6aeaf897a [Facebook] create userIdReceived slot
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:57:34 -07:00
Tomaz Canabrava
689dcf1058 [Facebook] Mem leaks
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:57:34 -07:00
Tomaz Canabrava
475dfe1194 [Facebook] Use only one Network Manager
Fixes quite a few memory leaks.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:57:28 -07:00
Dirk Hohndel
7b8832bc0b [Facebook] fewer UI freezes while accessing facebook
Use signal / slots on the networkreply instead of freezing the event
loop.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:45:28 -07:00
Tomaz Canabrava
c8c9a5dc65 [Facebook] conversion to new connect syntax
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:44:39 -07:00
Tomaz Canabrava
f6ac79296e [Facebook] Dont use deprecated feature
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:43:45 -07:00
Tomaz Canabrava
73c242b6eb [Facebook] Use unblocking call for QNetworkRequest
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:43:45 -07:00
Tomaz Canabrava
8ce4692b5c [Facebook] Use QByteArray directly
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:43:41 -07:00
Federico Masias
777cf6c3fd Change Facebook upload description to eliminate confusion
Signed-off-by: Federico Masias <fede@masias.net>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-26 23:34:38 -04:00
Tomaz Canabrava
19db825240 Facebook support: fix export dialog layout
Dialog layout was broken, now we can actually resize.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2017-09-13 09:36:22 -07:00
Tomaz Canabrava
e43a116457 Facebook support: use the new Graph Api
This is basically a one liner.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2017-09-13 09:36:09 -07:00
Stefan Fuchs
e6d884cf26 Creation of dive duration string and surface interval string
Update the function to create the dive duration string in a way that
it can be used also in info and stats tab and added some more flexibility.

Changed layout for <1h freedives to "0:05:35" (w/o units) or "5:35min"
(with units and :) or "5min 35sec" (with units with space).

Add a new function to create the surface interval string.

Completely remove old function get_time_string() and get_time_string_s().

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-05-26 15:50:52 -07:00
Dirk Hohndel
9021a44ccc Add SPDX header to desktop widgets
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-29 13:32:55 -07:00
Jan Mulder
588a83e339 Fix issue 280: Facebook without a dive selected
Accessing Facebook stuff without a dive selected (as in an empty logbook)
just SIGSEGVs. Just be more carefull.

After this fix, it is still possible to upload an "empty dive" to FB. Ok,
a little pointless, but a nice picture of the Subsurface logo is uploaded
to FB. Consider it an easter egg :-)

Fixes: #280

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-26 21:58:29 -07:00
Martin Měřinský
74b1f7ac5e facebook > Facebook 2017-02-21 07:03:10 -08:00
Dirk Hohndel
b2cc840ebf Facebook integration: change the menu entry to disconnect
This way the menu entry becomes the togglee it appears it was designed to be in
the first place.

This closes #129

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-01 22:24:48 -08:00
Dirk Hohndel
a63505dde9 Facebook integration: actually call the disconnect callback
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-01 22:21:47 -08:00
Dirk Hohndel
7e98016832 Facebook integration: whitespace cleanup
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-01 22:20:28 -08:00