[gnome-disk-utility] trivial coding style fix
- From: David Zeuthen <davidz src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-disk-utility] trivial coding style fix
- Date: Thu, 26 Mar 2009 12:18:50 -0400 (EDT)
commit 64b8d7227308aedb2318829a8ef71656ad81205b
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Mar 25 23:20:29 2009 -0400
trivial coding style fix
Use temporaries for the passphrases to make the conditions more readable.
Signed-off-by: David Zeuthen <davidz redhat com>
---
src/gdu-gtk/gdu-gtk.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/gdu-gtk/gdu-gtk.c b/src/gdu-gtk/gdu-gtk.c
index 4a96fa1..d49afd7 100644
--- a/src/gdu-gtk/gdu-gtk.c
+++ b/src/gdu-gtk/gdu-gtk.c
@@ -466,16 +466,18 @@ typedef struct
static void
gdu_util_dialog_secret_update (DialogSecretData *data)
{
- if (strcmp (gtk_entry_get_text (GTK_ENTRY (data->password_entry_new)),
- gtk_entry_get_text (GTK_ENTRY (data->password_entry_verify))) != 0) {
+ const char *current, *new, *verify;
+
+ current = gtk_entry_get_text (GTK_ENTRY (data->password_entry));
+ new = gtk_entry_get_text (GTK_ENTRY (data->password_entry_new));
+ verify = gtk_entry_get_text (GTK_ENTRY (data->password_entry_verify));
+
+ if (strcmp (new, verify) != 0) {
gtk_widget_show (data->warning_hbox);
gtk_label_set_markup (GTK_LABEL (data->warning_label), "<i>Passphrases do not match</i>");
gtk_widget_set_sensitive (data->button, FALSE);
} else if (!data->is_new_password &&
- (strlen (gtk_entry_get_text (GTK_ENTRY (data->password_entry))) > 0 ||
- strlen (gtk_entry_get_text (GTK_ENTRY (data->password_entry_new))) > 0) &&
- strcmp (gtk_entry_get_text (GTK_ENTRY (data->password_entry)),
- gtk_entry_get_text (GTK_ENTRY (data->password_entry_new))) == 0) {
+ (current[0] != 0 || new[0] != 0) && strcmp (current, new) == 0) {
gtk_widget_show (data->warning_hbox);
gtk_label_set_markup (GTK_LABEL (data->warning_label), "<i>Passphrases do not differ</i>");
gtk_widget_set_sensitive (data->button, FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]