mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 05:25:50 +03:00
SetupWizard: populate credentials from HTTP server URL
If a user enters a server URL in the form of https://user:pass@example.com/, pre-populate the following credentials page with those values.
This commit is contained in:
parent
b29d1e94b5
commit
bd65eb32b7
1 changed files with 12 additions and 0 deletions
|
@ -78,6 +78,18 @@ void OwncloudHttpCredsPage::initializePage()
|
|||
if (!user.isEmpty()) {
|
||||
_ui.leUsername->setText(user);
|
||||
}
|
||||
} else {
|
||||
QUrl url = ocWizard->account()->url();
|
||||
|
||||
const QString user = url.userName();
|
||||
const QString password = url.password();
|
||||
|
||||
if(!user.isEmpty()) {
|
||||
_ui.leUsername->setText(user);
|
||||
}
|
||||
if(!password.isEmpty()) {
|
||||
_ui.lePassword->setText(password);
|
||||
}
|
||||
}
|
||||
_ui.leUsername->setFocus();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue