[gnome-control-center] user-accounts: Remove unused password hints
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] user-accounts: Remove unused password hints
- Date: Wed, 3 May 2017 09:40:55 +0000 (UTC)
commit 9e4123363edce1cfde943d5a68e185a7b2f39e82
Author: Ondrej Holy <oholy redhat com>
Date: Wed Apr 5 13:24:47 2017 +0200
user-accounts: Remove unused password hints
Short password hints are not used for some time. Let's remove them.
https://bugzilla.gnome.org/show_bug.cgi?id=780002
panels/user-accounts/pw-utils.c | 24 +-----------------------
panels/user-accounts/pw-utils.h | 2 --
panels/user-accounts/um-account-dialog.c | 5 ++---
panels/user-accounts/um-password-dialog.c | 5 ++---
4 files changed, 5 insertions(+), 31 deletions(-)
---
diff --git a/panels/user-accounts/pw-utils.c b/panels/user-accounts/pw-utils.c
index 8c70cd9..7c31e56 100644
--- a/panels/user-accounts/pw-utils.c
+++ b/panels/user-accounts/pw-utils.c
@@ -125,7 +125,6 @@ pw_strength (const gchar *password,
const gchar *old_password,
const gchar *username,
const gchar **hint,
- const gchar **long_hint,
gint *strength_level)
{
gint rv, level = 0;
@@ -138,42 +137,21 @@ pw_strength (const gchar *password,
strength = CLAMP (0.01 * rv, 0.0, 1.0);
if (rv < 0) {
- *hint = C_("Password strength", "Strength: Weak");
}
else if (strength < 0.50) {
level = 1;
- *hint = C_("Password strength", "Strength: Low");
} else if (strength < 0.75) {
level = 2;
- *hint = C_("Password strength", "Strength: Medium");
} else if (strength < 0.90) {
level = 3;
- *hint = C_("Password strength", "Strength: Good");
} else {
level = 4;
- *hint = C_("Password strength", "Strength: High");
}
- *long_hint = pw_error_hint (rv);
+ *hint = pw_error_hint (rv);
if (strength_level)
*strength_level = level;
return strength;
}
-
-int
-pw_strength_hint_get_width_chars (void)
-{
- gint len;
-
- len = 0;
- len = MAX (len, strlen (C_("Password strength", "Strength: Weak")));
- len = MAX (len, strlen (C_("Password strength", "Strength: Low")));
- len = MAX (len, strlen (C_("Password strength", "Strength: Medium")));
- len = MAX (len, strlen (C_("Password strength", "Strength: Good")));
- len = MAX (len, strlen (C_("Password strength", "Strength: High")));
- len += 2;
-
- return len;
-}
diff --git a/panels/user-accounts/pw-utils.h b/panels/user-accounts/pw-utils.h
index 0a3312d..2a3cc42 100644
--- a/panels/user-accounts/pw-utils.h
+++ b/panels/user-accounts/pw-utils.h
@@ -26,6 +26,4 @@ gdouble pw_strength (const gchar *password,
const gchar *old_password,
const gchar *username,
const gchar **hint,
- const gchar **long_hints,
gint *strength_level);
-int pw_strength_hint_get_width_chars (void);
diff --git a/panels/user-accounts/um-account-dialog.c b/panels/user-accounts/um-account-dialog.c
index 805339a..94191fa 100644
--- a/panels/user-accounts/um-account-dialog.c
+++ b/panels/user-accounts/um-account-dialog.c
@@ -272,15 +272,14 @@ update_password_strength (UmAccountDialog *self)
const gchar *password;
const gchar *username;
const gchar *hint;
- const gchar *long_hint;
gint strength_level;
password = gtk_entry_get_text (GTK_ENTRY (self->local_password));
username = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (self->local_username));
- pw_strength (password, NULL, username, &hint, &long_hint, &strength_level);
+ pw_strength (password, NULL, username, &hint, &strength_level);
- gtk_label_set_label (GTK_LABEL (self->local_hint), long_hint);
+ gtk_label_set_label (GTK_LABEL (self->local_hint), hint);
gtk_level_bar_set_value (GTK_LEVEL_BAR (self->local_strength_indicator), strength_level);
if (strength_level > 0) {
diff --git a/panels/user-accounts/um-password-dialog.c b/panels/user-accounts/um-password-dialog.c
index 15f561f..9b79743 100644
--- a/panels/user-accounts/um-password-dialog.c
+++ b/panels/user-accounts/um-password-dialog.c
@@ -69,7 +69,6 @@ update_password_strength (UmPasswordDialog *um)
const gchar *username;
gint strength_level;
const gchar *hint;
- const gchar *long_hint;
if (um->user == NULL) {
return 0;
@@ -80,10 +79,10 @@ update_password_strength (UmPasswordDialog *um)
username = act_user_get_user_name (um->user);
pw_strength (password, old_password, username,
- &hint, &long_hint, &strength_level);
+ &hint, &strength_level);
gtk_level_bar_set_value (GTK_LEVEL_BAR (um->strength_indicator), strength_level);
- gtk_label_set_label (GTK_LABEL (um->password_hint), long_hint);
+ gtk_label_set_label (GTK_LABEL (um->password_hint), hint);
if (strength_level > 0) {
set_entry_validation_checkmark (GTK_ENTRY (um->password_entry));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]