Closed Mte90 closed 3 years ago
This looks good. Could you rebase/squash this into a single commit?
I am trying to understand why I am getting a 401 if I use https://wakapi.dev/ and not with the official service. Also I am not sure how to get debug info as I am not so skilled with C++ and Qt network APIs.
So I updated the code also for Qt 5.15 to avoid some deprecation errors. There is one that I don't know how to fix:
/home/mte90/Desktop/kde/kate-wakatime/wakatimeplugin.cpp: In member function ‘void WakaTimeView::sendQueuedHeartbeats()’:
/home/mte90/Desktop/kde/kate-wakatime/wakatimeplugin.cpp:384:32: warning: ‘QNetworkAccessManager::NetworkAccessibility QNetworkAccessManager::networkAccessible() const’ is deprecated [-Wdeprecated-declarations]
384 | if (nam->networkAccessible() != QNetworkAccessManager::Accessible) {
| ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtNetwork/QNetworkAccessManager:1,
from /home/mte90/Desktop/kde/kate-wakatime/wakatimeplugin.cpp:46:
/usr/include/x86_64-linux-gnu/qt5/QtNetwork/qnetworkaccessmanager.h:160:53: note: declared here
160 | QT_DEPRECATED_VERSION_5_15 NetworkAccessibility networkAccessible() const;
About merge in a single commit you can do in Github the squash to a single commit when you press the green button on the arrow.
Are you going to push more or do you want me to try this locally? I want to see about removing the changes in CMakeLists.txt and the deprecation issue with QNetworkAccess.
That part is just a warning. It seems Qt project does not want those functions to be used anymore. So I guess a replacement to check if we are offline needs to be put in. In particular, probably just want to check if apiUrlPath
can be used at all. If it fails a pre-flight then assume we are offline. If you want to implement this, please do so.
I finished working on that PR :-)
Thanks!
Added support for a new parameter
api_url
for other wakatime host replacements.