related tdf#145190 gio_mount: show username when requesting password
It is always nice to know WHICH password you are being asked for.
When a remote open/save service exists (without a saved password)
then the password request immediately pops up and nowhere is there
any indication which service / username the password is for.
This still doesn't indicate which hostname/service this is for,
but better than nothing at all.
To avoid causing any regressions, this was done only when a
username was explicitly passed along. In the case where a
previous password was guessed, that is kept as _NA.
[aMessage provides "Enter password for <user> on <host>"
but that duplicates the label "Enter user name and password for:".
So we don't seem to have much to work with here.]
Change-Id: I0991c76ed1ce625ef354009fb416f1058cbeb313
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123746
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/ucb/source/ucp/gio/gio_mount.cxx b/ucb/source/ucp/gio/gio_mount.cxx
index dfbb9a0..1d2dbce 100644
--- a/ucb/source/ucp/gio/gio_mount.cxx
+++ b/ucb/source/ucp/gio/gio_mount.cxx
@@ -109,13 +109,14 @@ static void ooo_mount_operation_ask_password (GMountOperation *op,
OUString aDomain, aUserName, aPassword;
if (default_user)
aUserName = OUString(default_user, strlen(default_user), RTL_TEXTENCODING_UTF8);
ucbhelper::SimpleAuthenticationRequest::EntityType eUserName =
(flags & G_ASK_PASSWORD_NEED_USERNAME)
? ucbhelper::SimpleAuthenticationRequest::ENTITY_MODIFY
: ucbhelper::SimpleAuthenticationRequest::ENTITY_NA;
if (default_user)
aUserName = OUString(default_user, strlen(default_user), RTL_TEXTENCODING_UTF8);
: aUserName.isEmpty() ? ucbhelper::SimpleAuthenticationRequest::ENTITY_NA
: ucbhelper::SimpleAuthenticationRequest::ENTITY_FIXED;
ucbhelper::SimpleAuthenticationRequest::EntityType ePassword =
(flags & G_ASK_PASSWORD_NEED_PASSWORD)