/cpw/tomkiewicz/masterpassword: a57368227f78: Get rid of redunda...

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Tue Mar 26 11:18:13 EDT 2013


Changeset: a57368227f78b85d86d8580dd4a8f144a1661671
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2013-03-26 16:18 +0100
Branch:	 soc.2008.masterpassword
URL: https://hg.pidgin.im/cpw/tomkiewicz/masterpassword/rev/a57368227f78

Description:

Get rid of redundant parameters

diffstat:

 libpurple/keyring.c |  21 +++++++++++++--------
 libpurple/keyring.h |   6 +-----
 pidgin/gtkprefs.c   |   4 ++--
 3 files changed, 16 insertions(+), 15 deletions(-)

diffs (124 lines):

diff --git a/libpurple/keyring.c b/libpurple/keyring.c
--- a/libpurple/keyring.c
+++ b/libpurple/keyring.c
@@ -527,7 +527,7 @@ purple_keyring_set_inuse_drop_cb(gpointe
 		current_change_tracker = NULL;
 
 		if (tracker->cb != NULL)
-			tracker->cb(tracker->new, TRUE, NULL, tracker->data);
+			tracker->cb(tracker->new, NULL, tracker->data);
 	} else {
 		PurpleKeyringClose close =
 			purple_keyring_get_close_keyring(tracker->new);
@@ -545,8 +545,13 @@ purple_keyring_set_inuse_drop_cb(gpointe
 
 		current_change_tracker = NULL;
 
+		if (tracker->error == NULL) {
+			tracker->error = g_error_new(PURPLE_KEYRING_ERROR,
+				PURPLE_KEYRING_ERROR_UNKNOWN,
+				"Unknown error has occured");
+		}
 		if (tracker->cb != NULL)
-			tracker->cb(tracker->old, FALSE, tracker->error, tracker->data);
+			tracker->cb(tracker->old, tracker->error, tracker->data);
 	}
 
 	purple_keyring_change_tracker_free(tracker);
@@ -685,7 +690,7 @@ purple_keyring_set_inuse(const PurpleKey
 		error = g_error_new(PURPLE_KEYRING_ERROR,
 			PURPLE_KEYRING_ERROR_UNKNOWN,
 			"There is password migration session already running");
-		cb(oldkeyring, FALSE, error, data);
+		cb(oldkeyring, error, data);
 		g_error_free(error);
 		return;
 	}
@@ -695,7 +700,7 @@ purple_keyring_set_inuse(const PurpleKey
 			"Old and new keyring are the same: %s.\n",
 			(newkeyring != NULL) ? newkeyring->id : "(null)");
 		if (cb != NULL)
-			cb(newkeyring, TRUE, NULL, data);
+			cb(newkeyring, NULL, data);
 		return;
 	}
 
@@ -745,7 +750,7 @@ purple_keyring_set_inuse(const PurpleKey
 		purple_keyring_inuse = newkeyring;
 		g_assert(current_change_tracker == NULL);
 		if (cb != NULL)
-			cb(newkeyring, TRUE, NULL, data);
+			cb(newkeyring, NULL, data);
 	}
 }
 
@@ -1167,7 +1172,7 @@ purple_keyring_change_master(PurpleKeyri
 		error = g_error_new(PURPLE_KEYRING_ERROR, PURPLE_KEYRING_ERROR_NOCHANNEL,
 			"Cannot change a master password at the moment.");
 		if (cb != NULL)
-			cb(FALSE, error, data);
+			cb(error, data);
 		g_error_free(error);
 		return;
 	}
@@ -1177,7 +1182,7 @@ purple_keyring_change_master(PurpleKeyri
 			"No keyring configured, cannot change master password.");
 		purple_debug_error("keyring", "No keyring configured, cannot change master password.\n");
 		if (cb)
-			cb(FALSE, error, data);
+			cb(error, data);
 		g_error_free(error);
 
 	} else {
@@ -1187,7 +1192,7 @@ purple_keyring_change_master(PurpleKeyri
 			error = g_error_new(PURPLE_KEYRING_ERROR, PURPLE_KEYRING_ERROR_NOCAP,
 				"Keyring doesn't support master passwords.");
 			if (cb)
-				cb(FALSE, error, data);
+				cb(error, data);
 
 			g_error_free(error);
 
diff --git a/libpurple/keyring.h b/libpurple/keyring.h
--- a/libpurple/keyring.h
+++ b/libpurple/keyring.h
@@ -89,24 +89,20 @@ typedef void (*PurpleKeyringSaveCallback
 /**
  * Callback for once the master password for a keyring has been changed.
  *
- * @param result TRUE if the password has been changed, FALSE otherwise.
  * @param error  Error that has occurred.
  * @param data   Data passed to the callback.
  */
-typedef void (*PurpleKeyringChangeMasterCallback)(gboolean result,
-                                                  GError *error,
+typedef void (*PurpleKeyringChangeMasterCallback)(GError *error,
                                                   gpointer data);
 
 /**
  * Callback for when we change the keyring.
  *
  * @param keyring The keyring that is in use.
- * @param result  TRUE if the keyring was changed, FALSE otherwise.
  * @param error   An error that might have occurred.
  * @param data    A pointer to user supplied data.
  */
 typedef void (*PurpleKeyringSetInUseCallback)(const PurpleKeyring *keyring,
-                                              gboolean result,
                                               GError *error,
                                               gpointer data);
 
diff --git a/pidgin/gtkprefs.c b/pidgin/gtkprefs.c
--- a/pidgin/gtkprefs.c
+++ b/pidgin/gtkprefs.c
@@ -2593,8 +2593,8 @@ change_master_password_cb(GtkWidget *but
 }
 
 static void
-keyring_page_pref_set_inuse(const PurpleKeyring *keyring, gboolean result,
-	GError *error, gpointer _combo_box)
+keyring_page_pref_set_inuse(const PurpleKeyring *keyring, GError *error,
+	gpointer _combo_box)
 {
 	GtkComboBox *combo_box = _combo_box;
 	const PurpleKeyring *in_use = purple_keyring_get_inuse();



More information about the Commits mailing list