Skip to content

Commit

Permalink
check for need of signing TOS during connectivity check
Browse files Browse the repository at this point in the history
Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
  • Loading branch information
nilsding committed Feb 18, 2025
1 parent e2725c1 commit 0e08fb2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/gui/accountstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ bool AccountState::isConnected() const
return _state == Connected;
}

bool AccountState::needsToSignTermsOfService() const

Check warning on line 225 in src/gui/accountstate.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/accountstate.cpp:225:20 [modernize-use-trailing-return-type]

use a trailing return type for this function
{
return _state == NeedToSignTermsOfService;
}

void AccountState::tagLastSuccessfullETagRequest(const QDateTime &tp)

Check warning on line 230 in src/gui/accountstate.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/accountstate.cpp:230:67 [readability-identifier-length]

parameter name 'tp' is too short, expected at least 3 characters
{
_timeOfLastETagCheck = tp;
Expand Down Expand Up @@ -316,7 +321,7 @@ void AccountState::checkConnectivity()
_connectionErrors.clear();
connect(conValidator, &ConnectionValidator::connectionResult,
this, &AccountState::slotConnectionValidatorResult);
if (isConnected()) {
if (isConnected() || needsToSignTermsOfService()) {

Check warning on line 324 in src/gui/accountstate.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/accountstate.cpp:324:5 [bugprone-branch-clone]

if with identical then and else branches
// Use a small authed propfind as a minimal ping when we're
// already connected.
conValidator->checkAuthentication();
Expand Down
2 changes: 2 additions & 0 deletions src/gui/accountstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ class AccountState : public QObject, public QSharedData

bool isConnected() const;

bool needsToSignTermsOfService() const;

/** Returns a new settings object for this account, already in the right groups. */
std::unique_ptr<QSettings> settings();

Expand Down

0 comments on commit 0e08fb2

Please sign in to comment.