-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove version checks for < 10 #9676
Conversation
Results for GUI-tests https://drone.owncloud.com/owncloud/client/11782/6/1 💥 The GUI tests failed. GUI Logs: https://cache.owncloud.com/public/owncloud/client/11782/guiReportUpload/index.html |
3d9cb7c
to
85b973e
Compare
src/libsync/account.cpp
Outdated
// Older version which is not "end of life" according to https://github.com/owncloud/core/wiki/Maintenance-and-Release-Schedule | ||
return serverVersionInt() < makeServerVersion(10, 0, 0) || serverVersion().endsWith(QLatin1String("Nextcloud")); | ||
return serverVersion() < QVersionNumber(10) || serverProduct().endsWith(QLatin1String("Nextcloud")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Readability could be improved by moving the Nextcloud
check into a dedicated if
.
src/libsync/account.cpp
Outdated
} | ||
|
||
void Account::setServerVersion(const QString &version) | ||
void Account::setServerVersion(const QString &version, const QString &productName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This setter's purpose has changed, so it should likely be renamed. There are two dedicated getters for both the version and the product name anyway.
src/libsync/account.h
Outdated
@@ -168,23 +168,18 @@ class OWNCLOUDSYNC_EXPORT Account : public QObject | |||
|
|||
bool hasCapabilities() const; | |||
|
|||
// product | |||
QString serverProduct() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about serverProductName
?
The comment is redundant and doesn't add information, so it should be removed again.
static bool envEnabled = [] { | ||
const auto env = qEnvironmentVariable("OWNCLOUD_PARALLEL_CHUNK"); | ||
if (!env.isEmpty()) { | ||
return env != QLatin1String("false") && env != QLatin1String("0"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe allow any arbitrary casing of the value by comparing to a lowercase value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The env var is not even documented and its behavior is orthogonal to all other env checks.
Unrelated to the review
a9ceb55
to
21beea0
Compare
src/gui/connectionvalidator.cpp
Outdated
@@ -312,13 +315,12 @@ void ConnectionValidator::fetchUser() | |||
job->start(); | |||
} | |||
|
|||
bool ConnectionValidator::setAndCheckServerVersion(const QString &version) | |||
bool ConnectionValidator::setAndCheckServerVersion(const QString &version, const QString &serverProduct) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming wise you may want to call this method setAndCheckServerInfo
now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
21beea0
to
a089025
Compare
Kudos, SonarCloud Quality Gate passed! |
No description provided.