Skip to content

Commit 7eeeb50

Browse files
committed
fix: enforced URL should skip the first screen
1 parent af0c825 commit 7eeeb50

4 files changed

Lines changed: 20 additions & 2 deletions

File tree

src/gui/owncloudsetupwizard.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ void OwncloudSetupWizard::testOwnCloudConnect()
491491
job->setFollowRedirects(false);
492492
job->setProperties(QList<QByteArray>() << "getlastmodified");
493493
connect(job, &PropfindJob::result, _ocWizard, &OwncloudWizard::successfulStep);
494-
connect(job, &PropfindJob::finishedWithError, this, [this] (QNetworkReply *reply) -> void {
494+
connect(job, &PropfindJob::finishedWithError, this, [this] (QNetworkReply *) -> void {
495495
slotAuthError();
496496
});
497497

src/gui/wizard/accountwizardcontroller.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ bool AccountWizardController::overrideServerSelectionRequired() const
170170
return !_overrideServerUrls.isEmpty();
171171
}
172172

173+
bool AccountWizardController::startLoginFlowAutomatically() const
174+
{
175+
return Theme::instance()->startLoginFlowAutomatically()
176+
&& Theme::instance()->forceOverrideServerUrl()
177+
&& !_serverUrl.isEmpty()
178+
&& !Theme::instance()->multipleOverrideServers()
179+
&& !overrideServerSelectionRequired();
180+
}
181+
173182
QStringList AccountWizardController::overrideServerNames() const
174183
{
175184
return _overrideServerNames;

src/gui/wizard/accountwizardcontroller.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class AccountWizardController : public QObject
4343
Q_PROPERTY(QString serverUrl READ serverUrl WRITE setServerUrl NOTIFY serverUrlChanged)
4444
Q_PROPERTY(bool serverUrlEditable READ serverUrlEditable NOTIFY serverUrlEditableChanged)
4545
Q_PROPERTY(bool overrideServerSelectionRequired READ overrideServerSelectionRequired NOTIFY overrideServerSelectionChanged)
46+
Q_PROPERTY(bool startLoginFlowAutomatically READ startLoginFlowAutomatically CONSTANT)
4647
Q_PROPERTY(QStringList overrideServerNames READ overrideServerNames NOTIFY overrideServerSelectionChanged)
4748
Q_PROPERTY(int overrideServerIndex READ overrideServerIndex WRITE setOverrideServerIndex NOTIFY overrideServerSelectionChanged)
4849
Q_PROPERTY(bool busy READ busy NOTIFY busyChanged)
@@ -114,6 +115,7 @@ class AccountWizardController : public QObject
114115
void setServerUrl(const QString &serverUrl);
115116
[[nodiscard]] bool serverUrlEditable() const;
116117
[[nodiscard]] bool overrideServerSelectionRequired() const;
118+
[[nodiscard]] bool startLoginFlowAutomatically() const;
117119
[[nodiscard]] QStringList overrideServerNames() const;
118120
[[nodiscard]] int overrideServerIndex() const;
119121
void setOverrideServerIndex(int index);

src/gui/wizard/qml/AccountWizardWindow.qml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,14 @@ ApplicationWindow {
4545
: compactHeight
4646
}
4747

48-
Component.onCompleted: root.height = root.defaultHeightForCurrentStep()
48+
Component.onCompleted: {
49+
root.height = root.defaultHeightForCurrentStep()
50+
if (root.controller && root.controller.startLoginFlowAutomatically) {
51+
Qt.callLater(function() {
52+
root.controller.submitServerUrl()
53+
})
54+
}
55+
}
4956

5057
onClosing: function(close) {
5158
if (!controllerFinished && controller) {

0 commit comments

Comments
 (0)